StockWatcher RPC example does not work under JBoss AS

24 views
Skip to first unread message

Lonifasiko

unread,
Nov 19, 2008, 10:34:00 AM11/19/08
to Google Web Toolkit
Hi,

After seeing that StockWatcher RPC example works great under GWT
hosted mode, I'm trying to deploy StockWatcher RPC example of GWT
Tutorial (http://code.google.com/docreader/#p=google-web-toolkit-
doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideRPCDeployment) under
JBoss version 4.2.3. GA.

The error under JBoss console is "Cannot load servlet class:
com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl".

I think problem could be related to the content copied under "WEB-INF
\classes". Tutorial says:

"Copy the compiled class files from your project to the /WEB-INF/
classes folder in the staging area. Make sure you include all of the
subdirectories as well."

I've tried placing under this directory all .class files under "bin",
both client and server side .class files, only server-side ones,
mantaining and not mantaining directories structure above .class
files, but at the moment there is no way to access de GWT RPC example
under JBoss.

URL and servlet mapping under web.xml file also seem to be correct:

<servlet>
<servlet-name>StockPrices</servlet-name>
<servlet-
class>com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl</
servlet-class>
</servlet>

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>StockPrices</servlet-name>
<url-pattern>/stockPrices</url-pattern>
</servlet-mapping>

Am I missing something else?

I'd really appreciate any help of any GWT and JBoss expert. Thanks
very much in advance.

Miguel
Blog: http//lonifasiko.blogspot.com

gregor

unread,
Nov 19, 2008, 11:20:21 AM11/19/08
to Google Web Toolkit
Hi Miguel,

Sounds like you are not using an ant script to build a WAR file? It is
much easier to deploy a GWT app on JBoss as a WAR - just toss it into
the deploy directory and off it goes.

Search group for "build.xml ant deploy" for numerous examples to crib
from. If you find one that uses a build.properties as well, then you
can reuse it for all your GWT projects by just adjusting the
properties.

regards
gregor

Lonifasiko

unread,
Nov 20, 2008, 2:10:06 AM11/20/08
to Google Web Toolkit
Hi gregor, thanks for the reply.

I'll take a look at the possibility of using an ANT script to deploy
the .war file under JBoss. Nevertheless, I understand following steps
of the GWT tutorial (although related to Tomcat deployment), should
work also for JBoss (zip all the content, rename to .war and place
the .war under "deploy" directory of Jboss).

Has anybody successfully achieved deploying the GWT example .war under
JBoss in the way GWT tutorial says?

Thanks veyr much in advance, I'll keep you updated with my
progresses...

Miguel
Blog: http//lonifasiko.blogspot.com

gregor

unread,
Nov 20, 2008, 5:31:51 AM11/20/08
to Google Web Toolkit
Check

http://www.jboss.org/community/docs/DOC-9719

The key is to create a directory under server/xxxx/deploy with a name
with .war at the end of it, then JBoss treats it the same as a
compressed WAR file. If you then copy your files into this as per
tutorial it should work. Run it using the directory name minus
the .war extention (same as if it was a WAR file)

If your module is
com.google.gwt.sample.stockwatcher.StockWatcher.gwt.xml, your module
HTML page is StockWatcher.html and you name the expanded deplyment
directory stockwatcher.war then the default URL to fire up the example
is probably:

http://localhost:8080/stockwatcher/com.google.gwt.sample.stockwatcher.StockWatcher/StockWatcher.html

which translates as:

<your JBoss server>/<the expanded directory or WAR file name (minus
the .war)>/<path.to.your.GWT.module.filename(minus the .gwt.xml)/
moduleHTMLfile.html

The long com.google.gwt.sample.stockwatcher.StockWatcher/
StockWatcher.html bit is because that's typically what the GWT
compiler creates under www, so that's how JBoss finds it. You can
manually move the html and js files nearer the root of
stockwatcher.war directory and alter the URL accordingly.

However as I say, learn ant: it means you configure everything in your
IDE (in a place that is convenient for development, not deployment)
and ant takes care of all these boring details every time you want to
deploy. The advantages are a) ant never makes a mistake, b) ant does
it in seconds, c) if more than one person is working on the project
you have a solid baseline compile/deploy system independent of IDEs
that always works for everyone, d) if you put a project down and come
back to it later chances are you will have forgotten some details that
made the deployment work - your ant script won't have.

HTH
gregor
Reply all
Reply to author
Forward
0 new messages