AnsweredAssumed Answered

javax.jcr.RepositoryException: failed to resolve path

Question asked by bindiya on Dec 6, 2006
Hi

I am new to Alfresco and trying to create standalone application to remotely access repository using Jackrabbit api.
I Get exception even though i have mentioned the relative path in file-servers.xml.

javax.jcr.RepositoryException: failed to resolve path /companyHome relative to /: relPath is not a relative path
   at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:136)
   at org.apache.jackrabbit.rmi.server.ServerNode.getNode(ServerNode.java:229)
   at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
   at sun.rmi.transport.Transport$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.Transport.serviceCall(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
   at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
   at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
   at sun.rmi.server.UnicastRef.invoke(Unknown Source)
   at org.apache.jackrabbit.rmi.server.ServerNode_Stub.getNode(Unknown Source)
   at org.apache.jackrabbit.rmi.client.ClientNode.getNode(ClientNode.java:228)
   at src.RemoteRepLogin.main(RemoteRepLogin.java:44)


Heres the code i have written

 
      public static void main(String[] args) {
          try {
ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository = null;
repository = factory.getRepository("rmi://localhost:1100/jackrabbit");
  return repository;

  repository = getRepository();
Credentials credentials = new SimpleCredentials(USERID,PASSWORD);
session = repository.login(credentials, "default");
ClientNode clientNode = (ClientNode)session.getRootNode();
System.out.println( clientNode.getNode("/companyHome"));
                   
session.logout();
//exception thrown here…
        System.out.println("Got session="+session);
    } catch (Exception e) {
                    System.out.println("Yargg - an exception.");
                    e.printStackTrace();
                }
}

Can anybody help me?

Thanks,
Bindiya

Outcomes