6 Replies Latest reply on Mar 21, 2016 3:12 AM by Rishi Anand

    Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?

    Rishi Anand Novice

      I am using jackrbbit into one of my project. Now, I want to store data parallely through modeshape.

      After taking help from modeshape-spring-example, I have configured modeshape into my project. I am getting below error :

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: public javax.jcr.Session com.osmosix.mgmt.modeshape.jcr.ModeshapeDistributedJobTemplateContentReadWriteImpl.session; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeShapeSessionFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.jcr.Repository com.osmosix.mgmt.modeshape.jcr.ModeShapeSessionFactory.repository; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.jcr.Repository] is defined: expected single matching bean but found 2: repositoryFactory,jackRabbitRepository

              at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)

              at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)

              at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)

              ... 681 more

        • 1. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
          Horia Chiorean Master

          That example does not take into account that your classpath has multiple javax.jcr implementations.

           

          From the stacktrace it seems like you need to qualify your injected Repository instances, because there are multiple javax.jcr.Repository instances available to Spring via your configuration. So essentially you need to tell Spring which bean is which when injecting it.

          • 2. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
            Rishi Anand Novice

            I removed autowiring and now I am getting below error: (have a look at last error lines)

             

            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrService' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/cliqr-mgmt-content-repository-context.xml]: Cannot resolve reference to bean 'distributedJobTemplateContentReadWrite' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'distributedJobTemplateContentReadWrite' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/cliqr-mgmt-content-repository-context.xml]: Cannot resolve reference to bean 'modeshapeDistributedJobTemplateContentReadWriteImpl' while setting bean property 'modeshape'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeshapeDistributedJobTemplateContentReadWriteImpl' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/cliqr-mgmt-content-repository-context.xml]: Cannot resolve reference to bean 'modeshapeSession' while setting bean property 'session'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeshapeSession': FactoryBean threw exception on object creation; nested exception is javax.jcr.RepositoryException: Error while starting 'sample' repository: Name [infinispan-configuration-mysql-async-eviction.xml] is not bound in this Context. Unable to find [infinispan-configuration-mysql-async-eviction.xml].

            • 3. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
              Rishi Anand Novice

              I made a smiliar dummy project in Eclipse and I am getting below warning :

               

              15:01:17,514  WARN The repository 'sample' cannot be bound/unbound in JNDI at 'java:jcr/local/sample' because the JNDI context is read-only.

               

              While googling, I found "Name ... is not bound in this Context " is somewhat related to JNDI. May be I am not correct. Please suggest what to do ?

              • 4. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
                Rishi Anand Novice

                I am getting below errors now.


                Caused by: javax.jcr.RepositoryException: Error while starting 'sample' repository: SQL error while fetching stored entry with key: 5d1ebbb317f1e7/jcr:system/jcr:nodeTypes/nt:unstructured//undefined/*, lockingKey: 5d1ebbb317f1e7/jcr:system/jcr:nodeTypes/nt:unstructured//undefined/*

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

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

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

                  at com.osmosix.mgmt.modeshape.jcr.ModeShapeSessionFactory.getObject(ModeShapeSessionFactory.java:52)

                  at com.osmosix.mgmt.modeshape.jcr.ModeShapeSessionFactory.getObject(ModeShapeSessionFactory.java:33)

                  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)

                  ... 195 more

                Caused by: org.infinispan.persistence.spi.PersistenceException: SQL error while fetching stored entry with key: 5d1ebbb317f1e7/jcr:system/jcr:nodeTypes/nt:unstructured//undefined/*, lockingKey: 5d1ebbb317f1e7/jcr:system/jcr:nodeTypes/nt:unstructured//undefined/*

                • 5. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
                  Rishi Anand Novice

                  I am using that only. Later I thought to check my application is working or not. So, I enforced simpler repository configuration.

                   

                  repository-configuration.json :

                  {
                     "name" : "sample",
                     "jndiName" : "",
                     "monitoring" : {
                     "enabled" : true
                    },
                     "storage" : {
                     "transactionManagerLookup" : {
                     "name" : "org.modeshape.example.spring.jcr.AtomikosTransactionManagerLookup"
                    },
                     "binaryStorage" : {
                     "type" : "file",
                     "directory": "${java.io.tmpdir}/modeshape_spring_sample/binaries",
                     "minimumBinarySizeInBytes" : 40
                    }
                    },
                     "workspaces" : {
                     "default" : "default",
                     "allowCreation" : true
                    },
                     "security" : {
                     "anonymous" : {
                     "roles" : ["readonly","readwrite","admin"],
                     "useOnFailedLogin" : false
                    }
                    }
                  }

                   

                  Error is :

                  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeshapeSession' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/cliqr-mgmt-content-repository-context.xml]: Cannot resolve reference to bean 'repositoryFactory' while setting bean property 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryFactory': Invocation of init method failed; nested exception is org.modeshape.jcr.ConfigurationException: The configuration for the 'sample' repository has problems: ERROR: Error at storage.transactionManagerLookup : Field value for 'storage.transactionManagerLookup' expected to be of type string but was of type object

                  WARNING: The 'storage.transactionManagerLookup' field in the repository configuration file is deprecated and is no longer used. { "name" : "sample" , "jndiName" : "" , "monitoring" : { "enabled" : true } , "storage" : { "transactionManagerLookup" : { "name" : "com.osmosix.mgmt.modeshape.jcr.AtomikosTransactionManagerLookup" } , "binaryStorage" : { "type" : "file" , "directory" : "/usr/local/tomcat/temp/modeshape_spring_sample/binaries" , "minimumBinarySizeInBytes" : 40 } } , "workspaces" : { "default" : "default" , "allowCreation" : true } , "security" : { "anonymous" : { "roles" : [ "readonly" , "readwrite" , "admin" ] , "useOnFailedLogin" : false } }

                  • 6. Re: Already using jackrabbit, parallely I want to save data using Modeshape, I have some problem in config?
                    Rishi Anand Novice

                    I am getting below error :

                     

                    'repositoryFactory' while setting bean property 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atomikosTransactionManagerLookup' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/cliqr-mgmt-content-repository-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'atomikosTransactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [/usr/local/apache-tomcat-8.0.29/webapps/ROOT/WEB-INF/classes/spring/service/mgmt-content-repository-context.xml]: Invocation of init method failed; nested exception is com.atomikos.icatch.SysException: UserTransactionServiceImp: property not defined: com.atomikos.icatch.service


                    repository-configuration.json :


                    {

                        "name" : "sample",

                        "jndiName" : "",

                        "monitoring" : {

                            "enabled" : true

                        },

                        "storage" : {

                            "transactionManagerLookup" : {

                                "name" : "com.abc.mgmt.modeshape.

                    jcr.AtomikosTransactionManagerLookup"
                            },
                            "binaryStorage" : {
                                "type" : "file",
                                "directory": "${java.io.tmpdir}/modeshape_spring_sample/binaries",
                                "minimumBinarySizeInBytes" : 40
                            }
                        },
                        "workspaces" : {
                            "default" : "default",
                            "allowCreation" : true
                        },
                        "security" : {
                            "anonymous" : {
                                "roles" : ["readonly","readwrite","admin"],
                                "useOnFailedLogin" : false
                            }
                        }
                    }

                     

                    What should I do ?