Multi-User-Error Ubuntu

Post Reply
lmersich
Posts: 1
Joined: 07 Apr 2021, 11:32

Hello everyone,

I have encountered an error with my Protege server installation on ubuntu server. The run_protege_server.sh script throws an exception(see below) when executing which seems to be a problem involving the RMI and or the protege.jar file / filepath.

After googling the exception and reading this
https://protegewiki.stanford.edu/wiki/T ... onnections
official wiki post about "common UnmarshalExceptions" I've followed their instuctions under "Versioning Problems and UnmarshalExceptions". I've set the CODEBASE_URL system variable to the absolute path rather than using $PWD. (with "export" cmd because "set" is windows only)

This still causes the same exception to occur.
I've also attached the run_protege_server.sh script below.

The exception is as follows:

---------- Exception ----------
SEVERE: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:389)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:380)
at sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:158)
at edu.stanford.smi.protege.server.Server.bindName(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.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:157)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:469)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:301)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1221)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:453)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:219)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1986)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1850)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2160)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:154)
... 14 more
-- Server.bindName()
SEVERE: server startup failed -- java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:389)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:380)
at sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:158)
at edu.stanford.smi.protege.server.Server.bindName(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.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:157)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:469)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:301)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: edu.stanford.smi.protege.server.Server_Stub
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1221)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:453)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:219)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1986)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1850)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2160)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:154)
... 14 more


---------- run_protege_server.sh script ----------
#!/bin/sh

# ------------------- Where is Java? -------------------

# Change to the script' working directory, should be the Protege root directory
cd $(dirname $0)

DARWIN="false"

if [ -x /usr/bin/uname ]
then
if [ "x`/usr/bin/uname`" = "xDarwin" ]
then
DARWIN="true"
fi
fi

if [ ${DARWIN} = "true" ]
then
JAVA_PATH=/usr/bin
else
# Attempt to use the bundled VM if none specified
if [ "$JAVA_HOME" = "" ]; then
JAVA_HOME=.
fi

JAVA_PATH=$JAVA_HOME/jre/bin
fi

# Check if the Java VM can be found
if [ ! -e $JAVA_PATH/java ]; then
echo Java VM could not be found. Please check your JAVA_HOME environment variable.
exit 1
fi
# ------------------- Where is Java? -------------------


CLASSPATH=protege.jar:looks.jar:driver.jar:driver0.jar:driver1.jar:driver2.jar
MAINCLASS=edu.stanford.smi.protege.server.Server


# ------------------- JVM Options -------------------
MAX_MEMORY=-Xmx2048M
HEADLESS=-Djava.awt.headless=true
CODEBASE_URL=file:$PWD/protege.jar
#CODEBASE_URL=http://localhost:8080/essential_viewer_test/protege.jar
CODEBASE=-Djava.rmi.server.codebase=$CODEBASE_URL
HOSTNAME_PARAM=-Djava.rmi.server.hostname=`hostname`
TX="-Dtransaction.level=READ_COMMITTED"
LOG4J_OPT="-Dlog4j.configuration=file:log4j.xml"

OPTIONS="$MAX_MEMORY $HEADLESS $CODEBASE $HOSTNAME_PARAM ${TX} ${LOG4J_OPT}"

#
# Instrumentation debug, delay simulation, etc
#
#PORTOPTS="-Dprotege.rmi.server.port=5200 -Dprotege.rmi.registry.port=5100"
#DEBUG_OPT="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

OPTIONS="${OPTIONS} ${PORTOPTS} ${DEBUG_OPT}"
# ------------------- JVM Options -------------------

# ------------------- Cmd Options -------------------
# If you want automatic saving of the project,
# setup the number of seconds in SAVE_INTERVAL_VALUE
# SAVE_INTERVAL=-saveIntervalSec=120
# ------------------- Cmd Options ------------------

METAPROJECT=/EssentialAM/Repository/metaproject.pprj

$JAVA_PATH/rmiregistry &
$JAVA_PATH/java -cp $CLASSPATH $TX $OPTIONS $MAINCLASS $SAVE_INTERVAL $METAPROJECT


Thank you for your help in advance
Lukas
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Lukas,

You have followed the Protege Team's guidelines but we found that the issue is that a file-based URI for the CODEBASE variable does not work. Therefore, I recommend that you use the http-based CODEBASE setting that is commented out in your run_protege_server.sh script:

Change:

Code: Select all

CODEBASE_URL=file:$PWD/protege.jar
#CODEBASE_URL=http://localhost:8080/essential_viewer_test/protege.jar
to:

Code: Select all

#CODEBASE_URL=file:$PWD/protege.jar
CODEBASE_URL=http://localhost:8080/essential_viewer_test/protege.jar
This means that you must copy the file "protege.jar" into the root of your Essential Viewer application and have the Tomcat server for your viewer running.
NOTE: the above example assumes that your Viewer is called "essential_viewer_test" and that there is a directory with that name in the <TOMCAT INSTALL>/webapps directory.

In addition to this, have a look at this forum post, which recommends checking that the java.rmi.server.useCodebaseOnly=false setting has been made in run_protege_server.sh. If you start seeing a ClassNotFoundException instead of the Server_Stub exception, then it's worth looking at.

Let me know how you get on!

Jonathan
Essential Project Team
Post Reply