I have a simple application setup. It is comprised of a single module
that has one responsibility. Its job is to test RPC in my
application. Here's what I have. First, on the client side, I have a
TestData object. This object implements java.io.Serializable. It has
one member variable, which has a public access modifier. On the
server side, it's very simple. I have an implementation of a
RemoteServiceServlet that has 2 methods. One that creates an instance
of TestData, the other that accepts an instance of TestData and simply
returns true.
I have 2 goals:
1. I am testing if the TestData can successfully travel from server-
side to client side.
2. I want to create a TestData object and send it to the server side.
I am deploying my application as a WAR file with Tomcat. Tomcat is
running with security enabled.
I can successfully accomplish my first goal. I get the object back
from the server and display its contents in a Label. When I attempt
the second goal I get the following exception:
2010-08-11 21:24:37 StandardContext[/trunorth]Exception while
dispatching incoming RPC call
java.security.AccessControlException: access denied
(java.lang.reflect.ReflectPermission suppressAccessChecks)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:
323)
at
java.security.AccessController.checkPermission(AccessController.java:
546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at
java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:
107)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.instantiate(ServerSerializationStreamReader.java:
887)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:
544)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:
61)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader
$ValueReader$8.readValue(ServerSerializationStreamReader.java:137)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:
384)
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:296)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
186)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
snip...
In terms of code, this is what I'm trying to do from the client side:
testService.sendTestData(new TestData(), sendTestDataCallback);
The communication with the server is fine. The ONLY problem I have is
when I try and create a custom object on the client side and send it
to the server. How can I get around this WITHOUT modifying Tomcat
permissions?
When I officially deploy this application I won't have access to
Tomcat's permissions so I need to make this work with the default
Tomcat security settings.
Please explain to me why a custom object can travel from server to
client with no issues, while the converse is not true.
Thanks in advance
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.