9 Replies Latest reply on Apr 14, 2010 9:15 AM by Randall Hauch

    No repository found... but it's in the repository names.

    John Ament Master

      So my config looks something like this

       

      <mode:repositories>
              <mode:repository jcr:name="AuditRepo" mode:source="AuditSource"></mode:repository>
              <mode:repository jcr:name="LiveRepo" mode:source="LiveSource"></mode:repository>
              <mode:repository jcr:name="ContentRepo" mode:source="ContentSource"></mode:repository>
          </mode:repositories>
          <mode:sources jcr:primaryType="nt:unstructured">
              <mode:source jcr:name="ContentSource"
                  mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                  mode:rootNodeUuid="abcdefghjiuk"
              mode:workspaceRootPath="/jcr/data/1"
                  mode:nameOfDefaultWorkspace="contentWorkspace"/>
              <mode:source jcr:name="LiveSource"
                  mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                  mode:rootNodeUuid="abcdefghjiukb"
              mode:workspaceRootPath="/jcr/data/3"
                  mode:nameOfDefaultWorkspace="liveWorkspace"/>
              <mode:source jcr:name="AuditSource"
                  mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                  mode:rootNodeUuid="abcdefghjiuka"
              mode:workspaceRootPath="/jcr/data/2"
                  mode:nameOfDefaultWorkspace="auditWorkspace"/>
          </mode:sources>

       

      I try to do engine.getRepository("ContentRepo") in my code

       

      I added some debug messages to the logs to see what was happening

       

      logger.info("Getting repo "+name+" obj "+this.toString());
              for(String repo : engine.getRepositoryNames()) {
                  if(repo.equalsIgnoreCase(name)) {
                      logger.info("Found a hit.");
                  } else {
                      logger.info("no match "+repo);
                  }
                  logger.info("Found a repo... "+repo);
              }
              return engine.getRepository(name);

       

      and I see the following in the logs

       

      [#|2010-04-13T20:14:34.812-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|Getting repo ContentRepo obj com..cdiext.dna..JcrConfiguration@fba8eb0|#]

       

       

      [#|2010-04-13T20:14:34.813-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|no match LiveRepo|#]

       

       

      [#|2010-04-13T20:14:34.813-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|Found a repo... LiveRepo|#]

       

       

      [#|2010-04-13T20:14:34.814-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|no match AuditRepo|#]

       

       

      [#|2010-04-13T20:14:34.814-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|Found a repo... AuditRepo|#]

       

       

      [#|2010-04-13T20:14:34.815-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|Found a hit.|#]

       

       

      [#|2010-04-13T20:14:34.815-0400|INFO|glassfishv3.0|com..cdiext.dna..JcrConfiguration|_ThreadID=25;_ThreadName=Thread-1;|Found a repo... ContentRepo|#]

       

      this tells me that ContentRepo is found in the engine.getRepositoryNames() set, but not found when i do get repository.  What gives?

        • 1. Re: No repository found... but it's in the repository names.
          Brian Carothers Apprentice

          getRepositoryNames() reads directly from the configuration graph, but getRepository(String) only returns repositories after they've been started.  I believe this situation could occur if you have some kind of configuration problem that prevents the repository (or one of its sources) from starting up.

           

          Please add this code right before return engine.getRepository(name);

           

          for (Problem problem : engine.getProblems()) {

               System.err.println(problem.getMessageString());

          }

           

          ( Apologies in advance if that doesn't compile right - I'm going from memory )

           

          I suspect that will indicate that some problem exists that is preventing proper startup.  Failing that, what's the RepositoryException that you're getting?

           

          Thanks!

          • 2. Re: No repository found... but it's in the repository names.
            John Ament Master

            The only thing I get is this.

             

            _ThreadID=25;_ThreadName=Thread-1;|There are problems... 0|#]

             

            I added the following code:

             

            Problems p = engine.getProblems();
                        logger.info("There are problems... "+p.size());
                        for(Problem prob : p) {
                            logger.info("Problem exists: "+prob.getMessageString());
                        }

             

            The exception I'm getting is being thrown by this code

             

                            try {
                                repository = doCreateJcrRepository(repositoryName);
                            } catch (PathNotFoundException e) {
                                // The repository name is not a valid repository ...
                                String msg = JcrI18n.repositoryDoesNotExist.text(repositoryName);
                                throw new RepositoryException(msg);
                            }

            since you're swallowing the PNFE I don't see the underlying error.
            • 3. Re: No repository found... but it's in the repository names.
              Brian Carothers Apprentice

              That's perplexing.  Could you please post your config file (or join the IRC channel and pastebin it there)?

              • 4. Re: No repository found... but it's in the repository names.
                John Ament Master

                i'm there now.  gonna walk the dogs check back soon.

                • 5. Re: No repository found... but it's in the repository names.
                  John Ament Master

                  so here's the underlying path not found exception.

                   

                  org.modeshape.graph.property.PathNotFoundException: Unable to find "/"; lowest existing path is "/"
                          at org.modeshape.graph.connector.path.PathRequestProcessor.process(PathRequestProcessor.java:406)
                          at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:617)
                          at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:241)
                          at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:316)
                          at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:223)
                          at org.modeshape.graph.connector.path.PathRepositoryConnection.execute(PathRepositoryConnection.java:84)
                          at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:997)
                          at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:193)
                          at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:183)
                          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
                          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
                          at java.lang.Thread.run(Thread.java:636)

                   

                  just a question... are you using threads?

                  • 6. Re: No repository found... but it's in the repository names.
                    Brian Carothers Apprentice

                    Create a directory named "default" in each of your file system roots.  This directory corresponds to the default workspace named... "default".

                     

                    I tried setting mode:creatingWorkspacesAllowed="true" on the source, but that did not work.  It should have, so I'll be working on that bug in the next day or so.

                     

                    As an aside, the format that you're using for the root node UUIDs isn't parseable by UUID.fromString(), so the property is getting silently ignored.

                    • 7. Re: No repository found... but it's in the repository names.
                      Brian Carothers Apprentice

                      Sorry, missed this before I responded.

                       

                      just a question... are you using threads?

                      Yes.  The JCR repository wraps the "real" repository for the source with a federated connector.  The fedconn uses a multi-threaded fork-join algorithm to pass requests to relevant sources in parallel.

                      • 8. Re: No repository found... but it's in the repository names.
                        John Ament Master

                        alright that seems to have done it.

                         

                        i did have to add mode:updatesAllowed="true" to each source, but other than that it's working; though not overly useful since it's limited in node types in file system mode.

                        • 9. Re: No repository found... but it's in the repository names.
                          Randall Hauch Master

                          The file system connector does not store arbitrary content on the file system, and in this regard it doesn't really work like the JPA, Infinispan, InMemory, or JBoss Cache connectors that can indeed store any content.

                           

                          Instead, it allows you to expose the files and directories in some area of your file system through JCR as "nt:file" and "nt:folder" nodes. For example, its useful when you want your JCR repository to have access to the same files that might be served up through a web server (e.g., images, large media files, CSS files, and other static content that needs to be accessed by the web server quickly and that doesn't change with request but rather changes when the authors choose to change it). These files can be managed/uploaded through the same JCR repository where other content is managed, but accessed quickly/efficiently by the web server.  Another use case is allowing a JCR client (like a CMS system) to find a particular file to generate a link.

                           

                          The SVN connector works like the file system connector, where it accesses the files and directories in an SVN repository rather than those on a file system.