> Hello!
>
> I have run into problems with tomcat 4.0b5 in combination with RMI. It
works
> fine in 4.0b1, which as far as I can see did not include JNDI support. And
> the code works fine when run from comand line also. The following
backtrace
> occurs at the first RMI call:
>
> java.rmi.ServerException: RemoteException occurred in server thread;
nested
> exception is:
> java.rmi.UnmarshalException: error unmarshalling arguments; nested
> exception is:
> java.net.MalformedURLException: java.lang.NullPointerException: invalid
> url: jndi:/localhost/lentusXML/WEB-INF/lib/Business-3-1.jar!/
> (java.net.MalformedURLException: unknown protocol: jndi)
> java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception
> is:
> java.net.MalformedURLException: java.lang.NullPointerException: invalid
> url: jndi:/localhost/lentusXML/WEB-INF/lib/Business-3-1.jar!/
> (java.net.MalformedURLException: unknown protocol: jndi)
> java.net.MalformedURLException: java.lang.NullPointerException: invalid
url:
> jndi:/localhost/lentusXML/WEB-INF/lib/Business-3-1.jar!/
> (java.net.MalformedURLException: unknown protocol: jndi)
> at
>
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
> all.java:245)
> at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
> at se.lentus.lentus.server.AbstractReflectionServer_Stub.invoke(Unknown
> Source)
> at
se.lentus.lentus.serveraccess.RemoteProxy.doInvoke(RemoteProxy.java:529)
> ...
>
> To try to get rid of the JNDI usage I use the following context
definition:
>
> <Context path="/lentusXML" docBase="lentusXML" debug="10"
> useNaming="false">
> </Context>
>
> I also tried to start without naming support: catalina.sh start -nonaming
>
> Nothing of this seems to help...
I named the protocol "jndi" in the URL because it does read the resources
through a JNDI directory context. It's totally unrelated to the JNDI ENC sup
port, so the -nonaming option won't do anything.
> To be honest I don't even know why the server cares about where my servlet
> code finds the "Bysiness-3-1.jar", because it should not load anything
from
> it.
Yes, definitely.
I suppose your RMI server is VM local. (could I get more details on the
server you're using, BTW - thx)
So an "optimization" for the server in that case is to reuse the CL which
has been used to load the "remote" object class. Of course, it's cheating
!!!
If the server is not local, I don't understand how or why it would access
the URL of the repository from which the object class was loaded.
I can come up with a workaround with the current CL, but it would be a
really bad hack. Instead, I think I'll rewrite parts of the Catalina CL
which loads the webapps, and avoid extending URL clasloader (instead, it
would access the directory context directly).
> Anyway, I would be most grateful for any hints of how to solve this
> problem.
Remy