Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI broken after Ubuntu server upgrade

 
Matthew Fleming
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem might be related to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6895411
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic