Hi, On Tue, Jan 27, 2009 at 4:35 AM, MARTINEZ Antonio <[email protected]> wrote: >> When starting jackrabbit I'm getting an error Caused by: > java.lang.ClassNotFoundException: >> org.apache.jackrabbit.rmi.server.ServerRepository_Stub > > Apparently this issue was flagged already in this thread > http://www.mail-archive.com/[email protected]/msg03635 > .html, and we get this exception if the rmiservice is started outside > the servlet code.
You're right. The problem is that the standalone server does not by default expose the JCR-RMI classes as downloadable resources, so the rmiregistry is unable to instantiate the server stub. You can work around this issue by either adding the jcr, jackrabbit-api and jackrabbit-jcr-rmi jars to the rmiregistry classpath, or by pointing the java.rmi.server.codebase system property to those jars when starting the standalone server. > It looks to me that JackrabbitRepositoryServlet should start the > rmiregistry (as RepositoryStartupServlet was doing). Any particular > reason why that is not done ? The reason why I chose not to automatically start the RMI registry from within the standalone server is that clients can just as well access the RMI stub directly over HTTP from http://localhost:8080/rmi without needing the registry for anything (see the URLRemoteRepositoryServlet class as an example client.) This takes one moving piece out of the deployment and avoids tricky problems when the server already has an RMI registry (or another Jackrabbit server!) running. The standalone server still tries to bind itself to the RMI registry, but emits only a warning (with the stack trace you saw) when the registry is not available or the classpath or codebase isn't set up. BR, Jukka Zitting
