11 Replies Latest reply on Nov 22, 2012 6:16 AM by bwallis42

    SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample

    bwallis42

      I've started writing actual code for our project (yay!) but haven't gotten far as yet as I am trying to set up our environment so that there are some good examples of how building and testing are going to work.

       

      My first class is quite simple and uses an injected logger and repository reference. To run the tests I am using arquillian with the jboss-as-arquillian-container-managed container (essentially, arquillian starts a jboss appserver for the test, pushes a bean archive containing the code to be tested and then runs the test remotely).

       

      If I comment out my repository references then the test runs (doesn't do much except log something via the injected logger). If I put the repository reference in then it breaks with the error shown below.

       

      The code I'm trying to run is:

       

      {code}

      @Stateless @LocalBean

      public class PatientRecordOperation implements PatientRecordOperationLocal

      {

          @Inject

          private Logger log;

       

          @Resource(name = "java:/jcr/sample")

          private Repository repository;

       

          /**

           * Default constructor.

           */

          public PatientRecordOperation()

          {

              // TODO Auto-generated constructor stub

          }

       

          /**

           * Add a new patient to the repository. This initialises the top level node and adds the

           * sections to that patient node.

           *

           * @param namespace the namespace or domain for the patient urno (typically this identifies the PMI that allocated the urno)

           * @param urno the patient identifier, must be unique within the namespace.

           */

          @Override

          public void addPatient(String namespace,

                                 String urno)

          {

                    log.infov("Creating patient {0}:{1}", namespace,urno);

              Session session = null;

              String patientPath = namespace + "." + urno;

              try

              {

                  session = repository.login();

                  Node n = session.getRootNode();

                  if(n.hasNode(patientPath))

                  {

                            throw new Cpf4Exception("Patient \""+patientPath+"\" already exists");

                  }

                 

                  Node patientNode = n.addNode(patientPath /*, "inf:patient"*/);

                  patientNode.setProperty("inf:masterNs", namespace);

                  patientNode.setProperty("inf:masterId",urno);

                  Node patientId = patientNode.addNode(patientPath/*, "inf:patientId"*/);

                  patientId.setProperty("inf:ns", namespace);

                  patientId.setProperty("inf:id",urno);

                 

                  session.save();

              }

              catch(LoginException e)

              {

                  throw new Cpf4Exception("Failed JCR repository login", e);

              }

              catch(RepositoryException e)

              {

              throw new Cpf4Exception("Unexpected JCR repository error", e);

              }

              finally

              {

                  if(session != null)

                  {

                      session.logout();

                  }

              }

          }

      }

      {code}

       

      The errror occurs on the session.login() line. There isn't anything in the error trace or logging that helps me understand what is going wrong.

       

      The appserver is a clean install of jboss as7.1.1.Final with Modeshape 3.0.0.Final (the as 7.1 kit). The repository has been injected OK, the repository being used is the sample one with no changes and from the logging it seems to be trying to initialise it when it fails to setup the /jcr:system contents in the new repository.

       

      From the problems I've had with getting arquillian working, I wouldn't be surprised if this is related to dependencies in some way but I just cannot see it.

       

      Anyone got some suggestions where to look next?

       

      thanks.

       

      {noformat}

      08:16:46,583 INFO  [au.com.infomedix.cpf4.ds.PatientRecordOperation] (pool-4-thread-1) Creating patient IHE:919191

      08:16:46,589 DEBUG [org.modeshape.jcr.JcrRepository] (pool-4-thread-1) Starting 'sample' repository with configuration:

      { "name" : "sample" , "jndiName" : "" , "monitoring" : { "enabled" : true } , "workspaces" : { "allowCreation" : true , "default" : "default" } , "storage" : { "cacheName" : "sample" , "transactionManagerLookup" : "org.infinispan.transaction.lookup.JBossTransactionManagerLookup" , "cacheConfiguration" : "content" , "binaryStorage" : { "type" : "file" , "directory" : "/users/bwallis/InfoMedix/CPF4/DocumentStore/../jboss-as-7.1.1.Final/standalone/data/modeshape/sample/sample/binaries" } } , "security" : { "jaas" : { "policyName" : "modeshape-security" } , "anonymous" : { "username" : "<anonymous>" , "useOnFailedLogin" : false } , "providers" : [ { "classname" : "servlet" , "name" : "Authenticator that uses the Servlet context" } ] } , "query" : { "indexing" : { "backend" : { "type" : "lucene" } } , "indexStorage" : { "type" : "filesystem" , "location" : "/users/bwallis/InfoMedix/CPF4/DocumentStore/../jboss-as-7.1.1.Final/standalone/data/modeshape/sample/sample/indexes" } , "rebuildUponStartup" : "if_missing" } }

      08:16:46,602 INFO  [org.infinispan.factories.GlobalComponentRegistry] (pool-4-thread-1) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL

      08:16:46,716 DEBUG [org.infinispan.marshall.jboss.AbstractJBossMarshaller] (pool-4-thread-1) Using JBoss Marshalling

      08:16:46,724 DEBUG [org.infinispan.interceptors.InterceptorChain] (pool-4-thread-1) Interceptor chain size: 9

      08:16:46,725 DEBUG [org.infinispan.interceptors.InterceptorChain] (pool-4-thread-1) Interceptor chain is:

                >> org.infinispan.interceptors.InvocationContextInterceptor

                >> org.infinispan.interceptors.CacheMgmtInterceptor

                >> org.infinispan.interceptors.TxInterceptor

                >> org.infinispan.interceptors.NotificationInterceptor

                >> org.infinispan.interceptors.locking.OptimisticLockingInterceptor

                >> org.infinispan.interceptors.EntryWrappingInterceptor

                >> org.infinispan.interceptors.CacheLoaderInterceptor

                >> org.infinispan.interceptors.CacheStoreInterceptor

                >> org.infinispan.interceptors.CallInterceptor

      08:16:46,783 DEBUG [org.infinispan.loaders.file.FileCacheStore] (pool-4-thread-1) Using PER_WRITE file sync mode

      08:16:46,792 DEBUG [org.infinispan.jmx.JmxUtil] (pool-4-thread-1) Object name jboss.infinispan:type=Cache,name="sample(local)",manager="modeshape",component=Cache already registered

      08:16:46,793 INFO  [org.infinispan.jmx.CacheJmxRegistration] (pool-4-thread-1) ISPN000031: MBeans were successfully registered to the platform mbean server.

      08:16:46,796 INFO  [org.jboss.as.clustering.infinispan] (pool-4-thread-1) JBAS010281: Started sample cache from modeshape container

      08:16:46,796 DEBUG [org.infinispan.CacheImpl] (pool-4-thread-1) Started cache sample on null

      08:16:46,817 DEBUG [org.jboss.modules] (pool-4-thread-1) Module org.modeshape.extractor.tika:main defined by local module loader @3a56f631 (roots: /users/bwallis/InfoMedix/CPF4/DocumentStore/../jboss-as-7.1.1.Final/modules)

      08:16:47,034 DEBUG [org.modeshape.jcr.mimetype.TikaMimeTypeDetector] (pool-4-thread-1) Initializing the Tika MIME type detectors

      08:16:47,035 DEBUG [org.modeshape.jcr.mimetype.TikaMimeTypeDetector] (pool-4-thread-1)  - Found detector: org.gagravarr.tika.OggDetector

      08:16:47,035 DEBUG [org.modeshape.jcr.mimetype.TikaMimeTypeDetector] (pool-4-thread-1)  - Found detector: org.apache.tika.parser.microsoft.POIFSContainerDetector

      08:16:47,036 DEBUG [org.modeshape.jcr.mimetype.TikaMimeTypeDetector] (pool-4-thread-1)  - Found detector: org.apache.tika.parser.pkg.ZipContainerDetector

      08:16:47,036 DEBUG [org.modeshape.jcr.mimetype.TikaMimeTypeDetector] (pool-4-thread-1)  - Found detector: org.apache.tika.mime.MimeTypes

      08:16:47,162 DEBUG [org.infinispan.marshall.jboss.AbstractJBossMarshaller] (pool-4-thread-1) Using JBoss Marshalling

      08:16:47,164 DEBUG [org.infinispan.interceptors.InterceptorChain] (pool-4-thread-1) Interceptor chain size: 5

      08:16:47,165 DEBUG [org.infinispan.interceptors.InterceptorChain] (pool-4-thread-1) Interceptor chain is:

                >> org.infinispan.interceptors.InvocationContextInterceptor

                >> org.infinispan.interceptors.NotificationInterceptor

                >> org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor

                >> org.infinispan.interceptors.EntryWrappingInterceptor

                >> org.infinispan.interceptors.CallInterceptor

      08:16:47,166 INFO  [org.jboss.as.clustering.infinispan] (pool-4-thread-1) JBAS010281: Started sample/system cache from modeshape container

      08:16:47,167 DEBUG [org.infinispan.CacheImpl] (pool-4-thread-1) Started cache sample/system on null

      08:16:47,173 DEBUG [org.modeshape.jcr.cache.RepositoryCache] (pool-4-thread-1) Initializing the 'system' workspace in repository 'sample'

      08:16:47,203 ERROR [org.jboss.ejb3.invocation] (pool-4-thread-1) JBAS014134: EJB Invocation failed on component PatientRecordOperation for method public void au.com.infomedix.cpf4.ds.PatientRecordOperation.addPatient(java.lang.String,java.lang.String): javax.ejb.EJBException: au.com.infomedix.cpf4.cu.exceptions.Cpf4Exception: Unexpected JCR repository error

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at au.com.infomedix.cpf4.ds.PatientRecordOperation$$$view1.addPatient(Unknown Source) [1bddf7b4-ba5d-48ac-8d88-c927cc978582.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

                at au.com.infomedix.cpf4.ds.PatientRecordOperation$Proxy$_$$_Weld$Proxy$.addPatient(PatientRecordOperation$Proxy$_$$_Weld$Proxy$.java) [1bddf7b4-ba5d-48ac-8d88-c927cc978582.jar:]

                at au.com.infomedix.cpf4.ds.TestPatientRecordOperation.test(TestPatientRecordOperation.java:61) [1bddf7b4-ba5d-48ac-8d88-c927cc978582.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) [arquillian-service:]

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [arquillian-service:]

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270) [arquillian-service:]

                at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134) [arquillian-service:]

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]

                at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134) [arquillian-service:]

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240) [arquillian-service:]

                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) [arquillian-service:]

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) [arquillian-service:]

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) [arquillian-service:]

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [arquillian-service:]

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [arquillian-service:]

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [arquillian-service:]

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [arquillian-service:]

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199) [arquillian-service:]

                at org.junit.runners.ParentRunner.run(ParentRunner.java:300) [arquillian-service:]

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147) [arquillian-service:]

                at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [arquillian-service:]

                at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [arquillian-service:]

                at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65) [arquillian-service:]

                at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]

                at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]

                at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [classes.jar:1.6.0_37]

                at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [classes.jar:1.6.0_37]

                at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [classes.jar:1.6.0_37]

                at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:498)

                at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:246)

                at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_37]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_37]

                at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37]

      Caused by: au.com.infomedix.cpf4.cu.exceptions.Cpf4Exception: Unexpected JCR repository error

                at au.com.infomedix.cpf4.ds.PatientRecordOperation.addPatient(PatientRecordOperation.java:76) [1bddf7b4-ba5d-48ac-8d88-c927cc978582.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_37]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_37]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_37]

                at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_37]

                at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:82) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

                ... 126 more

      Caused by: javax.jcr.RepositoryException: Error while starting 'sample' repository: Unable to initialize the '/jcr:system' content in repository 'sample'

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:611)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:568)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:147)

                at au.com.infomedix.cpf4.ds.PatientRecordOperation.addPatient(PatientRecordOperation.java:54) [1bddf7b4-ba5d-48ac-8d88-c927cc978582.jar:]

                ... 152 more

      Caused by: org.modeshape.common.SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample'

                at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:182)

                at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1069)

                at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:960)

                at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:352)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:609)

                ... 155 more

      {noformat}

        • 1. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
          rhauch

          The appserver is a clean install of jboss as7.1.1.Final with Modeshape 3.0.0.Final (the as 7.1 kit). The repository has been injected OK, the repository being used is the sample one with no changes [...]

           

          Did you change the configuration of the Infinispan caches?

           

           

          Caused by: org.modeshape.common.SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample'
                    at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:182)
                    at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1069)
                    at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:960)
                    at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:352)
                    at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:609)

          Line 182 of RepositoryCache is attempting to look up the "/jcr:system" node that was created and saved just a few lines earlier. This typically means that the content is not being persisted correctly, which IIRC often happens when the transaction settings of the Infinispan cache are incorrect (e.g., the cache needs to be transactional).

          • 2. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
            bwallis42

            The as7 modeshape configuration is as it was out of the box, no changes. So the repository is using the sample infinispan cache which is configured for non-xa transactions.

             

            I'll try the arquillian non-managed configuration and attach a debugger to the appserver to see what is going on (can't see how to debug it in the arquillian managed appserver mode).

             

            thanks

            • 3. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
              bwallis42

              I think this is just more classpath problems.

               

              If I start the appserver in non-managed form and run the test it fails as above.

              If before running the test I access the sample repository via the modeshape rest service to get it initialised then when I run my arquillian test case, it does work.

               

              Back to playing with the arquillian setup :-(

              • 4. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                bwallis42

                Well, I don't seem to be able to get this to work with arquillian.

                 

                I've attached a quite simple testcase that reproduces the problem. If anyone can suggest why it doesn't work I'd be most grateful.

                 

                There are various bits commented out that are things that I have tried but the error seems to remain despite the variations.

                 

                If you run it just with "mvn test" then it will run an embedded jboss appserver (you need to adjust the arquillian.xml file to point to a jboss 7.1.1 installation with modeshape first) then the problem should occur. There is a second profile at the end of the pom.xml that allows you to run it against an external and already running jboss which is easier to debug.

                 

                thanks for any help.

                • 5. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                  rhauch

                  I can think of one more thing to check: make sure that any Arquillian-produced artifacts (e.g., JARs or WARs) do NOT contain any of the ModeShape, Infinispan, or other JARs that are already modules within AS7. I seem to recall running into some difficulties getting Arquillian to produce artifacts with the exact files we wanted.

                  • 6. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                    rhauch

                    One more thing. You may alread be aware of this, but one of our Maven modules in our codebase uses Arquillian to run several tests against a managed AS7+ModeShape installation.

                     

                         https://github.com/ModeShape/modeshape/tree/master/integration/modeshape-jbossas-integration-tests

                     

                    Several things to point out. You don't seem to be having trouble accessing injecting Repository instance, but I've included some information about how we use Arquillian for others' benefit:

                     

                    1. The MANIFEST.MF file should contain the "Dependencies" line, as any Arquillian test will be assembled into a deployable artifact and deployed to AS7. So if you're tests use ModeShape or JCR, AS7 needs to know that the deployable artifact must be able to "see" the ModeShape modules. (Note that if you're just using Resource injection, you might not need the "org.modeshape export services" part of that "Dependencies" line.
                    2. Notice how our tests are creating the deployment; the deployments vary by test, and some include test-specific resources while others just rely upon the existing APIs that are available in AS7+ModeShape.
                    3. Lots of our tests have to look up the repository, and unlike real applications we want to test all the possible ways it can be done. Some of our EJBs do use @Resource injection, and that's very easy to do in where it's needed. Other tests use JNDI lookups and the RepositoryFactory mechanism, and rather than duplicate that code in the test cases we created a class with a bunch of helper methods.
                    4. See our one "arquillian.xml" file that we use for all of the tests. You may need several depending upon how you want to test it.
                    • 7. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                      bwallis42

                      Thanks for the arquillian references, particularly the example integration testcases in modeshape.Very useful.

                       

                      I've managed to get my testcase to work but I think it indicates that there is a bug in the initialisation of a repository.

                       

                      From what I can see a repository is lazily initialised when it is first used. Unfortunatly if this initialisation is done within a transaction it fails with the same error as above,

                       

                      {code}

                      org.modeshape.common.SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample'". {code}

                      I got my test case to work by adding the following annotation to the bean class (or to the addPatient method)

                       

                      {code}

                      @TransactionAttribute(TransactionAttributeType.NEVER)

                      {code}

                       

                      Once the repository has been initialised then this annotation can be removed and it will keep working therafter until you delete the repository persistence directory and the repository has to be re-initiailised.

                       

                      I also tried forcing the initialisation from within the test case with code like

                       

                      {code}

                              Repository repository = (Repository)new InitialContext().lookup("java:/jcr/sample");

                              Session s = repository.login();

                              s.logout();

                      {code}

                      before the testcase calls the bean method. This also made the test work as the repository was initialised, without an active transaction, by the time the real test was run within a transaction.

                       

                      I think that the integration tests in the modeshape-jbossas-integration-tests package are only working due to the order of running of the tests. I suspect that the tests like PreconfiguredRepositoryIntegrationTest and SequencersIntegrationTest may be causing the repositories to be initialised outside of a transaction so the problem doesn't occur when they are used within a transaction in the other tests.

                       

                      If this all sounds reasonable I will file a bug in Jira.

                       

                      thanks

                      • 8. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                        hchiorean

                        Hi Brian,

                         

                        Regarding the integration tests order, that shouldn't really be an issue because we can run each integration test individually and it still passes (or any combination for that matter).

                         

                        Regarding transactional context within repository startup: this test: https://github.com/ModeShape/modeshape/blob/master/integration/modeshape-jbossas-integration-tests/src/test/java/org/modeshape/test/integration/StatelessRepositoryProviderIntegrationTest.java uses, in effect a standard SLSB which has some methods for retrieving a repository from JNDI. Afaik, according to the EJB spec, the default transactional attribute (if none other configured) is Required and the type of transactions are CMTs. So basically in this test the repository should be initialized from within a running CMT transaction.

                        • 9. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                          bwallis42

                          If I run the following build command in integration/modeshape-jbossas-integration-tests

                           

                          {code}

                          mvn clean test -Dtest=org.modeshape.test.integration.StatelessRepositoryProviderIntegrationTest

                          {code}

                           

                          then the test fails with the error in the subject. The clean is most important or else the repository might be already initialised since the test is configured in the pom.xml with "overwrite" set to false so it will re-use an old installation with it's persistent repository.

                           

                          The problem might be just in my environment so I would appreciate you trying this in your environment.

                           

                          thanks.

                          • 10. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                            hchiorean

                            Unfortunately, it turns out you are completely right, I get the same failure. Can you please log an issue against this.

                            • 11. Re: SystemFailureException: Unable to initialize the '/jcr:system' content in repository 'sample
                              bwallis42

                              Thanks for checking that, issue created, MODE-1717