GWT deployment issue

36 views
Skip to first unread message

Payam

unread,
Jan 1, 2008, 11:14:00 PM1/1/08
to Google Web Toolkit
Hi all,

I have written a GWT application. What happens is that everything
works fine in the hosted mode. When I deploy, I get the html up with
all the widgets, but the widgets that are supposed to be populated
through the rpc mechanism are not. I strongly believe at this point
that my servlet mapping is somehow incorrect, but I have tried lots of
different things and nothing seems to be able to fix my problem. I was
hoping if someone can look at the following information and point me
to where the problem might be.

My web.xml has:

<servlet>
<servlet-name>AssociationServlet</servlet-name>
<servlet-class>gwtView.server.AssociationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AssociationServlet</servlet-name>
<url-pattern>/www/gwtView.test/AssociationServlet</url-pattern>
</servlet-mapping>

My test.gwt.xml has:

<servlet path="/AssociationServlet"
class="gwtView.server.AssociationServlet" />


This is how I am setting the url for the service inside my Java file:

IncidentAssociationsServiceAsync getIncidentAssociationsService =
(IncidentAssociationsServiceAsync)
GWT.create(IncidentAssociationsService.class);
ServiceDefTarget target = (ServiceDefTarget)
getIncidentAssociationsService;
String relativeUrl = GWT.getModuleBaseURL() + "/AssociationServlet";
target.setServiceEntryPoint(relativeUrl);

And finally this is my directory structure:

WEB-INF
....src
........gwtView
............test.gwt.xml
............client
................IncidentAssociationsService.java
................IncidentAssociationsServiceAsync.java
................IncidentAssociationView.java
............server
.................AssociationServlet.java
............public
................IncidentAssociationView.html
www
.....gwtView.test
....cache.js
....css
....

Isaac Truett

unread,
Jan 2, 2008, 10:17:39 AM1/2/08
to Google-We...@googlegroups.com
> <url-pattern>/www/gwtView.test/AssociationServlet</url-pattern>

That line gives you a URL like this:

http://host:port/context/www/gwtView.test/AssociationServlet

Go ahead and substitute your host/port/context and paste that into
your browser's address bar. You should get a message about GET not
being supported, as I recall. That's the URL that you need to hit from
your client-side JS.

What's not clear to me from your description is how you're deploying
and viewing your app. The only HTML file you show is under WEB-INF,
which your app server should be hiding (stuff under WEB-INF is not
served up to the public). If I assume that
IncidentAssociationView.html gets copied to www/gwtView.test/ upon
deployment, then

> String relativeUrl = GWT.getModuleBaseURL() + "/AssociationServlet";

produces

http://host:port/context/www/gwtView.test//AssociationServlet (note
the double slash is not hurting anything, but unnecessary)

And that should work. However, I suspect that your HTML file is not
ending up at http://host:port/context/www/gwtView.test/IncidentAssociationView.html.
Can you tell me where IncidentAssociationView.html is deployed?

Payam

unread,
Jan 2, 2008, 4:13:20 PM1/2/08
to Google Web Toolkit
Thanks for youre reply.

Sorry, I forgot to show my deployment package structure. Here it is:

gwtView
WEB-INF
....web.xml
....classes
.........gwtView
................client
.........................IncidentAssociationView.clas
.........................IncidentAssociationService.class
.........................IncidentAssociationServiceAsync.class
................common
................server
.........................AssociationServlet.class
.........webeocAdapter
....lib

Payam

unread,
Jan 2, 2008, 4:21:17 PM1/2/08
to Google Web Toolkit
I forgot to include the www directory, here it is when it gets
deployed:

gwtView
WEB-INF
....web.xml
....classes
.........gwtView
................client
.........................IncidentAssociationView.clas
.........................IncidentAssociationService.class
.........................IncidentAssociationServiceAsync.class
................common
................server
.........................AssociationServlet.class
.........webeocAdapter
....lib
www
....gwt.rpc
....cache.html
....cache.js
....cache.xml
....IncidentAssociationView.html
....js
....css

Payam

unread,
Jan 2, 2008, 4:26:44 PM1/2/08
to Google Web Toolkit
You were right. My html (IncidentAssociationView.html) was not getting
copied to the correct location so I changed my web.xml to look like:

<servlet>
<servlet-name>AssociationServlet</servlet-name>
<servlet-class>gwtView.server.AssociationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AssociationServlet</servlet-name>
<url-pattern>/www/AssociationServlet</url-pattern>
</servlet-mapping>

I also removed the extra / from my:

String relativeUrl = GWT.getModuleBaseURL() + "AssociationServlet";

Everything else is the same. You are also correct about getting the
message GET not being supported when I access:

http://payam-pc/eoc-web-adapter/www/AssociationServlet

Now, with the above changes, when I still access my html using path:

http://payam-pc/eoc-web-adapter/www/IncidentAssociationView.html

I get the panel up but my widgets are still not populated! What else
am I doing wrong?

Thanks again.

Payam

unread,
Jan 2, 2008, 5:02:59 PM1/2/08
to Google Web Toolkit
Some more information regarding the problem I am experiencing...

This is the error message I am getting back when using FireBug. Not
sure how I can fix my mapping though to resolve this. Any thoughts?
HTTP Status 404 - /eoc-web-adapter/www/IncidentAssociationService
<HR size="1" noshade="noshade">
type Status report

message /eoc-web-adapter /www/IncidentAssociationService

description The requested resource (/eoc-web-adapter /www/
IncidentAssociationService) is not available.

<HR size="1" noshade="noshade">
JBossWeb /2.0.1.GA
</body></html>

Payam

unread,
Jan 2, 2008, 8:28:06 PM1/2/08
to Google Web Toolkit
Thanks for all your help. My problem is finally resolved with your
help and help of others. Here is a link with more information:

http://www.manning-sandbox.com/thread.jspa?messageID=65619&#65619

Thanks again,
Payam
Reply all
Reply to author
Forward
0 new messages