Protege & Java RMI Issues - Help Please!

Post Reply
GW
Posts: 2
Joined: 12 Aug 2010, 09:43

Hi All,

I've been trying to set up essential in a multi-user setup for the last week and am stumped! I've installed Protege 3.4.4 and the latest version of essential, created and moved the project onto the mySQL backend using the migrate project function, created a service to auto-start the protege app, but still can't get the actual protege server to start!

Executing the run_protege_server.bat file gives me the below error message:

Code: Select all

Protege server is starting...
Protege 3.4.4 Build 579, JVM 1.6.0_20-b02, memory=506M, Windows 2003, encoding=U
TF-8, language=en, country=GB
Server port = 5200, registry port = 5100, compressed stream
Save interval sec=300
Using metaproject from: file:/D:/Program%20Files/Protege_3.4.4/examples/server/m
etaproject.pprj
SEVERE: java.rmi.ConnectException: Connection refused to host: 10.32.5.81; nested exception is:
        java.net.ConnectException: Connection refused: connect
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
        at sun.rmi.server.UnicastRef.newCall(Unknown Source)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at edu.stanford.smi.protege.server.Server.bindName(Unknown Source)
        at edu.stanford.smi.protege.server.Server.initialize(Unknown Source)
        at edu.stanford.smi.protege.server.Server.<init>(Unknown Source)
        at edu.stanford.smi.protege.server.Server.startServer(Unknown Source)
        at edu.stanford.smi.protege.server.Server.main(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
        ... 10 more
 -- Server.bindName()
SEVERE: server startup failed -- java.rmi.ConnectException: Connection refused t
o host: 10.32.5.81; nested exception is:
        java.net.ConnectException: Connection refused: connect
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
        at sun.rmi.server.UnicastRef.newCall(Unknown Source)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at edu.stanford.smi.protege.server.Server.bindName(Unknown Source)
        at edu.stanford.smi.protege.server.Server.initialize(Unknown Source)
        at edu.stanford.smi.protege.server.Server.<init>(Unknown Source)
        at edu.stanford.smi.protege.server.Server.startServer(Unknown Source)
        at edu.stanford.smi.protege.server.Server.main(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
        ... 10 more
executing the RMI executable directly, explicitly refferencing the RMI port 1099 gives me the below:

Code: Select all

C:\Program Files\Java\jre6\bin>rmiregistry 1099
java.rmi.server.ExportException: Port already in use: 1099; nested exception is:

        java.net.BindException: Address already in use: JVM_Bind
        at sun.rmi.transport.tcp.TCPTransport.listen(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
        at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
        at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
        at sun.rmi.registry.RegistryImpl.setup(Unknown Source)
        at sun.rmi.registry.RegistryImpl.<init>(Unknown Source)
        at sun.rmi.registry.RegistryImpl.main(Unknown Source)
Caused by: java.net.BindException: Address already in use: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(Unk
nown Source)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unk
nown Source)
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source)
        ... 8 more
What is really strange is that I cannot telnet to port 1099, meaning that there is nothing listening on that port.

The question I have is is there anyway to change the default port which is used for rmi when the protege run_protege_server is used? I've tried stating a differing port in the run_protege_server.bat:

Code: Select all

start /D %JDKBIN% /min rmiregistry.exe 1100
where 1100 is the new port number, but I still get an identical error message. Executing the rmi executable from the command line with the 5100 and 5200 ports listed in the run_protege_server.bat file does work and I can telnet successfully. Is this a logical fault analysis or am I completely off tangent here?!

Any help greatly appreciated! :)

Cheers,

Gary
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Gary,

I've just managed to replicate your second exception message. I thought I'd seen this before and I believe it is simply down to the fact that RMIRegistry is already running.

I just started my Protege Server, stopped it and re-ran run_protege_server.bat

The first start up completed without any exceptions, however, the second reported the following exception:
java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
...
This is because the run_protege_server script also kicks off RMIRegistry while shutdown_protege_server makes no attempt to stop the RMIRegistry process. Once you've stopped your Protege Server, you can find the RMIRegistry process in Task Manager (or equivalent for your platform) and safely stop it.

It is worth noting that making multiple calls to run_protege_server WITHOUT stopping RMIRegistry before each time is safe - the exception is reported during start up but the server will start up properly. Look out for the following message from the server to be sure that it has started correctly.
Protege server ready to accept connections...
I'm not sure I've seen your other exception message before and am wondering if it's related to a failed start of RMIRegistry, or because the Protege Server cannot connect to the RMIRegistry because it is no longer listening on the default port? One thing to note is that RMIRegistry should start on the default port - I'm pretty sure that the Protege Server expects this. Those 2 alternative port numbers that are options that are commented out in the start up should not be required.

Looking again at the finer details of your exception messages your 1st one is being raised when you try to connect to RMIRegistry running on port 5100 and you tried this after you had been receiving the 2nd exception from RMIRegistry?

Try the following:
- Return the run_protege_server.bat back to the original state (re-comment out those PORTOPTS)
- Find the RMIRegistry process and stop it
- Ensure that all the configuration is back to default/original
- Run run_protege_server.bat

Ignore any 'port already in use' (there shouldn't be if you've stopped RMIRegistry) exceptions and make sure that the server starts correctly.

Let me know exactly what happens when you try with all the default ports.

Thanks

Jonathan
Essential Project Team
GW
Posts: 2
Joined: 12 Aug 2010, 09:43

Hi Johnathan,

Many thanks for the prompt reply! Followed your instructions and still had issues starting up the server, even after I was sure that the rmi service wasn't running in task manager. Did the usual IT final trick and rebooted and it's started up without issue! Looks like the on/off trick still works a treat!

Cheers for your help!

Gary
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Great to hear that you got it going. Shame it had to be via a reboot!

Keep me posted as to how you get on. Could it be that there was some rogue process interfering with the RMI ports?

Also, did you manage to find the RMIRegistry process in Task Manager and make sure it was killed before trying to start the server? It could be that you had a couple of them running on different ports or something like that. Certainly the reboot would have got rid of them.

As I mentioned before, the server should start just fine even if the RMIRegistry start reports the "port in already in use" exception, and normally you can safely ignore that exception.

Jonathan
Essential Project Team
Post Reply