Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1301

Federation connector blocks when underlying connector is mis-configured

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 2.5.1.GA
    • Federation
    • None

      I have three sources defined, two using file connector and one using federated connector.
      <mode:source jcr:name="test-file-federated1" mode:classname="org.modeshape.connector.filesystem.FileSystemSource" mode:creatingWorkspaceAllowed="true" mode:retryLimit="3" mode:defaultWorkspaceName="federated" mode:updatesAllowed="true" mode:workspaceRootPath="/home/jpechane/workspace/SOATests/tests/modeshape/build/test-repositories/federated1"/>
      <mode:source jcr:name="test-file-federated2" mode:classname="org.modeshape.connector.filesystem.FileSystemSource" mode:creatingWorkspaceAllowed="true" mode:retryLimit="3" mode:defaultWorkspaceName="federated" mode:updatesAllowed="true" mode:workspaceRootPath="/home/jpechane/workspace/SOATests/tests/modeshape/build/test-repositories/federated2"/>
      <mode:source jcr:name="test-federated" mode:classname="org.modeshape.graph.connector.federation.FederatedRepositorySource" mode:defaultWorkspaceName="default">
      <mode:workspaces>
      <mode:workspace jcr:name="default">
      <mode:projections>
      <mode:projection jcr:name="File 1" mode:source="test-file-federated1" mode:workspaceName="federated">
      <mode:projectionRules>/source1/fed => /federated</mode:projectionRules>
      </mode:projection>
      <mode:projection jcr:name="File 2" mode:source="test-file-federated2" mode:workspaceName="federated">
      <mode:projectionRules>/source2/fed => /</mode:projectionRules>
      </mode:projection>
      </mode:projections>
      </mode:workspace>
      </mode:workspaces>
      </mode:source>

      The setup works well and the repository can be browsed.

      I removed the directories of one of the file connectors to simulate misconfiguration.

      I tried to access one of the file repositories and I got proper exception
      javax.jcr.RepositoryException: Error starting the "test-file-federated1" repository (check the configuration): The path "/home/jpechane/workspace/SOATests/tests/modeshape/build/test-repositories/federated1" for the predefined workspace for the file system source "test-file-federated1" does not represent an existing directory
      at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:911)
      at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:883)
      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)
      Caused by: java.lang.IllegalStateException: The path "/home/jpechane/workspace/SOATests/tests/modeshape/build/test-repositories/federated1" for the predefined workspace for the file system source "test-file-federated1" does not represent an existing directory
      at org.modeshape.connector.filesystem.FileSystemRepository.initialize(FileSystemRepository.java:80)
      at org.modeshape.connector.filesystem.FileSystemRepository.<init>(FileSystemRepository.java:66)
      at org.modeshape.connector.filesystem.FileSystemSource.getConnection(FileSystemSource.java:806)
      at org.modeshape.graph.connector.RepositoryConnectionPool.newWrappedConnection(RepositoryConnectionPool.java:980)
      at org.modeshape.graph.connector.RepositoryConnectionPool.getConnection(RepositoryConnectionPool.java:831)
      at org.modeshape.repository.RepositoryLibrary.createConnection(RepositoryLibrary.java:566)
      at org.modeshape.graph.Graph.execute(Graph.java:283)
      at org.modeshape.graph.Graph$5.process(Graph.java:231)
      at org.modeshape.graph.request.RequestBuilder.verifyWorkspace(RequestBuilder.java:75)
      at org.modeshape.graph.Graph.useWorkspace(Graph.java:382)
      at org.modeshape.graph.Graph.getCurrentWorkspace(Graph.java:357)
      at org.modeshape.graph.Graph.getCurrentWorkspaceName(Graph.java:342)
      at org.modeshape.jcr.JcrRepository.<init>(JcrRepository.java:836)
      at org.modeshape.jcr.JcrEngine.doCreateJcrRepository(JcrEngine.java:607)
      at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:900)
      ... 6 more

      But if I tried to acess federated repository then I did not receive any exception and the test hangs after writing this messages
      [testng] Retrieving standalone repository: test-federated
      [testng] SLF4J: Class path contains multiple SLF4J bindings.
      [testng] SLF4J: Found binding in [jar:file:/home/jpechane/workspace/SOATests/tests/lib/jackrabbit-standalone-2.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      [testng] SLF4J: Found binding in [jar:file:/home/jpechane/releases/52ER6AS/seam/lib/slf4j-log4j.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      [testng] SLF4J: Found binding in [jar:file:/home/jpechane/releases/52ER6AS/seam/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      [testng] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      [testng] 07:59:45,037 INFO [RepositoryQueryManager] Started rebuilding indexes for repository 'test-federated'

      Federation connector shold be able to detect the misconfiguration and fail gracefully.

              Unassigned Unassigned
              jpechane Jiri Pechanec
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: