How to debug gwt code and servlets on the same session?

184 views
Skip to first unread message

Giuseppe Sacco

unread,
Nov 9, 2007, 1:32:36 AM11/9/07
to Google Web Toolkit
Hi all,
I had two different eclipse projects: one for the gwt stuff and one
for the server side servlets. It was working very nice when debugging
servlet code (using my tomcat instance). Then I tried to also debug my
gwt code but when in host mode I cannot communicate with my servlets
since I deployed them to a different tomcat and I used
GWT.getModuleBaseURL() for generating my URL.

So, I moved everything from my servlet project to the GWT project;
then I modified my project xml file adding the required <servlet ../>
tags.

Now, when I start host mode, I get this error.

[ERROR] Failure to load module 'it.lixper.lixperlicence.LixperLicence'
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.kind()I
at
com.google.gwt.dev.jdt.TypeOracleBuilder.isInterface(TypeOracleBuilder.java:
481)
at
com.google.gwt.dev.jdt.TypeOracleBuilder.processType(TypeOracleBuilder.java:
531)
at com.google.gwt.dev.jdt.TypeOracleBuilder.access
$000(TypeOracleBuilder.java:93)
at com.google.gwt.dev.jdt.TypeOracleBuilder
$2.visit(TypeOracleBuilder.java:410)
at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:
990)
at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:
307)
at
com.google.gwt.dev.jdt.TypeOracleBuilder.build(TypeOracleBuilder.java:
395)
at com.google.gwt.dev.cfg.ModuleDef.getTypeOracle(ModuleDef.java:294)
at com.google.gwt.dev.cfg.ModuleDef.refresh(ModuleDef.java:359)
at
com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:
86)

I couldn't find much information on this error. Did anyone find and
fixed it?

For reference: GWT 1.4.61, GNU/Linux i386, eclipse 3.3.0, java
1.6.0.02.

Thanks,
Giuseppe

Peter Blazejewicz

unread,
Nov 9, 2007, 4:11:01 PM11/9/07
to Google Web Toolkit
hi Giuseppe,

your debug requiremeents are outlined in that technote for "noserver"
hosted mode option:
http://code.google.com/support/bin/answer.py?answer=55200&topic=10454

>>>
Though your own external server handles all static content and dynamic
resources, all browser application logic continues to be handled in
Java, internal to hosted mode. This means that you can continue to
debug your client-side code in Java as usual, but all server-side
requests will be served by your web or application server of choice.
(If you are using an IDE such as Eclipse configured to integrate with
GWT's hosted mode for debugging, then using -noserver will prevent you
from automatically debugging your server code in the same debugger
instance you use to debug hosted mode. However, if the server
software you use supports it, you can of course use an external
debugging tools.)
>>>>>

from what I understand you can run your J2EE/Web project using
different Eclipse instance then Eclipse instance you are debuggn GWT
module in hosted mode, but it cannot be done within the same Eclipse
IDE workspace instance,

regards,
Peter

Giuseppe Sacco

unread,
Nov 10, 2007, 2:16:14 AM11/10/07
to Google Web Toolkit
Hi Peter,
thanks for your info. I still have to try to use an external container
for both my static and dynamic content. I will try to setup it today,
but I wonder if this is the only solution: reading the documentation
it should be possible to use the tomcat instance included in GWT for
both static and dynamic. So either I have configured it incorrectly or
it doesn't work. Do you ever used the internal tomcat for both static
and dynamic content?

Thanks,
Giuseppe

On 9 Nov, 22:11, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:


> hi Giuseppe,
>
> your debug requiremeents are outlined in that technote for "noserver"
> hosted mode option:http://code.google.com/support/bin/answer.py?answer=55200&topic=10454
>
>
>
> Though your own external server handles all static content and dynamic
> resources, all browser application logic continues to be handled in
> Java, internal to hosted mode. This means that you can continue to
> debug your client-side code in Java as usual, but all server-side
> requests will be served by your web or application server of choice.
> (If you are using an IDE such as Eclipse configured to integrate with
> GWT's hosted mode for debugging, then using -noserver will prevent you
> from automatically debugging your server code in the same debugger
> instance you use to debug hosted mode. However, if the server
> software you use supports it, you can of course use an external
> debugging tools.)
>
>
>
> from what I understand you can run your J2EE/Web project using
> different Eclipse instance then Eclipse instance you are debuggn GWT
> module in hosted mode, but it cannot be done within the same Eclipse
> IDE workspace instance,
>
> regards,
> Peter

[...]

Sumit Chandel

unread,
Nov 13, 2007, 5:21:59 PM11/13/07
to Google-We...@googlegroups.com
Hi Giuseppe,

You should be able to use GWT's hosted mode embedded Tomcat server to run your servlets and host your static content.

There may be something wrong with the way you have currently configured the servlets in the module XML file, but it's hard to say with the current information available. Could you post up the packaging hierarchy you're using for your GWT module and servlets, as well as the <servlet> tags in your module XML file?

Also, one common mistake that people make when trying to run hosted mode using the embedded Tomcat server with servlets configured is forgetting to add the gwt-servlet.jar on the classpath of the hosted mode launch configuration. I'm not sure if this problem is consistent with the error message you received in the hosted mode console, but you might want to double-check that gwt-servlet.jar has been added to your launch configuration just in case.

However, at this point you should be able to go either way: with the embedded Tomcat server or with your own server using -noserver mode. If you're at the point where you are configuring your external server, you may as well go with the -noserver option since it will most closely resemble your production server environment. Let us know how it goes.

Hope that helps,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages