The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

u196598 (4) [Avatar] Offline
#1
Hi All,

My machine crushed a few weeks ago and I lost my hard drive. So I reinstalled everything. I am using the latest GWT 1.4.60, MyEclipse 6.0 / Eclipse 3.3 IDE, Java JDK 1.4.2_05. I imported the project from the source zip file into my MyEclipse IDE and made all necessary changes, such as GWT jar and supporting jar paths. When running the project from my IDE by clicking Dashboard-shell.cmd, I can see everything. But when selecting Help / About, I got an exception:

[ERROR] Uncaught exception escaped
java.lang.RuntimeException: Deferred binding failed for 'org.gwtbook.client.ui.about.About' (did you forget to inherit a required module?)
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:47)
at org.gwtbook.client.Dashboard$AboutCommand.execute(Dashboard.java:567)
at com.google.gwt.user.client.CommandExecutor.doExecuteCommands(CommandExecutor.java:307)
at com.google.gwt.user.client.CommandExecutor$2.run(CommandExecutor.java:203)
at com.google.gwt.user.client.Timer.fireImpl(Timer.java:164)
at com.google.gwt.user.client.Timer.fireAndCatch(Timer.java:150)
at com.google.gwt.user.client.Timer.fire(Timer.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Caused by: java.lang.NoSuchMethodError: java.lang.Class.getSimpleName()Ljava/lang/String;
at org.gwtbook.rebind.DashboardCompositeGenerator.generate(DashboardCompositeGenerator.java:79)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:43)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:116)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:61)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:173)
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:127)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:494)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:380)
at com.google.gwt.dev.shell.JavaScriptHost.rebindAndCreate(JavaScriptHost.java:153)
at com.google.gwt.dev.shell.ShellGWT.create(ShellGWT.java:24)

But I can run the example project without any problem using old GWT and MyEclipse.

My .classpath, .project, and Dashboard-shell.cmd are listed below:
.classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="JUNIT_HOME/junit.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-1.2.jar"/>
<classpathentry kind="lib" path="lib/gwt-widgets-0.1.3.jar"/>
<classpathentry kind="lib" path="lib/gwt-widgets-0.1.4.jar"/>
<classpathentry kind="lib" path="C:/bwi/gwt/gwt-windows-1.4.60/gwt-dev-windows.jar"/>
<classpathentry kind="lib" path="C:/bwi/gwt/gwt-windows-1.4.60/gwt-servlet.jar"/>
<classpathentry kind="lib" path="C:/bwi/gwt/gwt-windows-1.4.60/gwt-user.jar"/>
<classpathentry kind="lib" path="C:/bwi/gwt/gwt-windows-1.4.60/junit-3.8.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

.project:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DashboardPrj</name>
<comment>DashboardPrj project</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

Dashboard-shell.cmd:
@java -cp "%~dp0src;%~dp0in;C:/bwi/gwt/gwt-windows-1.4.60/gwt-user.jar;C:/bwi/gwt/gwt-windows-1.4.60/gwt-dev-windows.jar;C:/just4fun/myeclipseprj/workspace/DashboardPrj/lib/gwt-widgets-0.1.4.jar;" com.google.gwt.dev.GWTShell -whitelist "^http[:][/][/]www[.]google[.]se" -out "%~dp0www" %* org.gwtbook.Dashboard/Dashboard.html

Also I tried to create Eclipse/MyEclipse project using GWT projectcreator and applicationcreator and imported to my IDE and copied all zip source files to it (because the structures are the same, all same files will be overwritten). But it still has the same problem.

Did anybody have the same issue? Really appreciate your help.

Happy Holidays!
Baiqing
adam.tacy (269) [Avatar] Offline
#2
Re: Cannot run DashboardPrj
Hi,

Mmmm, that doesn't look fun!

It's complaining that Class.getSimpleName() is missing when trying to use the DashboardCompositeGenerator class (apologies if you can read Java exceptions yourself!!)

The simple fix is to comment out line 79 in DashboardCompositeGenerator (in the org.gwtbook.rebind package) as all it is being used in is a log output. (or just comment out the call to Class.getSimpleName() itself).

For a more detailed explanation, I'll have to do some more digging.....


//Adam
adam.tacy (269) [Avatar] Offline
#3
Re: Cannot run DashboardPrj
....ok, Class.getSimpleName() doesn't exist in Java 1.4 and that's why you have the issue - whilst GWT needs to use 1.4 syntax there is no such restriction on generators/server side code, or on the jre you run GWT on.

My original development machine has 1.5/5.0 on it so this line gets through.

So, I would suggest either:

a) comment line 79 out as mentioned above, or
b) upgrade your jre/jdk to 1.5 - in Eclipse you can turn your project specifics on to 1.4 mode so you know your client side code adheres to what GWT expects if you need/want.

Hope that helps!

//Adam
u196598 (4) [Avatar] Offline
#4
Re: Cannot run DashboardPrj
Thanks a lot. I commented the line and everything is fine except all searchings.

When starting the project, you will see following warning:
[WARN] Injected scripts no longer require an associated JavaScript block.

when doing google search, google video search, and blog / video search, nothing happens. no error, no warning. when doing yahoo search component, there is an exception:
[WARN] StandardWrapperValve[shell]: Servlet.service() for servlet shell threw exception
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at java.lang.Class.forName(Class.java:141)
at com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:874)
at com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:240)
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:19smilie


Thnaks,
Baiqing