Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Security Exception with RMI

0 views
Skip to first unread message

Bobby_X

unread,
Aug 22, 2000, 3:00:00 AM8/22/00
to
Is it possible to return a java.sql.ResultSet object via RMI?
 
I am learning RMI.  I have a RMI server that has a method that returns a ResultSet object to a client but I keep getting a security violation when the client calls the method to return the ResultSet.
 
I am using Java 2 and get the following exception.
 
Caught exception = java.security.AccessControlException: access denied (java.util.Property.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Compiled Code)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(Compiled Code)
    at InventoryImpl_Stub.getSecurityUsers(Unknown Source)
    at InventoryClient.<init>(Compiled Code)
    at InventoryClient.main(InventoryClient.java:62)
 
 

njon...@my-deja.com

unread,
Aug 22, 2000, 3:00:00 AM8/22/00
to
"Bobby_X" <jbl...@advancedsolutionsinc.com> wrote:

> Is it possible to return a java.sql.ResultSet object via RMI?

Not with the JDBC stuff that is shipped with the latest version of
Java (JDK 1.3) because ResultSet is not serializable and that is one of
the requirements for passing an object via RMI.

>but I keep getting a security violation =


> when the client calls the method to return the ResultSet.
> I am using Java 2 and get the following exception.

> Caught exception =3D java.security.AccessControlException: access
denied =

This is unrelated to your ResultSet problem. You are running up
against the new Java2 security system. Your client is running with an
RMISecurityManager set and the current security policy (most likely the
default) does not allow the operation you were trying to perform
(reading a property value). All RMI clients run under a security
manager to protect them from any mobile code they might download. The
security defaults are very restrictive -- pretty much the same
restrictions that a browser would place on an applet. Read this to
learn how to set a security policy:
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBo
ok/appA.html.

The usual practice would be for you to create a ".java.policy" file in
your "java.home" directory to grant the necessary permissions. Sun
provides a "policytool" for editing these files, but I don't know much
about its use.


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages