Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy vaadin to JBoss 7.0 gives me a ClassNotFoundException

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?

like image 495
Stijn Vanpoucke Avatar asked Aug 25 '11 10:08

Stijn Vanpoucke


3 Answers

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.

like image 62
Peter Avatar answered Oct 31 '22 10:10

Peter


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).

like image 42
eeq Avatar answered Oct 31 '22 10:10

eeq


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.

like image 1
Joonas Avatar answered Oct 31 '22 11:10

Joonas