com.google.gwt.core.client.GWTBridge

1,065 views
Skip to first unread message

Jimo

unread,
May 29, 2012, 4:43:48 PM5/29/12
to google-web-tool...@googlegroups.com
Hello, 

I rebuilt GWT with the latest in the source tree and am now getting a class not found exception for com.google.gwt.core.client.GWTBridge in my servlet RPC implementation. Should that class exist in gwt-servlet.jar? When I add it to that jar file, the class not found exception goes away.

[It looks like GWTBridge and some related classes changed earlier this month.]

Thanks,
Jim
  

Freeland Abbott

unread,
May 30, 2012, 2:58:15 PM5/30/12
to google-web-tool...@googlegroups.com
The workaround is to inject a server dependency on :gwt-dev, aka gwt-dev.jar, which supplies that class.

It's a side effect of a refector we did recently, but I haven't reviewed for what made it become necessary where it wasn't before.


John Tamplin

unread,
May 30, 2012, 2:59:50 PM5/30/12
to google-web-tool...@googlegroups.com
On Tue, May 29, 2012 at 4:43 PM, Jimo <jpon...@gmail.com> wrote:
I rebuilt GWT with the latest in the source tree and am now getting a class not found exception for com.google.gwt.core.client.GWTBridge in my servlet RPC implementation. Should that class exist in gwt-servlet.jar? When I add it to that jar file, the class not found exception goes away.

[It looks like GWTBridge and some related classes changed earlier this month.]

Do you know what class is referencing c.g.g.client.GWTBridge?  There is a shared version (which the client one derives from) that should be there, but referencing client code in the server is dangerous. 

--
John A. Tamplin
Software Engineer (GWT), Google

Stephen Haberman

unread,
May 30, 2012, 5:04:26 PM5/30/12
to google-web-tool...@googlegroups.com, jpon...@gmail.com

> I rebuilt GWT with the latest in the source tree and am now getting a
> class not found exception for com.google.gwt.core.client.GWTBridge in
> my servlet RPC implementation. Should that class exist in
> gwt-servlet.jar? When I add it to that jar file, the class not found
> exception goes away.

Huh, I'm getting the same exception too after updating to trunk
yesterday:

[java] java.lang.NoClassDefFoundError:
com/google/gwt/core/client/GWTBridge [java] at
com.google.gwt.user.server.rpc.impl.SerializabilityUtil.computeHasCustomFieldSerializer(SerializabilityUtil.java:513)
[java] at
com.google.gwt.user.server.rpc.impl.SerializabilityUtil.hasCustomFieldSerializer(SerializabilityUtil.java:366)
[java] at
com.google.gwt.user.server.rpc.impl.SerializabilityUtil.generateSerializationSignature(SerializabilityUtil.java:868)
[java] at
com.google.gwt.user.server.rpc.impl.SerializabilityUtil.getSerializationSignature(SerializabilityUtil.java:333)
[java] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.validateTypeVersions(ServerSerializationStreamReader.java:1112)
[java] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:610)
[java] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567)
[java] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:140)
[java] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:425)
[java] at
com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:312)
[java] at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
[java] at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
[java] at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)

SerializabilityUtil is calling "if c.g.g.core.client.GWT.isClient()" and
that class has a setBridgeMethod method which takes a
core.client.GWTBride parameter.

Seems like maybe SerializabilityUtil should use shared.GWT.isClient()
instead? It has a setBridgeMethod too, but the type there is
shared.client.GWTBridge, which is in the servlet jar, so should work.

I'll try this locally and see how it goes.

- Stephen

Stephen Haberman

unread,
May 30, 2012, 5:38:54 PM5/30/12
to google-web-tool...@googlegroups.com, jpon...@gmail.com

> Seems like maybe SerializabilityUtil should use shared.GWT.isClient()
> instead? It has a setBridgeMethod too, but the type there is
> shared.client.GWTBridge, which is in the servlet jar, so should work.

This worked. Patch is here:

http://gwt-code-reviews.appspot.com/1722803

- Stephen

Jens

unread,
May 30, 2012, 7:09:49 PM5/30/12
to google-web-tool...@googlegroups.com
Do you know what class is referencing c.g.g.client.GWTBridge?  There is a shared version (which the client one derives from) that should be there, but referencing client code in the server is dangerous.

You could integrate Macker (http://innig.net/macker/index.html) into your GWT ant script and define a rule that checks for any reference from *.server.* to *.client.* packages. May be helpful to detect such "violations".

-- J.

John Tamplin

unread,
May 30, 2012, 7:13:21 PM5/30/12
to google-web-tool...@googlegroups.com
On Wed, May 30, 2012 at 7:09 PM, Jens <jens.ne...@gmail.com> wrote:
You could integrate Macker (http://innig.net/macker/index.html) into your GWT ant script and define a rule that checks for any reference from *.server.* to *.client.* packages. May be helpful to detect such "violations".

There is a ton of stuff we would have to clean up first, and I think we will get that for free by splitting it up into smaller jar's -- you just don't even put the client stuff on the classpath for the server.
Reply all
Reply to author
Forward
0 new messages