Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to overcome this basic GWT problem?

 
Sarathi Rukku
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the associated exception ...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably need to set a classpath for it. I generally create a project cmd file to do this automatically, with something like:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic