Error while launch with module and GXT4 - java

I am trying to use the GXT4 in my GWT project but it gives me an error when i launch the app. I followed the GXT guide from their site and added the inherit in the module of my project but it gives me this error: Loading inherited module 'com.sencha.gxt.core.Core'
[ERROR] Line 67: Unexpected element 'resource'
[ERROR] Failure while parsing XML
PS I'm not using maven. What is wrong?
My module
<module rename-to='myproject'>
<!-- 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.maps.gwt.GoogleMaps" />
<inherits name='com.sencha.gxt.ui.GXT' />
<stylesheet src="reset.css" />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Specify the app entry point class. -->
<entry-point class='com.myproject.project.client.Myproject'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>

Related

Theme neptune doesn't apply

I want to apply the neptune theme on my application GWT but it's not working.
I already added theme neptune.jar and theme builder to dependences:
my app.gwt.xml:
<inherits name='com.sencha.gxt.theme.neptune.Theme' />
<inherits name="com.google.gwt.http.HTTP" />
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.google.gwt.logging.Logging"/>
<inherits name="com.google.gwt.xml.XML"/>
<inherits name='com.sencha.gxt.ui.GXT'/>
<inherits name='org.gwtopenmaps.openlayers.OpenLayers' />
<set-property name="gwt.logging.enabled" value="FALSE"/>
<set-property name="gwt.logging.consoleHandler" value="DISABLED"/>
<set-configuration-property name="locale.cookie" value="GWT_LOCALE" />
<entry-point class='org.traccar.web.client.Traccar'/>
<source path='client'/>
<source path='shared'/>
And my pom:
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-themebuilder</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-theme-neptune</artifactId>
<version>3.1.1</version>
</dependency>
What did I do wrong?
Move <inherits name='com.sencha.gxt.theme.neptune.Theme' /> to after the inherits for GXT - if you put it earlier, it gets overridden by the default.

GWT (Eclipse): 2 modules (2 entry points) + 2 HTML pages => LoginService possible for both HTML pages?

I am a newbie to GWT and at the moment I have the problem that I created two modules (see appendix 1/2) with two entry point classes in my project. So I made two run configurations (see appendix 5/6) in Eclipse to either address the HTML page for module one (It_projekt.html) or the HTML page for module two (Reportgenerator.html). For authentication purposes, I added a LoginService class.
But now, when I start the HTML page for my second module (reportgenerator.gwt.xml) in the browser, there will be no login screen. On the other hand, when I start the HTML page for module one (It_projekt.gwt.xml) in the browser, there will appear a login screen.
So my question is: how can I make it possible (if it's possible) to have one LoginService and two HTML pages, where I as a user have to login at It_projekt.html and also Reportgenerator.html (condition: it has to be two modules with two entry point classes)? Is it maybe only possible with two different LoginService classes?
For test purposes, I added a variant of the LoginService class (as you can see in the web.xml). But the second LoginService idea didn't work either. And there is definitely some code in "onModuleLoad()" in the entry point class of the second module (reportgenerator.gwt.xml).
Maybe it might depend on a small detail, but I am unable to see it at the moment. I appended all necessary resources that I could think of. Please help me!
Appendixes:
1) It_projekt.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='it_projekt'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.logging.Logging'/>
<!-- 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.hdm.team7.client.It_projekt'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
2) reportgenerator.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!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='reportgenerator'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.logging.Logging' />
<!-- 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' />
<entry-point class="de.hdm.team7.client.Reportgenerator"></entry-point>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe" />
</module>
3) web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Servlets -->
<servlet>
<servlet-name>Stuecklistenverwaltung</servlet-name>
<servlet-class>de.hdm.team7.server.StuecklistenVerwaltungImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Stuecklistenverwaltung</servlet-name>
<url-pattern>/it_projekt/stuecklistenverwaltung</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Reportgenerator</servlet-name>
<servlet-class>de.hdm.team7.server.ReportGeneratorImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Reportgenerator</servlet-name>
<url-pattern>/it_projekt/reportgenerator</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LoginService</servlet-name>
<servlet-class>de.hdm.team7.server.LoginServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginService</servlet-name>
<url-pattern>/it_projekt/login</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LoginServiceReports</servlet-name>
<servlet-class>de.hdm.team7.server.LoginServiceReportsImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServiceReports</servlet-name>
<url-pattern>/reportgenerator/loginreports</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>It_projekt.html</welcome-file>
</welcome-file-list>
</web-app>
4) LoginService.java:
package de.hdm.team7.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
#RemoteServiceRelativePath("login")
public interface LoginService extends RemoteService {
// String login(User user);
public LoginInfo login(String requestUri);
}// end interface
5) Run configuration:
It_projekt.html
-superDevMode -server com.google.appengine.tools.development.gwt.AppEngineLauncher -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl It_projekt.html -logLevel INFO -codeServerPort auto -port auto -war C:\Users\dev\git\it-projekt\it-projekt\war de.hdm.team7.It_projekt de.hdm.team7.reportgenerator
6) Run configuration:
Reportgenerator.html
-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl Reportgenerator.html -logLevel INFO -codeServerPort 9997 -port 8888 -server com.google.appengine.tools.development.gwt.AppEngineLauncher -superDevMode -war C:\Users\dev\git\it-projekt\it-projekt\war de.hdm.team7.reportgenerator de.hdm.team7.It_projekt

Error compiling project with GWT

I just did a checkout of a project with SVN, and is showing me the following error.
I am really new using gwt and be very grateful if you could help me.
This is the error:
Loading inherited module 'com.google.web.bindery.event.Event'
[ERROR] Unable to find 'com/google/web/bindery/event/Event.gwt.xml' on your classpath; could be a
a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] Line 22: Unexpected exception while processing element 'inherits'
This is my xml file
<?xml version="1.0" encoding="UTF-8"?>
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.smartgwt.SmartGwt" />
<inherits name="com.smartgwt.tools.SmartGwtTools" />
<inherits name="com.google.gwt.activity.Activity" />
<inherits name="com.google.gwt.place.Place" />
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.google.web.bindery.event.Event" />
<inherits name="com.google.gwt.core.Core" />
<entry-point class='ch.datalynx.clessidra.client.Clessidra' />
<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'/> -->
<replace-with
class="ch.datalynx.clessidra.client.mvp.clientfactories.ClientFactoryImpl">
<when-type-is
class="ch.datalynx.clessidra.client.mvp.clientfactories.ClientFactory" />
</replace-with>
<source path='client' />
<source path='shared' />
</module>
Make sure the gwt-user.jar file is in your build path. It's part of the GWT SDK.
It is unable to find gwt-user.jar/com/google/web/bindery/event/Event.gwt.xml

Super dev mode + JSP page in Tomcat

I have a .jsp page (the main page of my gwt module) and I'm trying to enable super dev mode as I'm migrating to gwt 2.6.
Following the explanations I found out on internet, once I launch the codeserver and add the bookmarklets, next I gotta open the page in my browser, so I call the jsp page from my tomcat server.
The problem is that nothing happens, and looking at the chrome console it seems it is unable to find my module/module.nocache.js
Any idea?
EDIT : added .gwt.xml
<inherits name="XXX.frontend.gwt.Framework"/>
<inherits name="XXX.frontend.gwt.sample.frontend.module.blanc.Module"/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- Specify the application entry point class -->
<entry-point class='XXX.frontend.gwt.client.FrameworkEntryPoint'/>
<!-- Compile for specific browser -->
<!-- <set-property name="user.agent" value="ie8,ie9,ie10,gecko1_8,safari" /-->
<!-- Compile for specific language -->
<extend-property name="locale" values="fr" />
<set-property-fallback name="locale" value="fr" />
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE' />
<set-configuration-property name="devModeUrlWhitelistRegexp" value="http://(localhost|127\.0\.0\.1)(:\d+)?/.*" />
<add-linker name="xsiframe" />
<set-property name="compiler.useSourceMaps" value="true" />
You have to load your .nocache.js file from your codeserver instance.
In your .jsp you must have something like this:
<script src="http://localhost:9876/myapp/myapp.nocache.js"></script>
In your gwt.xml you need these lines as well:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true" />

Eclipse and GWT looking for inherited module in wrong package, despite gwt.xml file having correct path?

Upon attempting to run my Google Web Application I've been working on in Eclipse using GWT, it gives me this error:
"Loading modules
com.example.pbot.Pbot
Loading inherited module 'com.example.pbot.Pbot'
[ERROR] Unable to find 'com/example/pbot/Pbot.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method"
All of my packages are com.pbot, com.pbot.client, com.pbot.server, etc; I don't know where it's seeing com.example.
The entry-point class in the gwt.xml file is com.pbot.client.Pbot, which is my entry point class. Here's the full gwt.xml:
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='pbot'>
<!-- 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='com.pbot.client.Pbot'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
I've cleaned, refreshed and restarted the project, I don't know what else to do. Where is it reading "com.example?" Please help!
Check the run configurations -> Arguments. There will be a reference of com.example.pbot.Pbot.
I think, this is what Thomas mentioned.
Check the project properties, in the GWT page, it probably references the com.example that you initially created.

Categories