Deploy vaadin to JBoss 7.0 gives me a ClassNotFoundException
Asked Answered
E

4

5

I've created a new Vaadin (6.6.5) project in eclipse and I've tried to deploy it on JBoss 7.0 but it gives me a GWT ClassNotFoundException

Caused by: java.lang.ClassNotFoundException: com.google.gwt.user.client.ui.HasWidgets from [Module "deployment.test.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
    ... 64 more

Do I need to do something extra to deploy the gwt libraries?

Embarrassment answered 25/8, 2011 at 10:51 Comment(1)
Works when adding gwt-dev.jar, gwt-user.jar, validation-api-1.0.0.GA.jar to the WEB-INF\lib directory manually. Doesn't seem to be the intent of the eclipse plugin to do it like this, there should be a better solution right?Embarrassment
J
5

Seems that some GWT classes in gwt-user.jar required for compiling the Vaadin client side widgetset are loaded by the JBoss7 unnecessarily.

vaadin.jar contains references to gwt-user.jar but it's not required during runtime, only during widgetset compilation time. Still JBoss wants to load these classes causing the problem.

There's a bug report in JBoss for this: http://community.jboss.org/thread/169575?tstart=0

As mentioned there, workaround is to include gwt-user.jar to the deployment package in WEB-INF/lib folder with the vaadin.jar, seems to work.

Jodiejodo answered 16/10, 2011 at 18:9 Comment(0)
T
1

Vaadin Eclipse plugin creates library dependencies to gwt jar files and generally Eclipse should take care of the runtime classpath when deploying.

As the package name com.google.gwt.user.client suggest this should be in gwt-user.jar.

The gwt-dev.jar should only be needed when compiling client-side code with GWT.

Are you using add-ons? Add-ons (and their dependencies) should be always added to WEB-INF/lib to make the server-side classes available to the application and client-side code available to the GWT compiler.

On possible cause of the problem is (unnecessary) dependency to client-side class which is not available in the server at runtime. So, you might also check your code for unnecessary server-side dependencies to client-side GWT classes (like HasWidgets).

Tiler answered 29/8, 2011 at 19:42 Comment(0)
B
1

Check your code to ensure that you do not accidentally access this com.google.gwt.** class from your code. As said above, there is no need to deploy gwt libraries in the server.

Ballonet answered 31/8, 2011 at 5:42 Comment(0)
J
0

Vaadin has now published an add-on to fix this, see https://vaadin.com/directory#!addon/vaadin-application-server-class-loader-workaround

Jaret answered 1/9, 2016 at 18:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.