RequestFactory -> ClassNotFound: JsonException but gwt-dev in WEB-INF/lib

95 views
Skip to first unread message

andymel

unread,
Feb 11, 2015, 6:51:47 PM2/11/15
to google-we...@googlegroups.com
Hi,

I get the following exception when I try to run my compiled gwt project with a tomcat server:

Feb 12, 2015 12:34:03 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [requestFactoryServlet] in context with path [/gwtproj] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.json.JSONException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
        at com.google.web.bindery.autobean.shared.impl.StringQuoter.split(StringQuoter.java:73)
        at com.google.web.bindery.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.java:54)
        at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:132)
        at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

I added the gwt-dev.jar in the WEB-INF/lib directory after I got that exception the first time and I can see it in the lib folder on the server. But the Exception is still thrown. The app starts and can be used, but when it comes to the first usage of the requestfactory the exception is thrown.

I have undeployed/recompiled/deployed the app multiple time now. 
Any idea?

Thanks!
Andy

Thomas Broyer

unread,
Feb 12, 2015, 5:28:55 AM2/12/15
to google-we...@googlegroups.com
Do not ever deploy gwt-dev or gwt-user!
There's a gwt-servlet.jar for that, and a gwt-servlet-deps.jar including its dependencies, for those who don't use "managed dependencies" (through Maven, Gradle, Ivy, etc.)

andymel

unread,
Feb 15, 2015, 8:48:38 AM2/15/15
to google-we...@googlegroups.com
Thanks a lot Thomas! Perfect hint. Much smaller and it works :)
But let me dig deeper...You say: "Do not ever deploy gwt-dev or gwt-user!".
Because of the size (83kb vs 39mb) or is there also another reason why you say it that strict?
Because I still don't see why the JSONException class was not found in the gwt-dev library.
Reply all
Reply to author
Forward
0 new messages