GWT grails plugin ERROR resource.ResourceMeta - Resource not found: %nocache.js - gwt

I'm having trouble using the GWT-Grails plugin. I tried to follow this example exactly, but I end up having this error:
| Error 2012-10-28 00:25:49,567 [http-bio-8080-exec-2] ERROR resource.ResourceMeta - Resource not found: /gwt/g3wt.Application/g3wt.Application.nocache.js
I get this error after I enter these commands: ( I am simply following this guide here )
>grails create-app g3wt
>cd g3wt
>grails install-plugin gwt
>grails create-gwt-module g3wt.Application
>grails create-gwt-page main/index.gsp g3wt.Application
>grails run-app
>grails run-gwt-client
this is the index.gsp code (which is autogenerated anyway):
<html>
<head>
<!-- Integrate with Sitemesh layouts -->
<meta name="layout" content="main" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Example title (change this!)</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="${resource(dir: 'gwt/g3wt.Application', file: 'g3wt.Application.nocache.js')}"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic ui -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
<!-- Add the rest of the page here, or leave it -->
<!-- blank for a completely dynamic interface. -->
</body>
</html>
I understand that the nocache.js cannot be found, so I thought I could try to see where exactly it is. However, using the eclipse search function, it shows that the file is not created at all. Although there is a file named application.js.
Why is the nocache.js not created, and how do I fix this? I've been stumped for a while now, and it's frustrating.
I'm using gwt plugin 0.7.1 and grails 2.1.1, with eclipse 4.2 and a Linux machine.

I was having the same problem and found the answer here.
buildconfig.groovy is in the conf folder. Just comment out the plugin where the runtime is ":resouces..."

Okay, so I got the error to disappear by first running
grails> compile-gwt-modules
Now a different problem occurs. The front-end gwt codes I made, aren't displayed.

You can add in you Confing.groovy:
grails.resources.adhoc.excludes = ['**/gwt/**']
This will solve the problem. But if you use plugin version 0.8 this issue should be resolved.

Related

MySampleApplication clickme button does not appear when deployed to container

I have built a new project using GWT. If I run the project from the Intellij IDEA IDE after a few seconds the 'clickme' control appears in the browser and everything works as expected.
I have created an artifact for a application war file, which is created in the expected ../out/artifact folder.
When I deploy the .war file to apache tomcat, and click on the webapp in the apache tomcat manager I just get the list of files under the webapps/MySampleApplication file location.
If I select the MySampleAppliacation.html file I see the text in that html file but the 'clickme' button never appears.
I have done a lot of googling but have not solved the problem. I checked and the gwt-user.jar file is in the lib folder of the webapp.
This is the GWT control file
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src /gwt-module.dtd">
<module rename-to="MySampleApplication">
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Specify the app entry point class. -->
<entry-point class='com.mySampleApplication.client.MySampleApplication'/>
<!-- Specify the app servlets. -->
<servlet path='/MySampleApplicationService' class='com.mySampleApplication.server.MySampleApplicationServiceImpl'/>
</module>
This is the project html page
<html>
<head>
<title>Wrapper HTML for App</title>
<link type="text/css" rel="stylesheet" href="MySampleApplication.css">
<!-- -->
<!-- This script is required bootstrap stuff. -->
<!-- -->
<script type="text/javascript" language="javascript"
src="MySampleApplication/MySampleApplication.nocache.js"></script>
</head>
<body>
<h1>Sample Application</h1>
<p>
This is an example of a host page for the App application.
You can attach a Web Toolkit module to any HTML page you like,
making it easy to add bits of AJAX functionality to existing pages
without starting from scratch.
</p>
<table align="center">
<tr>
<td id="slot1"></td>
<td id="slot2"></td>
</tr>
</table>
</body>
</html>
For good measure, here are all the files under webapps for this project
MySampleApplication\index.html
MySampleApplication\MySampleApplication
MySampleApplication\MySampleApplication.css
MySampleApplication\MySampleApplication.html
MySampleApplication\WEB-INF
MySampleApplication\MySampleApplication\0651E8A6D149EEF5E6386F087426CF0A.cache.html
MySampleApplication\MySampleApplication\0CE0D511D927FEB65BA6F6D96F24D2D4.cache.html
MySampleApplication\MySampleApplication\3C8C88AE707243315A0D688BD60B8CCA.cache.html
MySampleApplication\MySampleApplication\4A4AEE91A97252CBA376B9B27863F6ED.cache.html
MySampleApplication\MySampleApplication\644584634D68B773C08A73FA726669A5.gwt.rpc
MySampleApplication\MySampleApplication\clear.cache.gif
MySampleApplication\MySampleApplication\D003F7646BFEF3B8BE562132E77EFE59.cache.html
MySampleApplication\MySampleApplication\hosted.html
MySampleApplication\MySampleApplication\MySampleApplication.nocache.js
MySampleApplication\WEB-INF\classes
MySampleApplication\WEB-INF\web.xml
MySampleApplication\WEB-INF\classes\com
MySampleApplication\WEB-INF\classes\com\mySampleApplication
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client
MySampleApplication\WEB-INF\classes\com\mySampleApplication\MySampleApplication.gwt.xml
MySampleApplication\WEB-INF\classes\com\mySampleApplication\server
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication$1.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication$MyAsyncCallback.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationService$App.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationService.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationServiceAsync.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\server\MySampleApplicationServiceImpl.class
About the only other thing would be the IDEA project module settings......
I am VERY appreciative or your help Andy.

Unable to load tag handler class "null" for tag "ui:composition"

I am trying to create a JSF application using MyFaces and Trinidad. I have added the following JARs to my /WEB-INF/lib:
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-digester-1.6.jar
commons-el-1.0.jar
commons-logging-1.1.1.jar
el-ri.jar
jsf-facelets-1.1.14.jar
jstl-1.1.0.jar
trinidad-api-1.0.13.jar
trinidad-impl-1.0.13.jar
myfaces-api-1.1.9.jar
myfaces-impl-1.1.9.jar
The facelets.tld file is included in /WEB-INF folder.
I am tryng to run this in Eclipse Helios with JBoss 4.2 and JDK 1.5. The server starts fine and I could see in the logs that all faces-config.xml files were read by MyFaces and that it starts up without any errors.
However, when I open a JSPX page, then it gives the following exception:
org.apache.jasper.JasperException: Unable to load tag handler class "null" for tag "ui:composition"
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
Here's the markup of the JSPX page:
<jsp:root version="2.0" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:i="http://java.sun.com/jstl/fmt"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
xmlns:t="http://myfaces.apache.org/tomahawk">
<ui:composition>
<ui:define name="MyPage">
<tr:form id="MyForm">
<trh:tableLayout width= "80%">
<trh:rowLayout>
<trh:cellFormat>
<tr:outputText id="output" value="Sucess"></tr:outputText>
</trh:cellFormat>
</trh:rowLayout>
</trh:tableLayout>
</tr:form>
</ui:define>
</ui:composition>
</jsp:root>
The same code works fine in WAS 6.1. I tried it with Tomcat 6 as well, it gave exactly the same problem.
How is this caused and how can I solve it?

Grails + SmartGWT

Trying to make Grails + smartgwt work together.
Setup:
Grails 2.2.1 (installed both, gwt + smartgwt plugin)
SmartGWT 3.1
GWT 2.5
After a couple of hours playing around with it, tomcat finally started.
(created application and compiled the modules)
Project resides under:
zuhause:8080/gwt3/
Default module is foo.bar
Default index.gsp looks ok
<script>
var isomorphicDir = "${createLinkTo(dir: 'gwt/foo.bar.fooBar/sc/')}";
</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="${createLinkTo(dir: 'gwt/foo.bar.foobar', file: 'foo.bar.foobar.nocache.js')}"></script>
The nocache.js is found
Inside the compiled "nocache.js" there is a reference to
zuhause:8080/gwt3/static/gwt/foo.bar.foobar/sc/modules/ISC_Core.js 404 (Not Found)
The path reference to "static" is the one I have no idea where it is configured.
The module xml looks like:
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<!-- Smart GWT -->
<inherits name="com.smartgwt.SmartGwt"/>
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
<!-- Specify the module entry point class. -->
<entry-point class="foo.bar.client.foobar"/>
I have scanned my complete project, but "static" has never been defined in one of the config files.
Any idea ?
Thanks in advance
The static is added by the resources plugin.

JSP:include is not rendering the included file

I just created a new IceFaces application and I'm trying to include a navigation bar in all of the pages. When I use the jsp:directive.include tag the file is included, but when I use jsp:include it does not seem to be loaded. In fact, when I check the HTML source code in my browser, it's like the included file was completely empty. I do not want to use jsp:directive.include because it will not automatically show any updates to the included file.
My environment: Eclipse 3.5, Tomcat 6, JSF 1.2, IceFaces 1.8.
Steps to reproduce the problem and pieces of code:
create a new Dynamic Web Project with the following options:
Target runtime: Apache tomcat v6.0
Dynamic web module version: 2.5
Configuration: ICEfaces project
create a new ICEFaces JSPX file -- the home file. Some code:
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" />
<f:view >
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
<html>
<head>
<title>test file</title>
<link rel="stylesheet" type="text/css"
href="./xmlhttp/css/rime/rime.css" />
</head>
<body>
<jsp:directive.include file="./vertical_navigation.jsp" /> <!-- working -->
<jsp:include page="./vertical_navigation.jsp" /> <!-- not working, no error though -->
</body>
</html>
</f:view>
create the file to be included, also as a new ICEFaces JSPX file. Simplified code:
<ice:form>
<ice:panelGrid columns="1" width="152">
<ice:graphicImage url="./img/image.jpg"></ice:graphicImage>
<ice:panelCollapsible expanded="true">
<f:facet name="header">
<ice:panelGroup>
<ice:outputText value="Customer"/>
</ice:panelGroup>
</f:facet>
<ice:panelGrid columns="1">
<ice:commandLink action="customer"><ice:outputText value="Customer name" /></ice:commandLink>
</ice:panelGrid>
</ice:panelCollapsible>
</ice:panelGrid>
</ice:form>
</body>
</html>
</f:view>
Some remarks:
I'm completely new to JSF, so forgive me for any obvious mistake.
In the home file (the first one) I'm not using both tags at the same time. I pasted both here just to show that I am trying both options.
I created both files as "ICEFaces JSPX file", but the second one was assigned the .jsp extension.
When I use the directive.include tag, the included file is loaded. But if I change it, it's not automatically republished.
To start, you have to separate and distinguish several technologies:
JSP is a Java based view technology which allows you to write HTML/CSS/JS in and use taglibs to call backend Java code and/or control the output flow.
JSPX is the same as JSP, but forces you to write code in XML format. JSP-specific tags are replaced by tags in XML format. JSPX is also called "JSP Document". Here is a basic tutorial which outlines the differences in tags.
JSF is a component based MVC framework which provides components in flavor of taglibs which outputs HTML/CSS/JS.
You cannot use <jsp:include> in a JSPX page. You have to transform the JSPX page into a JSP page. You need to rename the file .jspx to .jsp and replace JSPX specific tags by JSP tags. Here's a kickoff example for JSP with JSF/IceFaces:
<%# page pageEncoding="ISO-8859-1" %>
<%# taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%# taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%# taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
<!DOCTYPE html>
<f:view>
<html lang="en">
<head>
<title>Title</title>
</head>
<body>
<jsp:include page="include.jsp" />
</body>
</html>
</f:view>

GChart on GAE wont show

I am using Eclipse with GAE on a MacBook Pro with GChart. My problem is that I cant get any chart to show when I am developing, but when I use regular tools such as Buttons or Labels with GAE they work just fine. The code doesn't give me any errors, so I am assuming that I have the right code:
public class TestingTesting implements EntryPoint {
public void onModuleLoad() {
GChart graf = new GChart();
graf.setTitle("testing");
graf.setChartSize(200, 200);
graf.addCurve();
graf.getCurve().getSymbol().setFillThickness(2);
for (int i = 0; i < 10; i++)
graf.getCurve().addPoint(i,i*i);
Button btnOk = new Button("Ok");
RootPanel.get("chartdiv").add(graf);
RootPanel.get("button").add(btnOk);
}
}
and my TestingTesting.gwt.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='testingtesting'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name='com.googlecode.gchart.GChart' />
<!-- Specify the app entry point class. -->
<entry-point class='test.gchart.sollution.client.TestingTesting' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>
My TestingTesting.html looks like this:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Chart Example</title>
<script type="text/javascript" language="javascript"
src="testingtesting/testingtesting.nocache.js"></script>
</head>
<body>
<div id="chartdiv"></div>
<div id="button"></div>
</body>
</html>
other than that, my structure of the project in Eclipse is
/
- gchart.jar
- App Engine SDK [App Engine 1.3.5]
- GWT SDK [GWT - 2.0.4]
- JRE System Library
- src
-- test.gchart.sollution
--- TestingTesting.gwt.xml
-- test.gchart.sollution.client
--- TestingTesting.java
-- test.gchart.sollution.server
-- test.gchart.sollution.shared
--- FieldVerifier.java
- META-INF
-- jdoconfig.xml
- log4j.properties
- war
-- TestTest.html
- WEB-INF
-- appengine-web.xml
-- logging.properties
-- web.xml
Can anyone help me to figure out what the problem might be? The button shows without any problem, but the chart doesn't?
I figuered out what I've made wrong.
I forgot on the TestingTesting.java to include
RootPanel.get("chartdiv").add(graf);
graf.update(); // you have to update your graph before it renders