cancel
Showing results for 
Search instead for 
Did you mean: 

JCR-RMI NOT A SOLUTION FOR THE MOMENT!

rdanner
Champ in-the-making
Champ in-the-making
Well we've been looking closer at JCR-RMI and at the moment its entirely busted.  As Lennard points out, due to the Thread Local strategy behind security and the JCR Session and the fact that the RMI server can run your remote object in whatever thread it wants you are very likely to have problems just using the Jackrabbit extension to use remote the JCR implementation. So don't waste any time messing with it.

I didn't see this problem back when I was playing with JCR/RMI because I was using the interface in very small conversations and under no real load.

We're going to try and work around the issue by managing threads on the server side and binding remote objects to the server side threads. 

I think the workaround has serious limitations like the number of open sessions (because it is directly related to the number of managed threads on the server side.)

If we get something working it will be posted here.  If you have thoughts on how to work around the issue please post them!
16 REPLIES 16

rdanner
Champ in-the-making
Champ in-the-making
Well we've been looking closer at JCR-RMI and at the moment its entirely busted.

The reason why JCR-RMI doesn't work was somewhat misdiagnosed.  Yes it is related to the fact that RMI uses and reuses threads and there is nothing that ensures affinity of a remote object to a thread ….

BUT:  Looking at the code Alfresco creates a dynamic proxy on its JCR implementations that are intended to make sure the executing thread is "setup" for that call.   The code seems to have bugs in that it doesn't actually work in a remote context but the intention is clearly there.

Short term: we are testing a patch that should work and we'll get back to you if you are using JCR-RMI.  It's very easy to put the patch in place.

Long term: this problem can be fixed in the Alfresco JCR code itself and we just need to get some JIRA tickets in place.   I'll take care of that some time today.

legolas
Champ in-the-making
Champ in-the-making
Hi Russ,

Short term: we are testing a patch that should work and we'll get back to you if you are using JCR-RMI.  It's very easy to put the patch in place.

Can you update me about the status of this patch?
We need to remotely connect to alfresco.

Thanks in advance.

Marcel.

lfuller
Champ in-the-making
Champ in-the-making
Russ and I worked on this issue for a while, unfortunately attempts to correct Alfresco itself proved to be fruitless.  I'm not saying that it can not be fixed, just that our attempts to fix it didn't yield anything usable.  We ended up going with a plan b, which is currently being called extension-jcr-thread-bound.  This adds a layer in between JCR-RMI and Alfresco.  The added layer ensures that ALL of a user's jcr session interactions are handled by the same thread.  Thus far the added layer has proven to be functionally solid and sufficiently performant (Please note my application has a great deal of caching on the client side).

For more information on jcr-thread-bound has been added as an additional release for

http://forge.alfresco.com/projects/jcr-rmi/

geraud
Champ in-the-making
Champ in-the-making
Thanks for your work.
I've installed jcr-thread-bound. And now I can browse the Alfresco repository from my Lutèce instance which is installed on a different Tomcat server.
But some nodes cannot be retrieved, and the following exception is raised:

18/09/07 18:45:38 ERROR [http-8081-Processor25] lutece.error - java.lang.reflect.UndeclaredThrowableException
java.lang.reflect.UndeclaredThrowableException
   at $Proxy90.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
   at sun.rmi.transport.Transport$1.run(Transport.java:153)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
   at java.lang.Thread.run(Thread.java:595)
   at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
   at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
   at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
   at org.apache.jackrabbit.rmi.server.ServerNode_Stub.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.client.ClientNode.getMixinNodeTypes(ClientNode.java:356)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.isVersionnable(AbstractRepositoryContentDAO.java:613)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.nodeToRepositoryFile(AbstractRepositoryContentDAO.java:432)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.access$4(AbstractRepositoryContentDAO.java:428)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO$5.doInJcr(AbstractRepositoryContentDAO.java:240)
   at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
   at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:108)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO.execute(AbstractRepositoryDAO.java:139)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.findById(AbstractRepositoryContentDAO.java:221)
   at fr.paris.lutece.plugins.jcr.business.RepositoryFileHome$1.run(RepositoryFileHome.java:166)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAs(Subject.java:337)
   at fr.paris.lutece.plugins.jcr.authentication.JcrRestrictedOperation.doRestrictedOperation(JcrRestrictedOperation.java:85)
   at fr.paris.lutece.plugins.jcr.business.RepositoryFileHome.getRepositoryFileById(RepositoryFileHome.java:160)
   at fr.paris.lutece.plugins.jcr.business.portlet.Jsr170Portlet.getXml(Jsr170Portlet.java:208)
   at fr.paris.lutece.portal.service.page.PageService.getPageContent(PageService.java:437)
   at fr.paris.lutece.portal.service.page.PageService.buildPageContent(PageService.java:340)
   at fr.paris.lutece.portal.service.page.PageService.getPage(PageService.java:237)
   at fr.paris.lutece.portal.service.page.PageService.getPage(PageService.java:180)
   at fr.paris.lutece.portal.web.PortalJspBean.getContent(PortalJspBean.java:134)
   at fr.paris.lutece.portal.web.PortalJspBean.getContent(PortalJspBean.java:86)
   at org.apache.jsp.jsp.site.Portal_jsp._jspService(Portal_jsp.java:82)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.upload.UploadFilter.doFilter(UploadFilter.java:143)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.upload.DosGuardFilter.doFilter(DosGuardFilter.java:134)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.encoding.EncodingFilter.doFilter(EncodingFilter.java:70)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.thread.DispatchException: error on dispatched method [getMixinNodeTypes] threw exception [java.lang.reflect.InvocationTargetException]
   at org.alfresco.thread.WorkerThreadManager.execute(WorkerThreadManager.java:105)
   at org.alfresco.thread.ThreadBoundInvocationHandler.invoke(ThreadBoundInvocationHandler.java:270)
   at $Proxy90.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
   at sun.rmi.transport.Transport$1.run(Transport.java:153)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
   … 1 more

It seems that the problem comes from the getMixinNodeTypes method. I use this method to check if a node (cm:content) is versionable.

Have you ever seen this problem before?

Another question: what is the better way to report such problems? on this forum or on forge.alfresco.com ?


Géraud

rdanner
Champ in-the-making
Champ in-the-making
Thanks for your work.
I've installed jcr-thread-bound. And now I can browse the Alfresco repository from my Lutèce instance which is installed on a different Tomcat server.
But some nodes cannot be retrieved, and the following exception is raised:

18/09/07 18:45:38 ERROR [http-8081-Processor25] lutece.error - java.lang.reflect.UndeclaredThrowableException
java.lang.reflect.UndeclaredThrowableException
   at $Proxy90.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
   at sun.rmi.transport.Transport$1.run(Transport.java:153)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
   at java.lang.Thread.run(Thread.java:595)
   at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
   at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
   at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
   at org.apache.jackrabbit.rmi.server.ServerNode_Stub.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.client.ClientNode.getMixinNodeTypes(ClientNode.java:356)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.isVersionnable(AbstractRepositoryContentDAO.java:613)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.nodeToRepositoryFile(AbstractRepositoryContentDAO.java:432)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.access$4(AbstractRepositoryContentDAO.java:428)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO$5.doInJcr(AbstractRepositoryContentDAO.java:240)
   at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
   at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:108)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO.execute(AbstractRepositoryDAO.java:139)
   at fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO.findById(AbstractRepositoryContentDAO.java:221)
   at fr.paris.lutece.plugins.jcr.business.RepositoryFileHome$1.run(RepositoryFileHome.java:166)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAs(Subject.java:337)
   at fr.paris.lutece.plugins.jcr.authentication.JcrRestrictedOperation.doRestrictedOperation(JcrRestrictedOperation.java:85)
   at fr.paris.lutece.plugins.jcr.business.RepositoryFileHome.getRepositoryFileById(RepositoryFileHome.java:160)
   at fr.paris.lutece.plugins.jcr.business.portlet.Jsr170Portlet.getXml(Jsr170Portlet.java:208)
   at fr.paris.lutece.portal.service.page.PageService.getPageContent(PageService.java:437)
   at fr.paris.lutece.portal.service.page.PageService.buildPageContent(PageService.java:340)
   at fr.paris.lutece.portal.service.page.PageService.getPage(PageService.java:237)
   at fr.paris.lutece.portal.service.page.PageService.getPage(PageService.java:180)
   at fr.paris.lutece.portal.web.PortalJspBean.getContent(PortalJspBean.java:134)
   at fr.paris.lutece.portal.web.PortalJspBean.getContent(PortalJspBean.java:86)
   at org.apache.jsp.jsp.site.Portal_jsp._jspService(Portal_jsp.java:82)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.upload.UploadFilter.doFilter(UploadFilter.java:143)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.upload.DosGuardFilter.doFilter(DosGuardFilter.java:134)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at fr.paris.lutece.portal.web.encoding.EncodingFilter.doFilter(EncodingFilter.java:70)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.thread.DispatchException: error on dispatched method [getMixinNodeTypes] threw exception [java.lang.reflect.InvocationTargetException]
   at org.alfresco.thread.WorkerThreadManager.execute(WorkerThreadManager.java:105)
   at org.alfresco.thread.ThreadBoundInvocationHandler.invoke(ThreadBoundInvocationHandler.java:270)
   at $Proxy90.getMixinNodeTypes(Unknown Source)
   at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
   at sun.rmi.transport.Transport$1.run(Transport.java:153)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
   … 1 more

It seems that the problem comes from the getMixinNodeTypes method. I use this method to check if a node (cm:content) is versionable.

Have you ever seen this problem before?

Another question: what is the better way to report such problems? on this forum or on forge.alfresco.com ?


Géraud

Nope, this is the best way to report the issue – unfortunately the error is being swallowed by the reflections API (That is a convenient way of passing the buck because we were lazy with handling the exceptions and didn't catch and unwrap the exception to expose the underlying cause.)

I'll see if I can't modify the code and then get you to report the real issue.

rdanner
Champ in-the-making
Champ in-the-making
This exception is being emitted from WorkerThreadManager because something below it is blowing up but we cant see as I mentioned before because the exception it's throwing is a wrapper. 

The method execute should be replaced with:

   /**
     * Requests WorkerThread associated with threadKey execute the dispatched
     * method, using dispatched parameters, against the target object
     *
     * @param threadKey
     *            key associated with worker thread
     * @param target
     *            target object against which dispatched method with dispatched
     *            params should be ran.
     * @param dispatchedMethod method which should be ran against target object
     * @param dispatchedParams params which should be used when running method.
     * @return result of method execution.
     * @throws Exception
     */
   public static Object execute(String threadKey, Object target,
         Method dispatchedMethod, Object[] dispatchedParams)
         throws Exception {
      if (threadKey == null && target == null && dispatchedMethod == null) {
         throw new IllegalArgumentException(
               "threadKey, target and the dispatchedMethod must not be null");
      }
      WorkerThread worker = threadMap.get(threadKey);

      if (worker == null) {
         throw new DispatchException("No WorkerThread created for ["+ threadKey +"], errored on dispatched method ["+dispatchedMethod.getName()+"]");
      }
      Object response;

      Exchanger exchanger = new Exchanger();
      worker.execute(dispatchedMethod, dispatchedParams, target, exchanger);

      response = exchanger.exchange(new Object());
      
        if (response instanceof Throwable) {
         
         if(response instanceof InvocationTargetException)
         {
            /* unwrap target exception */
            
            Exception eActualException = ((InvocationTargetException)response).getCause();
            
            throw new DispatchException("error on dispatched method ["+dispatchedMethod.getName()+"] threw exception ["+eActualException+"]");
         }
         else
         {
            throw new DispatchException("error on dispatched method ["+dispatchedMethod.getName()+"] threw exception ["+response+"]");
         }
         
      }

      return response;
   }

This won't solve your problem but it will tell you what the actual problem is or at the very least get you one step closer to the real problem (I don't know maybe you will encounter another wrapped exception – there are a number of wrappers and dynamic proxies at play here)

I don't have time to compile, test and build this – it's almost 5am here and I've been up since 8am yesterday – gotta run.  I'll commit the change.  If you don't have an extension environment or the source base maybe Lennard can fix my syntax errors and hook you up.  Smiley Very Happy

Good luck!
-R

geraud
Champ in-the-making
Champ in-the-making
Hi,

I tried this code on another installation (I worked with another machine this week). I had to change the type of eActualException to Throwable, otherwise it didn't compile.

Now the following exception is thrown by the client :

java.lang.ClassCastException: $Proxy87
        at $Proxy86.getMixinNodeTypes(Unknown Source)
        at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)

No exception is thrown on the server(alfresco)-side. I am not sure that this is the same problem… maybe it is due to a wrong config.
I'll take a closer look during the next week.

Thanks again!


Géraud

finner
Champ in-the-making
Champ in-the-making
Hi,
What is the current official status of connecting to Alfresco via jackrabbit-jcr-rmi ? I went through the wiki for setting up the extension and I can login to Alfresco. The jsp/jcrRmiTest.jsp is also working. But  when I do something like

rootNode.getNodes()

I get an UnMarshalling exception
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: RemoteException occurred in server thread; nested exception is:
   java.rmi.UnmarshalException: invalid method hash: RemoteException occurred in server thread; nested exception is:
   java.rmi.UnmarshalException: invalid method hash

Then I came across this post so as a general question :

Can I continue with the jackrabbit-jcr-rmi extension? Is it a stable/production strength solution ?

We need to build a suite of services that connect to Alfresco (or any repo) and the solution we are looking at is with jackrabbit-jcr-rmi.

Thanks in advance for any advice on this!!
Finner

rdanner
Champ in-the-making
Champ in-the-making
Hi,
What is the current official status of connecting to Alfresco via jackrabbit-jcr-rmi ? I went through the wiki for setting up the extension and I can login to Alfresco. The jsp/jcrRmiTest.jsp is also working. But  when I do something like

rootNode.getNodes()

I get an UnMarshalling exception
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: RemoteException occurred in server thread; nested exception is:
   java.rmi.UnmarshalException: invalid method hash: RemoteException occurred in server thread; nested exception is:
   java.rmi.UnmarshalException: invalid method hash

Then I came across this post so as a general question :

Can I continue with the jackrabbit-jcr-rmi extension? Is it a stable/production strength solution ?

We need to build a suite of services that connect to Alfresco (or any repo) and the solution we are looking at is with jackrabbit-jcr-rmi.

Thanks in advance for any advice on this!!
Finner

Officially it is not supported (by Alfresco Inc)  There are issues with using the RMI implementation natively with alfresco but there is a work around were objects are bound to a server side thread.  The solution works but there is a limit to scalability.

The exception you are getting happens when :

if an exception occurs while unmarshalling the call header

if the protocol for the return value is invalid

if a java.io.IOException occurs unmarshalling parameters (on the server side) or the return value (on the client side).

if a java.lang.ClassNotFoundException occurs during unmarshalling parameters or return values

if no skeleton can be loaded on the server-side; note that skeletons are required in the 1.1 stub protocol, but not in the 1.2 stub protocol.

if the method hash is invalid (i.e., missing method).

if there is a failure to create a remote reference object for a remote object's stub when it is unmarshalled.


This suggests to me that you have either a missing jar or an old jar somewhere.