NullPointerException in invokeLater while running through Java Webstart

I found what I believe to be a better solution to this bug. I just added the following code before calling SwingUtilities or any Swing related component method. It create a new AppContext for the RMI Thread (RMI thread must be the current Thread when running the code below). if(AppContext.getAppContext() == null){ SunToolkit.createNewAppContext(); } Due … Read more

java.rmi.NoSuchObjectException: no such object in table

Keep a strong reference to the object that implements the java.rmi.Remote interface so that it remains reachable, i.e. ineligible for garbage collection. Below is a short program that demonstrates a java.rmi.NoSuchObjectException. The script is self-contained, creating an RMI registry as well as a “client” and a “server” in a single JVM. Simply copy this code … Read more

Why Java opens 3 ports when JMX is configured?

Contrary to common belief JMX/RMI doesn’t need to open all these ports. You can actually force them to be same which will mean that at the end of the day you’ll only need to punch one hole in the firewall (if firewall is your concern). Try setting System Properties: com.sun.management.jmxremote.port com.sun.management.jmxremote.rmi.port to the same value!! … Read more

java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException)

There are four cases of this exception. When exporting: you didn’t run ‘rmic’ and you didn’t take the steps described in the preamble to the Javadoc for UnicastRemoteObject to make it unnecessary. When binding: the Registry doesn’t have the stub or the remote interface or something they depend on on its classpath. when looking up: … Read more

tech