2 Replies Latest reply on Dec 16, 2012 1:26 PM by aragav123

    Get java.lang.AbstractMethodError when issuing session.getRootNode()

    u005078

      Hello,

      I'm trying to run the sample from the "Writing an Application Connecting to a Remote JCR"-page (see http://dev.day.com/docs/en/crx/current/developing/accessing_jcr_connectors.html#A%2520Shor t%2520introduction%2520to%2520JCR%2520development) but still fail.

      The only relevant difference to the sample in this page is, that I'm using http-access insead of rmi.

      I thought the page might be a good starting point to get familiar to get some knowledge to access CRX. But I'm no longer sure about this. This is the second problem with my third statement trying to connect to CQ5. I probably missed something fundamental. Can you give a hint or a curriculum how to start to get some knowledge how to access crx with java?

       

      But anyway to go further, I need ot know whats wrong with my program:

      private void connectJcrUtils2() throws Exception {
              System.out.println("Start");
              //Create a connection to the Day CQ repository running on local host
              Repository repository = org.apache.jackrabbit.commons.JcrUtils.getRepository("http://localhost:4502/crx/server");
              //Create a Session instance        
              char[] password="admin".toCharArray();
              Credentials cred= new SimpleCredentials("admin", password);
              Session session = repository.login(cred);
              System.out.println("Done");
              System.out.println("Workspace: " + 
                      session.getWorkspace().getName() + "\n");
              Node node = session.getRootNode();                                                   // Line 50 - see error messages below
              listChildren( "", session.getRootNode() );
          }
      
          private static void listChildren(String indent, Node node ) throws RepositoryException {
              System.out.println("-->" + indent + node.getName()); 
              NodeIterator ni = node.getNodes();
              while(ni.hasNext()) {
                  listChildren(indent+"  ", ni.nextNode());
              }
      

       

      Start

      Done

      Workspace: crx.default

       

      Exception in thread "main" java.lang.AbstractMethodError: org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.getItemInfos(Lorg/apache/jackrabbit /spi/SessionInfo;Lorg/apache/jackrabbit/spi/NodeId;)Ljava/util/Iterator;

          at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceIt emStateFactory.java:93)

          at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory .java:97)

          at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:990)

          at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.jav a:133)

          at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImp l.java:252)

          at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getItemState(NodeEntryImpl.java:71)

          at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:199)

          at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:233)

          at AccessJCR.connectJcrUtils2(AccessJCR.java:50)

          at AccessJCR.main(AccessJCR.java:9)

       

      regards,

      Ulrich