3 Replies Latest reply on Mar 17, 2016 3:13 AM by rishianand50

    SQL error while fetching stored entry with key

    rishianand50

      I am getting below error while using modeshape. I am storing data into mysql.


      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/*

        • 1. Re: SQL error while fetching stored entry with key
          hchiorean

          You should check your logs for the *actual* SQL error. Most likely this is related to your database type and the Infinispan JDBC configuration around column types. For example if you're using MySQL you should probably configure your ID column like: https://github.com/ModeShape/modeshape-examples/blob/4.x/modeshape-jdbc-store-example/src/main/resources/infinispan-configuration-mysql-async-eviction.xml#L29

          • 2. Re: SQL error while fetching stored entry with key
            rishianand50

            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 } }

            • 3. Re: SQL error while fetching stored entry with key
              rishianand50

              I am using Spring framework for my application, and I want to store data into MySQL.

              Please suggest me good infinispan configuration file.