(HELP) com.google.gwt.user.client.rpc.StatusCodeException after deployment on tomcat

713 views
Skip to first unread message

ytbryan

unread,
Feb 18, 2009, 10:43:29 AM2/18/09
to gwt-maven
hi all,

after i deploy my application( that has RPC) on tomcat using , i got
the following error:

HTTP Status 404 - /gwt-test-MySQLConn/
com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService

type Status report

message /gwt-test-MySQLConn/com.tribling.gwt.test.mysqlconn.MySQLConn/
MySQLConnService

description The requested resource (/gwt-test-MySQLConn/
com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService) is not
available.

i have no clue what is wrong as it was working fine at hosted mode.
please help me!!


and the MySQLConnService is in the client folder of
com.tribling.gwt.test.mysqlconn

what is com.google.gwt.user.client.rpc.StatusCodeException exactly?

Robert "kebernet" Cooper

unread,
Feb 18, 2009, 10:45:15 AM2/18/09
to gwt-...@googlegroups.com
Are you running the mergewebxml goal as part of your build?

What is in your deployed WEB-INF/web.xml file?
--
:Robert "kebernet" Cooper
::kebe...@gmail.com
Alice's cleartext
Charlie is the attacker
Bob signs and encrypts
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x9E8759F8

ytbryan

unread,
Feb 18, 2009, 10:53:28 AM2/18/09
to gwt-maven
thank you for your reply. do you mean the WEB-INF/web.xml file?
inside myapplication.war ??

On Feb 18, 4:45 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:
> Are you running the mergewebxml goal as part of your build?
>
> What is in your deployed WEB-INF/web.xml file?
>
>
>
> On Wed, Feb 18, 2009 at 10:43 AM, ytbryan <ytbr...@gmail.com> wrote:
>
> > hi all,
>
> > after i deploy my application( that has RPC) on tomcat using , i got
> > the following error:
>
> > HTTP Status 404 - /gwt-test-MySQLConn/
> > com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService
>
> > type Status report
>
> > message /gwt-test-MySQLConn/com.tribling.gwt.test.mysqlconn.MySQLConn/
> > MySQLConnService
>
> > description The requested resource (/gwt-test-MySQLConn/
> > com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService) is not
> > available.
>
> > i have no clue what is wrong as it was working fine at hosted mode.
> > please help me!!
>
> > and the MySQLConnService is in the client folder of
> > com.tribling.gwt.test.mysqlconn
>
> > what is com.google.gwt.user.client.rpc.StatusCodeException exactly?
>
> --
> :Robert "kebernet" Cooper
> ::keber...@gmail.com

ytbryan

unread,
Feb 18, 2009, 10:56:46 AM2/18/09
to gwt-maven
and yes. i did run mergewebxml goal as part of my build. ....

Robert "kebernet" Cooper

unread,
Feb 18, 2009, 10:56:47 AM2/18/09
to gwt-...@googlegroups.com
Yeah.

If you are running the mergewebxml goal as part of your build, you
should see something like:

<servlet>
<name>me.MyModule/me.MyServlet</name>
<class>me.MyServlet</class>
</servlet>

and

<servlet-mapping>
<name>me.MyModule/me.MyServlet</name>
<url>me.MyModule/me.MyServlet</name>
</servlet-mapping>

for each servlet defined in your gwt.xml module descriptor. If you
aren't running this goal as part of your build, you need to manually
add those to a web.xml file in your project
(src/main/webapp/WEB-INF/web.xml)
--
:Robert "kebernet" Cooper
::kebe...@gmail.com

ytbryan

unread,
Feb 18, 2009, 11:07:40 AM2/18/09
to gwt-maven
i did ran the webmergexml. but i check teh web.xml and it does not
have servet or servlet mapping.

sorry i am not familiar with what you are saying...... my gwt.xml is
below...... can you explain to me again>?



<?xml version="1.0" encoding="UTF-8" standalone="no"?><module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.gwtext.GwtExt"/>
<inherits name="com.gwtext.Charts"/>


<!-- Inherit the gwtextux plugin stuff. -->
<!-- <inherits name="com.gwtextux.GridSearchPlugin"/>-->



<!-- Specify the app entry point class. -->
<entry-point class="com.tribling.gwt.test.mysqlconn.client.MySQLConn"/
>

<!-- style -->
<stylesheet src="style.css"/>
<stylesheet src="js/ext/resources/css/ext-all.css"/>
<script src="js/ext/adapter/ext/ext-base.js"/>
<script src="js/ext/ext-all.js"/>

<!-- servlet context - path is arbritray, but must match up with
the rpc init inside java class -->
<!-- Tomcat will listen for this from the server and waits for rpc
request in this context -->
<servlet
class="com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl"
path="/MySQLConnService"/>


</module>

On Feb 18, 4:56 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:

Robert "kebernet" Cooper

unread,
Feb 18, 2009, 11:18:21 AM2/18/09
to gwt-...@googlegroups.com
Check and see if you have a target/web.xml file... Because of the way
(grumble grumble) the M2 war plugins work you have to run the
mergewebxml goal, then edit the war settings in your pom to use
target/web.xml not webapp/.../web.xml.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>target/web.xml</webXml>


See if the one in your target folder is correct after running mergewebxml..

You can look at the sample here:
http://code.google.com/p/gwt-maven/source/browse/trunk/maven-googlewebtoolkit2-sample/war/pom.xml
--
:Robert "kebernet" Cooper
::kebe...@gmail.com

ytbryan

unread,
Feb 18, 2009, 11:18:57 AM2/18/09
to gwt-maven
i think i got it . it should be added under <webapp>

but how come webmergexml doesn't do it for me =.=

Robert "kebernet" Cooper

unread,
Feb 18, 2009, 11:21:15 AM2/18/09
to gwt-...@googlegroups.com
Well, the general idea here is this:


you have a web.xml file under src/main/webapp/WEB-INF.

There you can put anything you want that ISN'T a GWT servlet. Like
filters, authentication settings, etc.

The mergewebxml goal reads that web.xml file, and adds all the GWT
servlets in the right place, and writes to target/web.xml. You then
build your war file with the target/web.xml file and you have
everything you have manually configured + all the GWT servlets defined
in your modules.
--
:Robert "kebernet" Cooper
::kebe...@gmail.com

ytbryan

unread,
Feb 18, 2009, 11:39:29 AM2/18/09
to gwt-maven
gosh....
thank you for your patience.......... may i check the path for pom.xml
is META-INF/maven/pom.xml?

i edit that pom.xml but it is still not working..... do i need to
comment out " <warSourceExcludes>.gwt-tmp/**</warSourceExcludes> "

On Feb 18, 5:21 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:

ytbryan

unread,
Feb 18, 2009, 11:41:13 AM2/18/09
to gwt-maven
i realised that the servlet and servlet mapping that gwt-maven added
are kinda weird.


below:

<servlet>
<servlet-
name>com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl/
com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService</servlet-
name>
<servlet-
class>com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl</
servlet-class>
</servlet>
<!--inserted by gwt-maven-->
<servlet-mapping>
<servlet-
name>com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl/
com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService</servlet-
name>
<url-pattern>/com.tribling.gwt.test.mysqlconn.MySQLConn/
MySQLConnService</url-pattern>
</servlet-mapping>


is there somethign wrong?

ytbryan

unread,
Feb 18, 2009, 11:45:29 AM2/18/09
to gwt-maven
this is from my application.gwt.xml

<servlet
class="com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl"
path="/MySQLConnService"/>

is there something wrong?

Robert "kebernet" Cooper

unread,
Feb 18, 2009, 11:59:09 AM2/18/09
to gwt-...@googlegroups.com
Right. The reason for the prefix is that when the GWT classes are
built, they will go into:

target/webapp/ModuleName/*

This is just the default GWT compiler behavior, but it has secondary
advantages I talked about in the other thread going on here about
module prefix directories. Basically it works like this:

When your module is built, that "ModuleName" folder in front of
everything becomes the GWT.getModuleBaseURL() (I think that is the
name). You can then prepend that into the URLs for your service stubs
and they will work end to end. This can be a little confusing in the
GWTShell because your MySQLConnService in the shell will answer on
BOTH "/MySQLConnService" AND
"com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl/com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService"

However, since the war will usually have a context path in front of
it, using the full version so that the Module Base URL in your
compiled GWT code contains the context path is handy. That is, that
servlet mapping, when running, will make getModuleBaseURL() return:

http://localhost:8080/artifactId/com.tribling.gwt.test.mysqlconn.server.MySQLConnServiceImpl/com.tribling.gwt.test.mysqlconn.MySQLConn/MySQLConnService

which should be a valid URL. Also, if you are building multiple
modules into the same WAR file, this prevents collisions.

As for checking the path for the pom file, no. That META-INF/maven
directory only gets built into JAR files. When you build a WAR file,
it doesn't go into the WEB-INF/classes directory by default. You could
use an antrun goal to copy it there if you need it for your code to
run properly, however.
--
:Robert "kebernet" Cooper
::kebe...@gmail.com
Reply all
Reply to author
Forward
0 new messages