JBoss deployment problem with gwt-servlet.jar

40 views
Skip to first unread message

romant

unread,
Nov 2, 2007, 6:25:10 AM11/2/07
to Google Web Toolkit
Hi guys,
I am trying to deploy a Seam+GWT application on JBoss 4.2.2GA server.
When I deploy my EAR file, where gwt-servlet.jar file is located in
server/default/deploy/MyProject.EAR and in server/default/deploy/
MyProject.EAR/WEB-INF/lib/ as well, I still get the error

java.lang.NoClassDefFoundError: com/google/gwt/user/client/rpc/
RemoteService
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)

However, when I place it in server/default/lib it works. But it does
not seem to be a good solution, it would be better to have the file in
my EAR, together with other jar files. I cannot understand why it does
not work.

Ant suggestions? Thanxs.

wmat

unread,
Nov 2, 2007, 10:35:05 AM11/2/07
to Google Web Toolkit
Romant,

I used to have this problem a long time ago. It is caused by the way
JBoss does class loading and the fact that you have packaged those
classes so that they are loadable from multiple JBoss class
repositories. The exception name suggests that JBoss couldn't find
the class, but in fact it found it twice and doesn't like that.
Package it in your EAR, not in your WAR, and you should be ok.

BTW, Seam is all about keeping client state on the server; GWT is all
about wonderfully stateful clients. You don't need Seam.

Walden

romant

unread,
Nov 2, 2007, 5:49:10 PM11/2/07
to Google Web Toolkit
Thanks for your reply. I am affraid I already tried to place it only
in EAR, but it did not work. I'll try again, anyway.

Right, theoretically I do not need Seam when using GWT. However, to
let Seam automatically generate all the entity beans from my database
and then simply call some session beans by RPC is the simplest and
fastest way of creating a web application I would say.

For me Seam is a glue which connects hibernate (model), gwt (view) and
allows to call methods in sesion beans(controller) directly by RPC.
Why would be GWT supported in Seam then? I understand GWT in Seam as a
nice way of creating user front-end quickly without the html
+javascript pain with browser incompatibilities.

If my point of view is incorrect or contains some gaps please let me
know. This kind of discussion could be beneficial, I am new to JEE.

wmat

unread,
Nov 5, 2007, 7:55:14 AM11/5/07
to Google Web Toolkit

On Nov 2, 5:49 pm, romant <roman.te...@gmail.com> wrote:
> Thanks for your reply. I am affraid I already tried to place it only
> in EAR, but it did not work. I'll try again, anyway.

If you do try again, maybe write back with the exact failure. Also be
aware that JBoss by default pulls a couple of tricks on the standard
JEE webapp classloading which tend to be useful, but which you may
have disabled.

>
> Right, theoretically I do not need Seam when using GWT. However, to
> let Seam automatically generate all the entity beans from my database
> and then simply call some session beans by RPC is the simplest and
> fastest way of creating a web application I would say.

I'm doing the same thing using JBoss + EJB3, no Seam. Once I got my
design properly centered around the GWT stateful client, I found the
only thing Seam was still doing for me was making it a teeny bit
easier to use Log4j: not enough to justify its place in the stack.

>
> For me Seam is a glue which connects hibernate (model), gwt (view) and
> allows to call methods in sesion beans(controller) directly by RPC.

My RemoteServiceServlet makes calls directly on my EJB3 Session layer,
seamlessly ;-).

> Why would be GWT supported in Seam then? I understand GWT in Seam as a
> nice way of creating user front-end quickly without the html
> +javascript pain with browser incompatibilities.

I could only conjecture, but I'd say it has more to do with keeping
market share than with really good software design.

>
> If my point of view is incorrect or contains some gaps please let me
> know. This kind of discussion could be beneficial, I am new to JEE.

The best way to discover why you really need something is to try
leaving it out.

Cheers,

Walden

Reply all
Reply to author
Forward
0 new messages