wood burning stoves*
The moose likes GWT and the fly likes How to overcome this basic GWT problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "How to overcome this basic GWT problem?" Watch "How to overcome this basic GWT problem?" New topic
Author

How to overcome this basic GWT problem?

Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
Hi friends,
I am a newbie to GWT.I am in a condition to develop a GWT application. So i started my GWT journey by reading a book material from PACKT publishers named "Google Web Toolkit Java Ajax programming". I set my GWT environment and tested.It works pretty well.Then i tried my first example application named as HelloGWT . I created an application named as HelloGWT by using the below command
applicationCreator.cmd -out <directory location>\GWTBook\HelloGWT com.packtpub.gwtbook.HelloGWT.client.HelloGWT
Its created successfully.
Then i tried example application given in chapter 2 - creating a random quote ajax application.I downloaded codes from PACKT publishers home site.and placed that codes in corresponding folders as they said in book.But its not working well when i run HelloGWT -shell. It shows error as
failed to load module com.packtpub.gwtbook.hellogwt.HelloGWT
Unable to load module entry point class com.packtpub.gwtbook1.hellogwt.client.HelloGWT (see associated exception for details)
Failure to load module 'com.packtpub.gwtbook1.hellogwt.HelloGWT'

I given below the codes that i tried with exact folder structure.Please tell me where am i doing wrong thing in this one..
HelloGWT\src\com\packtpub\gwtbook1\hellogwt\client\HelloGWT.java



HelloGWT\src\com\packtpub\gwtbook1\hellogwt\client\RandomQuoteService.java





HelloGWT\src\com\packtpub\gwtbook1\hellogwt\client\RandomQuoteServiceAsync.java




HelloGWT\src\com\packtpub\gwtbook1\hellogwt\server\RandomQuoteServiceImpl.java



HelloGWT\src\com\packtpub\gwtbook1\hellogwt\public\HelloGWT.html




HelloGWT\src\com\packtpub\gwtbook1\hellogwt\HelloGWT.gwt.xml


Please tell me what makes it to cause error..





Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Post the associated exception ...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eduardo Bueno
Ranch Hand

Joined: Jun 04, 2009
Posts: 155
It is really hard to read, but nothing seems wrong in your code. Remove public modifier from Service and ServiceAsync classes, it is not necessary. Put your code in the tag and maybe we can find the problem.
Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
John Todd wrote:Post the associated exception ...



Its the error shown on hosted mode window
Unable to load module entry point class com.packtpub.gwtbook1.hellogwt.client.HelloGWT (see associated exception for details)
Failure to load module 'com.packtpub.gwtbook1.hellogwt.HelloGWT'
Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
Bear Bibeault wrote:Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.


Its my first post on JavaRanch.So i don't know abouot code tag. Thanks for your notification.Now i corrected it..
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

If the GWT shell tells you "see associated exception for details", then I think there is an exception stack trace that you should check.
Check the GWT shell output.
Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
Sarathi Rukku wrote:
John Todd wrote:Post the associated exception ...



My Error Trace shows the following error:
[TRACE] The development shell servlet received a request for 'quotes' in module 'com.packtpub.gwtbook.hellogwt.HelloGWT.gwt.xml'
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
I thik the issue may be in your gwt.xml file. Line 18 has:



I think it should be:



since that is what you are looking for when you connect to the service.
Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
steve claflin wrote:I thik the issue may be in your gwt.xml file. Line 18 has:



I think it should be:



since that is what you are looking for when you connect to the service.



I added 'quotes' as you said.But i get this error
Unable to instantiate 'com.packtpub.gwtbook.hellogwt.server.RandomQuoteServiceImpl'
Unable to dispatch request


Stack Trace gives:
[ERROR] Unable to instantiate 'com.packtpub.gwtbook.hellogwt.server.RandomQuoteServiceImpl'
java.lang.ClassNotFoundException: com.packtpub.gwtbook.hellogwt.server.RandomQuoteServiceImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:936)
at com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:277)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)

steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
The -shell.cmd and -compile.cmd files don't compile the files in the server package. You'll need to compile them separately in advance, with a -d option for your bin directory.
Sarathi Rukku
Greenhorn

Joined: Jul 30, 2009
Posts: 6
steve claflin wrote:The -shell.cmd and -compile.cmd files don't compile the files in the server package. You'll need to compile them separately in advance, with a -d option for your bin directory.


Thankyou for your notable assistance Steve.I saw this application in the book "Google Web Toolkit Java Ajax programming" from Packt publishers .I compiled my server side program.It shows following errors.
E:\gwt-windows-1.5.3\com\packtpub\gwtbook\hellogwt\server>javac RandomQuoteServi
ceImpl.java
RandomQuoteServiceImpl.java:7: package com.google.gwt.user.server.rpc does not e
xist
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
^
RandomQuoteServiceImpl.java:8: package com.packtpub.gwtbook.hellogwt.client does
not exist
import com.packtpub.gwtbook.hellogwt.client.RandomQuoteService;
^
RandomQuoteServiceImpl.java:10: cannot find symbol
symbol: class RemoteServiceServlet
public class RandomQuoteServiceImpl extends RemoteServiceServlet implements
^
RandomQuoteServiceImpl.java:11: cannot find symbol
symbol: class RandomQuoteService
RandomQuoteService {
^
Note: RandomQuoteServiceImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors


steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
You probably need to set a classpath for it. I generally create a project cmd file to do this automatically, with something like:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to overcome this basic GWT problem?