• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with simple gwt app

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started with GWT and i have been reading Book on GWT by prakash chaganti. While trying the PrimesService Example my self i faced some issues. Here are the file structure and the Code

File Structure

src/packtpub/gwtbook/samples/Samples.gwt.xml //Module Configuration


src/packtpub/gwtbook/samples/client
src/packtpub/gwtbook/samples/client/PrimesService.java //Service Interface
src/packtpub/gwtbook/samples/client/PrimesServiceAsync.java //Async Service Interface
src/packtpub/gwtbook/samples/client/PrimesClient.java //Entry Point Class

src/packtpub/gwtbook/samples/public
src/packtpub/gwtbook/samples/public/Samples.html //Host Page


src/packtpub/gwtbook/samples/server
src/packtpub/gwtbook/samples/server/PrimesServiceImpl.java //Service Implementation



Given below are the relevant files

Samples.gwt.xml



PrimesServiceImpl.java



PrimesClient.java



Samples.html



When i run this application in hosted mode i get following alert message

Failed to load module 'com.packtpub.gwtbook.samples.Samples'

here is the Error Log



where is the problem?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghav,
Please go easy on the colors and bold.

The error is being generated because of the annotations. You got two options.
1) Either comment out all @Override and other annotations
2) Or Upgrade to the latest version of GWT
 
shukla raghav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response Maneesh, I removed the annotations and then i think the real problem comes to the surface. Now i have a new error stack here it is

[DEBUG] Rebinding com.packtpub.gwtbook.samples.client.PrimesService
[DEBUG] Assimilating generated source
[ERROR] Errors in 'transient source for com.packtpub.gwtbook.samples.client.PrimesService_Proxy'
[ERROR] Line 26: The return type is incompatible with PrimesServiceAsync.isPrime(int, AsyncCallback)
[ERROR] Compilation problem due to 'transient source for com.packtpub.gwtbook.samples.client.PrimesService_Proxy'; see snapshot C:\Users\hp\AppData\Local\Temp\gen2332534200013751255.java
[ERROR] Unable to find recently-generated type 'com.packtpub.gwtbook.samples.client.PrimesService_Proxy
[ERROR] Deferred binding failed for 'com.packtpub.gwtbook.samples.client.PrimesService'; expect subsequent failures
[ERROR] Unable to load module entry point class com.packtpub.gwtbook.samples.client.PrimesClient
java.lang.RuntimeException: Deferred binding failed for 'com.packtpub.gwtbook.samples.client.PrimesService' (did you forget to inherit a required module?)
at com.google.gwt.dev.shell.JavaScriptHost.rebindAndCreate(JavaScriptHost.java:162)
at com.google.gwt.dev.shell.ShellGWT.create(ShellGWT.java:24)
at com.google.gwt.core.client.GWT.create(transient source for com.google.gwt.core.client.GWT:20)
at com.packtpub.gwtbook.samples.client.PrimesClient.onModuleLoad(PrimesClient.java:20)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:138)
at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:313)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$100(BrowserWidgetIE6.java:34)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:61)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:106)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:274)
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:241)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:171)
at com.google.gwt.dev.shell.JavaScriptHost.rebindAndCreate(JavaScriptHost.java:157)
at com.google.gwt.dev.shell.ShellGWT.create(ShellGWT.java:24)
at com.google.gwt.core.client.GWT.create(transient source for com.google.gwt.core.client.GWT:20)
at com.packtpub.gwtbook.samples.client.PrimesClient.onModuleLoad(PrimesClient.java:20)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:138)
at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:313)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$100(BrowserWidgetIE6.java:34)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:61)
[ERROR] Failure to load module 'com.packtpub.gwtbook.samples.Samples'

Why is it saying Failure to load module ? where exactly is teh problem the code is very simple and its just a Test Code.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[ERROR] Line 26: The return type is incompatible with PrimesServiceAsync.isPrime(int, AsyncCallback)


Whats the method signature in your PrimesService and PrimesServiceAsync ?


Would primeNumber.getText() evaluate to an int?
 
shukla raghav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Would primeNumber.getText() evaluate to an int?



primeNumber.getText() does not need to eveluate to int i.e. why i have a parseInt method to convert the value. variable primeNumber is of type TextBox as you can see in the PrimesClient class on line number 17. primeNumber.getText() would return me the text value entered in the TextBox that will be parsed to int using wrapper class method parseInt.


primesService.isPrime(Integer.parseInt(primeNumber.getText()), callback);
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right. My bad.

Please post the method signatures for the PrimeService and PrimeServiceAsync
 
shukla raghav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is resolved. My Async Service interface method was returning an int although it should have returned void.

Thanks for indicating the problem area,

God Bless

OMSAIRAM
Raghav
 
reply
    Bookmark Topic Watch Topic
  • New Topic