Re: Still problems with com.google.gwt.core.client.GWTBridge

4,534 views
Skip to first unread message

Pablo Nussembaum

unread,
Oct 31, 2012, 1:44:12 PM10/31/12
to google-we...@googlegroups.com, Moritz
Moritz,
Until you find the actual problem you can use this jar.

Regards,
--
Bauna

On 10/31/2012 09:08 AM, Moritz wrote:
> Hi all,
>
> I get a NoClassDefFoundError for com.google.gwt.core.client.GWTBridge
> when I throw a RuntimeException on a server RPC. When I do not throw
> the RuntimeException and the RPC completes fine also no
> NoClassDefFoundError is thrown.
> As a workaround, I created an abstract
> com.google.gwt.core.client.GWTBridge which simply extends the
> ...shared.GWTBridge class. I read about
> http://code.google.com/p/google-web-toolkit/issues/detail?id=7527 but
> it seems that this is something different, or not? Any solution?
>
> Cheers,
> Moritz.
>
> PD, here comes the full stack trace, the exception seems to be related
> to the Guice filters:
>
> SEVERE: javax.servlet.ServletContext log: Exception while dispatching
> incoming RPC call
> java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:186)
> at
> com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
> at
> com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
> at
> com.google.gwt.user.client.rpc.core.java.util.Arrays$ArrayList_CustomFieldSerializer.serialize(Arrays.java:64)
> at
> com.google.gwt.user.client.rpc.core.java.util.Arrays$ArrayList_CustomFieldSerializer.serializeInstance(Arrays.java:94)
> at
> com.google.gwt.user.client.rpc.core.java.util.Arrays$ArrayList_CustomFieldSerializer.serializeInstance(Arrays.java:34)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:786)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667)
> at
> com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:585)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass(ServerSerializationStreamWriter.java:755)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:794)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667)
> at
> com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
> at
> com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:585)
> at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:605)
> at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:393)
> at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
> at
> com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
> at
> com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
> at
> com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
> at
> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
> at
> com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)
> at
> com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49)
> at
> com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
> at
> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
> at
> com.MYPROJECT.server.NamespaceFilter.doFilter(NamespaceFilter.java:22)
> at
> com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
> at
> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
> at
> com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
> at
> com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:123)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
> at
> com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at
> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:383)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: java.lang.ClassNotFoundException:
> com.google.gwt.core.client.GWTBridge
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> at
> com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:207)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> ... 71 more
> --
> You received this message because you are subscribed to the Google
> Groups "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/9ph3EIFIOeUJ.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.

gwt-fix-2.5.0-rc2.jar

Thomas Broyer

unread,
Oct 31, 2012, 7:44:32 PM10/31/12
to google-we...@googlegroups.com
I've reopened the issue; it looks like we indeed didn't fix it completely.

Thomas Broyer

unread,
Dec 21, 2012, 10:43:42 PM12/21/12
to google-we...@googlegroups.com, Moritz


On Friday, December 21, 2012 6:40:24 PM UTC+1, Ara Yapejian wrote:
I'm also seeing this, has their been any updates or anyone know of a fix?

Please refer to the issue linked in the first post in this thread.
 
This happened trying to upgrade my jars to gwt 2.5

We'll release 2.5.1 soon that'll fix it. 

Ara Yapejian

unread,
Dec 22, 2012, 8:56:30 AM12/22/12
to google-we...@googlegroups.com, Moritz
Thank you I'll take a look...

Blaze

unread,
Dec 22, 2012, 11:42:58 AM12/22/12
to google-we...@googlegroups.com, Moritz
Hi,

I had the same problem..

the com/google/gwt/core/client/GWTBridge is inside the dev.jar and adding this jar on the server side will fix the problem..*its a 30mb jar I dont recommend this)
or u can just take this class and add it to the servlet.jar ...

The class is just un extension of the shared GWTBridge class ...


what actually is cossing the problem is that GWT.class uses com/google/gwt/core/client/GWTBridge inside 

 static void setBridge(GWTBridge bridge) {
    sGWTBridge = bridge;
    if (bridge != null) {
      setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
    }

sGWTBridge in this class is not having un import inside meaning its seeing the class from the same package..


if on a server side u use this class(its used for a dual implementation) where u check something like

GWT.isClient()

or 

GWT.isProdMod

rhis will always trow the class not found exp...


Hope this helps..

B

Thomas Broyer

unread,
Jun 5, 2013, 10:32:04 AM6/5/13
to google-we...@googlegroups.com


On Wednesday, June 5, 2013 3:51:52 PM UTC+2, Andrei Costescu wrote:
I see this happening in 2.5.1 as well.
(I used the fix jar in 2.5.0  - I'll keep using it in 2.5.1)

Are you using any third-party GWT library on the server? Which class is trying to access com.google.gwt.core.client.GWT? (rather than com.google.gwt.core.shared.GWT) 

Stefan Sandhop

unread,
Aug 27, 2013, 10:03:32 AM8/27/13
to google-we...@googlegroups.com
On Wednesday, June 5, 2013 4:32:04 PM UTC+2, Thomas Broyer wrote:

Are you using any third-party GWT library on the server? Which class is trying to access com.google.gwt.core.client.GWT? (rather than com.google.gwt.core.shared.GWT) 
 
For me this happens with com.google.gwt.event.dom.client.PrivateMap using GWT 2.5.1 while trying to create a ClickEvent in a JUnit test (not GWTTestCase). I think, there is no need to use com.google.gwt.core.client.GWT there.


 

Thomas Broyer

unread,
Aug 27, 2013, 10:27:42 AM8/27/13
to google-we...@googlegroups.com
It's possible that using shared.GWT there would solve your immediate problem, but ClickEvent definitely is client code, with lots of JSNI; it's not meant to be used outside a “GWT environment” (i.e. plain JVM), so I think it's unlikely we'd make the change.
Try to refactor your code, or pass 'null' instead of a ClickEvent instance, or have a look at gwt-test-utils or gwt-mockito.

Stefan Sandhop

unread,
Aug 28, 2013, 9:26:31 AM8/28/13
to google-we...@googlegroups.com
I agree with you. 
Passing 'null' did the trick in most cases.

So I just wanted to share my finding as it would not be a big change and would not make a difference in any other case.

m.as...@gmail.com

unread,
Sep 19, 2013, 11:20:22 AM9/19/13
to google-we...@googlegroups.com, Moritz
Thanks, this fixed the problem for me.
Reply all
Reply to author
Forward
0 new messages