cancel
Showing results for 
Search instead for 
Did you mean: 

jcr-rmi: RemoteRepositoryException

tak
Champ in-the-making
Champ in-the-making
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ã
1 REPLY 1

tak
Champ in-the-making
Champ in-the-making
http://forums.alfresco.com/viewtopic.php?t=488&start=45&sid=0e55c71623d685d2709089537d0ae57b

it is the same situation as above.
Sorry for double posting.


my testing environment is alfresco community network 2.1RC on both OSX and WinXP.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.