GWT starter project doesn't work when inherit smartGWT is added - gwt

I'm brand new to GWT and am trying to use SmartGWT. I got GWT setup and created a new project. The starter project that's supplied with the new project works fine, but once I add the smartGWT jars and inherit the smartGWT tools in my .gwt.xml file the module doesn't load.
My .gwt.xml file looks like this now:
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module rename-to='whydoyouhateme'>
<!-- 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.clean.Clean'/>
<!-- <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.smartgwt.tools.SmartGwtTools' />
<!-- Specify the app entry point class. -->
<entry-point class='com.lmco.client.WhyDoYouHateMe'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
Is this normal?

Inherit tag for SmartGWT jar will be like this,try this
<inherits name="com.smartgwt.SmartGwt"/>

Related

GWT content not showing on centOS 7.5

I'm working on a project which is built on GWT. When we deployed the project on centOS 6.9 version it works fine and all the content is accessible or visible. However, when we changed the OS version to centOS7.5. It deployed successfully but upon accessing the index page it only shows waiting gif and then unable to load the java content.
Some of my observations during inspect element are as follow.
CentOS7.5
In centOS7.5 the content div is empty. I've no clue why the content isn't rendering by GWT. Didn't see any exception or stack trace in tomcat logs. I've also updates the dependency version in pom.xml but still getting the same results.
CentOS6.9
Also I've observed the difference source hierarchy. Same rpm is installed on both servers. CentOS7.5 doesn't showing the top_banner.jpg and /image directory.
The pom.xml is as follow, whereas the gwt.version = 2.9.0
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
Application.gwt.xml
<!DOCTYPE module PUBLIC "//gwt-module/" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="agentportal">
<add-linker name="xsiframe" />
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE' />
<!-- Dependencies -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.seamless.gwt.components.Module' />
<inherits name='org.puremvc.PureMVC_Java_MultiCore' />
<inherits name='com.seamless.common.GWTModule' />
<inherits name='com.seamless.ers.interfaces.ersifcommon.GWTModule' />
<inherits name='com.seamless.ers.interfaces.ersifclient.GWTModule' />
<!-- ers-supportsystem-client-transport-ws -->
<inherits name="com.seamless.ers.components.supportsystem.interfaces.GWTModule"/>
<!-- ers-supportsystem-client -->
<inherits name="com.seamless.ers.interfaces.platform.clients.transaction.GWTModule"/>
<!-- ers-txe-client-model -->
<inherits name='com.seamless.ers.interfaces.platform.clients.GWTModule' />
<!-- Enable Debug IDs -->
<inherits name="com.google.gwt.user.Debug"/>
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
<extend-property name="log_level" values="DEBUG,WARN" />
<!-- Disable DIV logger -->
<set-property name="log_DivLogger" value="DISABLED" />
<!-- What languages should be supported? -->
<extend-property name="locale" values="en" />
<extend-property name="locale" values="fr"/>
<extend-property name="locale" values="ar"/>
<inherits name='com.google.gwt.user.theme.chrome.Chrome' />
<entry-point class='com.seamless.ers.client.agentPortal.client.Application' />
<source path="client">
<exclude name="**/tests/*" />
</source>
<stylesheet src='Application.css' />
<servlet
class="com.seamless.ers.client.agentPortal.server.AgentPortalServiceImpl"
path="/agentportal_service" />
<servlet path="/sessionService" class="com.seamless.ers.client.agentPortal.server.SessionServiceImpl"/>
</module>
Side by side difference of deployments on both servers
In the above image, I can clearly see that there is a different in /WEB-INF. The classes and the deploy directory is almost empty. Along with other marked
Can someone please guide me what I'm missing here and what's the root cause of this issue and why it's occurring on centOS7.5.
I was facing the same issue against GWT. The issue is at parser level of GWT. I had "_" as variable in my Screen.java class which extended com.google.gwt.user.client.ui:Composite
Upon renaming the variable name and refactoring the code the screen loaded for me. Please try doing it this way.

GWT Error: There is '1' error in 'gwt-module.dtd'

I am learning GWT and was trying to run this tutorial by Vogella
Using the Eclipse GWT plugin 3.0 on Windows 10 and JDK 11
I get this error on the first line Error: There is '1' error in 'gwt-module.dtd'.
/de.vogella.gwt.helloworld/src/de/vogella/gwt/helloworld/De_vogella_gwt_helloworld.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN"
"http://gwtproject.org/doctype/2.8.1/gwt-module.dtd">
<module rename-to='de_vogella_gwt_helloworld'>
<!-- 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.clean.Clean'/>
<!-- <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 -->
<!-- Specify the app entry point class. -->
<entry-point class='de.vogella.gwt.helloworld.client.De_vogella_gwt_helloworld'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
I get the same error even from the official GWT tutorial http://www.gwtproject.org/doc/latest/tutorial/index.html
From this post, I found that the dtd generated is wrong.
"http://gwtproject.org/doctype/2.8.1/gwt-module.dtd"
I corrected it to
"http://www.gwtproject.org/doctype/2.8.1/gwt-module.dtd"
and the error went away!

Errors while adding GXT 3.1 to GWT Project

I've created a GWT 2.6 project and i want to add GXT to it. I tried first with 3.0.1 but then I found out that it has compatibility issues so I changed to GXT 3.1 beta.
But when I try to run the app i get these errors:
The changes I've made is to comment out this line in module xml
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
and added these:
<inherits name='com.sencha.gxt.ui.GXT' />
<!-- GXT Stylesheet -->
<stylesheet src="reset.css" />
Anybody have an idea?
gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='comav200'>
<!-- 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.clean.Clean'/> -->
<!-- <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'/>
<inherits name="com.google.gwt.json.JSON" />
<!-- Other module inherits -->
<inherits name="com.google.gwt.json.JSON" />
<inherits name='com.sencha.gxt.ui.GXT' />
<!-- GXT Stylesheet -->
<stylesheet src="reset.css" />
<!-- Specify the app entry point class. -->
<entry-point class='com.coma.client.Main'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
Stack trace
maj 02, 2014 7:17:00 EM java.util.prefs.WindowsPreferences <init>
Varning: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[WARN] Server class 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/Users/JoHanSolo/Documents/eclipse%20ee/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar' to the web app classpath for this session
For additional info see: file:/C:/Users/JoHanSolo/Documents/eclipse%20ee/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html
[WARN] 404 - GET /%7Bmodule%20name%7D/reset.css (127.0.0.1) 1394 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/css,*/*;q=0.1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://127.0.0.1:8888/Comav200.html?gwt.codesvr=127.0.0.1:9997
Connection: keep-alive
Response headers
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1394
Exception in thread "Thread-1" java.lang.NullPointerException
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.JavaScriptException.getExceptionName0(JavaScriptException.java)
at com.google.gwt.core.client.JavaScriptException.getExceptionName(JavaScriptException.java:66)
at com.google.gwt.core.client.JavaScriptException.ensureInit(JavaScriptException.java:203)
at com.google.gwt.core.client.JavaScriptException.getMessage(JavaScriptException.java:187)
at com.google.gwt.dev.util.log.AbstractTreeLogger.getStackTraceAsString(AbstractTreeLogger.java:70)
at com.google.gwt.dev.shell.remoteui.ViewerServiceClient.generateLogData(ViewerServiceClient.java:296)
at com.google.gwt.dev.shell.remoteui.ViewerServiceClient.addLogEntry(ViewerServiceClient.java:118)
at com.google.gwt.dev.shell.remoteui.ViewerServiceTreeLogger.sendEntry(ViewerServiceTreeLogger.java:158)
at com.google.gwt.dev.shell.remoteui.ViewerServiceTreeLogger$PendingLog.send(ViewerServiceTreeLogger.java:72)
at com.google.gwt.dev.shell.remoteui.ViewerServiceTreeLogger.initLogHandle(ViewerServiceTreeLogger.java:134)
at com.google.gwt.dev.shell.remoteui.ViewerServiceTreeLogger$1.onDone(ViewerServiceTreeLogger.java:145)
at com.google.gwt.dev.shell.remoteui.ViewerServiceTreeLogger$1.onDone(ViewerServiceTreeLogger.java:143)
at com.google.gwt.dev.shell.remoteui.ViewerServiceClient$1.onDone(ViewerServiceClient.java:96)
at com.google.gwt.dev.shell.remoteui.ViewerServiceClient$1.onDone(ViewerServiceClient.java:94)
at com.google.gwt.dev.shell.remoteui.MessageTransport$PendingRequest.setResponse(MessageTransport.java:124)
at com.google.gwt.dev.shell.remoteui.MessageTransport.processServerResponse(MessageTransport.java:428)
at com.google.gwt.dev.shell.remoteui.MessageTransport.processMessage(MessageTransport.java:404)
at com.google.gwt.dev.shell.remoteui.MessageTransport.access$400(MessageTransport.java:44)
at com.google.gwt.dev.shell.remoteui.MessageTransport$3.run(MessageTransport.java:327)
at java.lang.Thread.run(Unknown Source)
Some points that I noticed in your gwt.xml
You have added <inherits name="com.google.gwt.json.JSON" /> two times.
below DTD URL is not valid
http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd
Try with below options
use below DTD URL
https://raw.githubusercontent.com/gwtproject/gwt/2.6.0/distro-source/core/src/gwt-module.dtd
or add <set-property name="user.agent" value="gecko1_8"/> in your gwt.xml. Add more user agent as mentioned below.
For more info have a look at below links:
What are the possible user.agent values in gwt.xml?
Any DTD for GWT 2.6.0?
DTD document for GWT 2.6.0 is not available
--EDIT--
try with below gwt.xml first
...
<module rename-to='comav200'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.google.gwt.json.JSON" />
<stylesheet src="reset.css" />
<entry-point class='com.coma.client.Main' />
<source path='client' />
<source path='shared' />
</module>
Its working fine for me with GWT 2.5.0. Please have a look at the lib folder in below screenshots.
<?xml version="1.0" encoding="UTF-8"?>
<!-- When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities. -->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='gxtproject'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.sencha.gxt.ui.GXT' />
<stylesheet src="reset.css" />
<entry-point class='com.gxt.client.GXTProject' />
<source path='client' />
<source path='shared' />
<inherits name="com.google.gwt.json.JSON" />
</module>
Please check your module-xml file and add if not already present:
<inherits name='com.google.gwt.user.User' />

gwt.xml error: Content of element type module must match

I have a small GWT java program that has been running on google apps engine for about a year now. I recently made some changes to it, and then before I could deploy it had to update the JRE to 7.1. Once I did that, I am getting the following error on my gwt.xml file:
The content of element type "module" must match "(inherits|source|public|super-source|entry-point|stylesheet|script|servlet|replace-with|
generate-with|define-property|extend-property|set-property|set-property-fallback|clear-configuration-property|define-configuration-
property|extend-configuration-property|set-configuration-property|property-provider|define-linker|add-linker|collapse-all-properties|collapse-property)*".
I found this question which explained to me what the error meant, and I saw that my source elements were after my entry point element. I moved them around to match the order in the error message, but the error persists. Any thoughts?
Here is my gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='helpdesktest'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.xml.XML'/>
<inherits name='com.google.gwt.logging.Logging'/>
<inherits name='com.google.gwt.http.HTTP'/>
<!-- 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.clean.Clean'/>
<!-- <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 -->
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- Specify the app entry point class. -->
<entry-point class='com.google.gwt.HelpDeskTest.client.HelpDeskTest'/>
<!-- Set logging parameters -->
<set-property name="gwt.logging.logLevel" value="SEVERE"/> #change default log level
<set-property name="gwt.logging.enabled" value="FALSE"/> #set to FALSE to disable logging
<set-property name="gwt.logging.consoleHandler" value="DISABLED"/> #to disable set to DISABLED
<set-property name="gwt.logging.popupHandler" value="DISABLED"/>
<set-property name="gwt.logging.developmentModeHandler" value="DISABLED"/>
</module>
<module> doesn't accept text content, yet you have those #change default log level bits in your file.
Convert them to XML comments (<!-- change default log leve -->) or remove them.
BTW, the order of the elements doesn't matter wrt XML validation (it matters in what they mean though; some things sometimes have to be processed for others because one overrides the other)

Using java objects from another Maven module in GWT on the client side

i have two maven projects, project A contents some serializable model objects and project B is the GWT project. Now i want to use some Objects from project A for RPC calls between the client and the server in project B.
so here is what i have done yet:
GWT project B xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='Index'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.projectA.Models' />
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<entry-point class='com.projectB.client.Index' />
<source path='client' />
<source path='shared' />
</module>
Java Object project A xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.google.gwt.user.User"/>
<source path="./" />
</module>
I still get "No source code is available for type com.projectA.Object; did you forget to inherit a required module?" message =(
(POM dependency is set!)
i figured out i need to add this to the maven gwt plugin configuration in the POM of project B:
<configuration>
<compileSourcesArtifacts>
<compileSourcesArtifact>com.projectA:Models</compileSourcesArtifact>
</compileSourcesArtifacts>
</configuration>
this tells the Maven GWT plugin to copy the sources to the web directory... Additionally you need an GWT xml file in the project B package with the following:
<module>
<inherits name='com.google.gwt.user.User' />
<source path='' />
</module>
That tells the GWT compiler to include the source of that module..
DONE
Just to be clear-
projectA structure: com.projectA.ProjectA.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="first-project">
<inherits name="com.google.gwt.user.User"/>
<source path="./" />
</module>
Then projectB structure will be: com.projectB.ProjectB.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='Index'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.projectA.first-project' />
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<entry-point class='com.projectB.client.Index' />
<source path='client' />
<source path='shared' />
</module>
I add rename to projectA gwt.xml. Please review code. This sample should work. If your pom has correct dependency.