AnsweredAssumed Answered

jcr-rmi: RemoteRepositoryException

Question asked by tak on Jul 18, 2007
Latest reply on Jul 22, 2007 by tak
Hi,

The Exception occured when
I coded sample program connecting alfresco by jcr-rmi extension.
However sometimes exception occurs the other time program is normally executed.
Anyone can tell me why?

stacktrace:
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: Error unmarshaling return; nested exception is: 
   java.lang.ClassNotFoundException: net.sf.acegisecurity.AuthenticationCredentialsNotFoundException (no security manager: RMI class loader disabled): Error unmarshaling return; nested exception is:
   java.lang.ClassNotFoundException: net.sf.acegisecurity.AuthenticationCredentialsNotFoundException (no security manager: RMI class loader disabled)
   at org.apache.jackrabbit.rmi.client.ClientProperty.getValue(ClientProperty.java:139)
   at sample.FirstJCRClient.showNodeInfo(FirstJCRClient.java:118)
   at sample.FirstJCRClient.main(FirstJCRClient.java:79)

sample program is just like below.


package sample;

import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.util.Properties;

import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.jcr.Value;
import javax.jcr.nodetype.PropertyDefinition;

import org.apache.jackrabbit.rmi.client.ClientAdapterFactory;
import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
import org.apache.jackrabbit.rmi.remote.RemoteRepository;

public final class FirstJCRClient {

   /**
    * @param args
    */
   public static void main(String[] args) {
      // TODO Auto-generated method stub
        /* define locals */
         String vRmiRegistryLocation = null;
         Object vRemoteObjectReference = null;
         Repository vJcrRepository = null;
         LocalAdapterFactory vLocalAdapterFactory = null;
         Session vJcrSession = null;
         Node vJcrNode = null;
         String vRmiServerName = null;
         String vRmiServerPort = null;
         String vRmiBindingName = null;
         //Properties vJcrRmiProperties = null;
        
         try
         {

            /* intitalize */
            //vJcrRmiProperties = new Properties();
            vLocalAdapterFactory = new ClientAdapterFactory();
            //vJcrRmiProperties.load(FirstJCRClient.class.getClassLoader().getResourceAsStream("/jcr-rmi.properties"));
        
            /* get command line argments for connection parameters */
            //vRmiServerName = vJcrRmiProperties.getProperty("rmi.jcr.binding.servername");
            vRmiServerName = "localhost";
//          vRmiServerPort = vJcrRmiProperties.getProperty("rmi.jcr.binding.port");
            vRmiServerPort = "1099";
            //vRmiBindingName = vJcrRmiProperties.getProperty("rmi.jcr.binding.name");
            vRmiBindingName = "javaContentRepository";

            vRmiRegistryLocation  = "rmi://"+vRmiServerName;
            vRmiRegistryLocation += ":"+vRmiServerPort;
            vRmiRegistryLocation += "/"+vRmiBindingName;

            java.io.PrintStream out = System.out;
            out.println("looking up remote reference at ["+vRmiRegistryLocation+"]</br>");

            //System.setSecurityManager(new RMISecurityManager());
            vRemoteObjectReference = Naming.lookup(vRmiRegistryLocation);
           
            // access content
            out.println("creating local adapter for remotereference ["+vRemoteObjectReference+"]</br>");
            vJcrRepository = vLocalAdapterFactory.getRepository((RemoteRepository)vRemoteObjectReference);
           
            out.println("logging in as admin admin to default workspace</br>");
            vJcrSession = vJcrRepository.login(new SimpleCredentials("admin", "admin".toCharArray()));

            out.println("looking up workspace root node</br>");
            vJcrNode = vJcrSession.getRootNode();
           
            //propertyã

Outcomes