File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes RMI broken after Ubuntu server upgrade Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI broken after Ubuntu server upgrade" Watch "RMI broken after Ubuntu server upgrade" New topic
Author

RMI broken after Ubuntu server upgrade

Matthew Fleming
Greenhorn

Joined: Oct 29, 2009
Posts: 8
I've been using two applets with RMI for several years now. Everything was working fine, until I updated my Ubuntu server, which seems to have changed some sort of security policy, and now they don't work. There are two applets which are downloaded from a server and then connect back to the server via RMI. They talk to two RMI servers which are started like this:

rmiregistry &
java -Xmx512m -classpath dermpathApplet.jar:ilm.jar:mail.jar:activation.jar:mysql-connector-java-5.1.7-bin.jar -Djava.rmi.server.codebase=file:///var/www/regular/htdocs/dermpathApplet.jar -Djava.rmi.server.hostname=98.103.241.186 com.edermpath.dermpath_client.DPAppletServer &
java -classpath ilm.jar:mysql-connector-java-5.1.7-bin.jar -Djava.rmi.server.codebase=file:///var/www/regular/htdocs/ilm.jar -Djava.rmi.server.hostname=98.103.241.186 immunolabmanager.ILMServer &

This used to work fine but now I get the following:
java.lang.NullPointerException
at sun.security.provider.PolicyFile$PolicyInfo.<init>(PolicyFile.java:2491)
at sun.security.provider.PolicyFile.init(PolicyFile.java:468)
at sun.security.provider.PolicyFile.<init>(PolicyFile.java:327)
at java.security.Policy.getPolicyNoCheck(Policy.java:189)
at java.security.Policy.getPolicy(Policy.java:152)
at sun.rmi.server.LoaderHandler$2.run(LoaderHandler.java:992)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.server.LoaderHandler.getLoaderAccessControlContext(LoaderHandler.java:986)
at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java:878)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:562)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1548)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1510)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:403)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at immunolabmanager.ILMServer.main(ILMServer.java:28)
and the same error for the other server.
I tried changing to this:
java -Xmx512m -classpath dermpathApplet.jar:ilm.jar:mail.jar:activation.jar:mysql-connector-java-5.1.7-bin.jar -Djava.rmi.server.codebase=file:///var/www/regular/htdocs/dermpathApplet.jar -Djava.rmi.server.hostname=98.103.241.186 com.edermpath.dermpath_client.DPAppletServer -Djava.security.policy=policy.file &
with the following in policy.file:
grant codeBase = "file:///var/www/regular/htdocs/*" {
permission java.security.AllPermission;
}
But this did not help.

The applets are signed. I've never had this kind of problem before and don't know how to fix it. These applets are essential to my business. I'd really, really appreciate some help.
TIA,

Matthew Fleming, MD
Fleming Dermatopathology
Mike Peters
Ranch Hand

Joined: Oct 10, 2009
Posts: 67

Your problem might be related to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6895411


Mike Peters
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI broken after Ubuntu server upgrade
 
Similar Threads
cant run java file from command line but works with .sh file??
HFJ - RMI issues.
Eclipse wont run my RMI program?
no security manager: RMI class loader disabled
Classpath Issue