B
brent5282
Need to load an RMI class from a jar on the local filesystem. With
Update 10, this is becoming nearly impossible, for some odd reason,
with code which has always worked.
I don't want to edit the java policy file on my deployment systems,
and I am also running under Java Web Start.
After running standalone and getting rid of Web Start, I get the same
error. Exception when trying to read the class from the jar file.
Don't wanna put the classes on the net at the codebase for Java Web
Start, because everything has to run standalone detached from the
network.
All of this worked on Java 6 Update 5 but it craps out with Update 10
and I have to find a way to make it work.
The stack trace indicates that I'm stopped on a simple
java.io.FilePermission. I've written and installed a subclass of
RMISecurityManager which permits everything I can think of. However,
from the stack trace looks like it calls checkRead and then goes
further. Is this a different security manager, other than the one I
have over-ridden? Is there more than 1 security manager in an
application?
I would assume it would hit my checkRead and my checkRead does NOT
call anything else, so not sure exactly what is going on here.
HOW can I allow this jar file to be read? If it can be read, then I
think the class can be loaded which is relevant to the RMI
implementation and everything should work.
-Djava.rmi.server.codebase=file://./sZoneTrader.jar <-- that's the
property and protocol I'm using to get it to the file, and it appears
the file exists, just can't be read.
ERR: 08.11.15 09:44:07.094: java.security.AccessControlException:
access denied (java.io.FilePermission \\.\sZoneTrader.jar read)
java.security.AccessControlException: access denied
(java.io.FilePermission \\.\sZoneTrader.jar read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.exists(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at sun.rmi.server.LoaderHandler.addPermissionsForURLs(Unknown Source)
at sun.rmi.server.LoaderHandler.access$300(Unknown Source)
at sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
at sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
at sun.rmi.server.LoaderHandler$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.server.LoaderHandler.lookupLoader(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown
Source)
at java.ibjectInputStream.readProxyDesc(Unknown Source)
at java.ibjectInputStream.readClassDesc(Unknown Source)
at java.ibjectInputStream.readOrdinaryObject(Unknown Source)
at java.ibjectInputStream.readObject0(Unknown Source)
at java.ibjectInputStream.readObject(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown
Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at com.twc.trader.ZoneTrader.<init>(Unknown Source)
at com.twc.trader.ZoneTrader.createAndShowGUI(Unknown Source)
at com.twc.trader.ZoneTrader.access$4(Unknown Source)
at com.twc.trader.ZoneTrader$95.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
OUT: 08.11.15 09:44:07.094: RemoteIndicatorServiceImpl Naming.rebind
FAILURE.
Update 10, this is becoming nearly impossible, for some odd reason,
with code which has always worked.
I don't want to edit the java policy file on my deployment systems,
and I am also running under Java Web Start.
After running standalone and getting rid of Web Start, I get the same
error. Exception when trying to read the class from the jar file.
Don't wanna put the classes on the net at the codebase for Java Web
Start, because everything has to run standalone detached from the
network.
All of this worked on Java 6 Update 5 but it craps out with Update 10
and I have to find a way to make it work.
The stack trace indicates that I'm stopped on a simple
java.io.FilePermission. I've written and installed a subclass of
RMISecurityManager which permits everything I can think of. However,
from the stack trace looks like it calls checkRead and then goes
further. Is this a different security manager, other than the one I
have over-ridden? Is there more than 1 security manager in an
application?
I would assume it would hit my checkRead and my checkRead does NOT
call anything else, so not sure exactly what is going on here.
HOW can I allow this jar file to be read? If it can be read, then I
think the class can be loaded which is relevant to the RMI
implementation and everything should work.
-Djava.rmi.server.codebase=file://./sZoneTrader.jar <-- that's the
property and protocol I'm using to get it to the file, and it appears
the file exists, just can't be read.
ERR: 08.11.15 09:44:07.094: java.security.AccessControlException:
access denied (java.io.FilePermission \\.\sZoneTrader.jar read)
java.security.AccessControlException: access denied
(java.io.FilePermission \\.\sZoneTrader.jar read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.exists(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at sun.rmi.server.LoaderHandler.addPermissionsForURLs(Unknown Source)
at sun.rmi.server.LoaderHandler.access$300(Unknown Source)
at sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
at sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
at sun.rmi.server.LoaderHandler$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.server.LoaderHandler.lookupLoader(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown
Source)
at java.ibjectInputStream.readProxyDesc(Unknown Source)
at java.ibjectInputStream.readClassDesc(Unknown Source)
at java.ibjectInputStream.readOrdinaryObject(Unknown Source)
at java.ibjectInputStream.readObject0(Unknown Source)
at java.ibjectInputStream.readObject(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown
Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at com.twc.trader.ZoneTrader.<init>(Unknown Source)
at com.twc.trader.ZoneTrader.createAndShowGUI(Unknown Source)
at com.twc.trader.ZoneTrader.access$4(Unknown Source)
at com.twc.trader.ZoneTrader$95.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
OUT: 08.11.15 09:44:07.094: RemoteIndicatorServiceImpl Naming.rebind
FAILURE.