Could not initialize class com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer

506 views
Skip to first unread message

Jonas

unread,
Sep 21, 2011, 8:03:03 PM9/21/11
to google-we...@googlegroups.com
Hi,

I'm really new with GWT and the RequestFactory and I try to get this to work but I get error after error... so this is the current one:

[WARN] /gwtRequest
java.lang.NoClassDefFoundError: Could not initialize class com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer
at com.google.web.bindery.requestfactory.server.ServiceLayer.create(ServiceLayer.java:75)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:103)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:89)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

Can anyone give me a hint for where I should look for?

Thanks
Jonas

-sowdri-

unread,
Sep 22, 2011, 2:03:19 AM9/22/11
to google-we...@googlegroups.com
Maven or Ant build? And what version of GWT you are using (I could see web.bindery, 2.3 or 2.4)?

Charl Fourie

unread,
Dec 14, 2011, 11:52:24 AM12/14/11
to google-we...@googlegroups.com
I know it's a bit late, but it could help the next person.

If you are using hibernate-validator, you need to include all of its dependencies also (If you download hibernate-validator, they are situated in the lib folder.)

For hibernate-validator 4.0.2.GA, you would need the following (versions may differ):
  • requestfactory-server.jar
  • hibernate-validator-4.0.2.GA.jar
  • jpa-api-2.0.Beta-20090815.jar
  • log4j-1.2.14.jar
  • slf4j-api-1.5.6.jar
  • slf4j-log4j12-1.5.6.jar
  • validation-api-1.0.0.GA.jar

Zied Hamdi OneView

unread,
Sep 16, 2014, 10:09:56 PM9/16/14
to google-we...@googlegroups.com, jonas....@gmail.com
This seams due to a conflict between two versions of ReflectiveServiceLayer: please note it's not a ClassNotFound but a NoClassDefFound which is often related to a conflict. i still didn't solve my problem but there is clearly this class twice: (try with Ctrl + Shift + T in eclipse): it's both in gwt-servlet and in gwt-user

For me the issue happens on some deployements but not in others (with the same dependencies), so this is probably due to the order in which the jvm reads the classes... Issue to follow
Reply all
Reply to author
Forward
0 new messages