JDBC configuration in AS7.1.1
bwallis42 Aug 16, 2012 8:02 AMI have the following configuration in standalone.xml for the cache and repository, I couldn't find any good examples or documentation so I made this up from various bits of info from the web and by reading the xsd schema files for infinispan and modeshape.
It is probably missing something as it doesn't quite work for me. The intent is to have the modeshape cache with a write through jdbc based cache loader so all data is stored into the database when written to the repository.
{code}
<subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">
<cache-container name="modeshape" default-cache="sample">
<local-cache name="testRepository">
<transaction mode="NON_XA"/>
<expiration max-idle="100000" lifespan="-1" interval="5000"/>
<string-keyed-jdbc-store datasource="java:jboss/datasources/JcrDataDS" preload="false" passivation="false" purge="false">
<property name="databaseType">
postgres
</property>
<property name="createTableOnStart">
true
</property>
<string-keyed-table prefix="stringbased">
<id-column name="id" type="VARCHAR2(200)"/>
<data-column name="datum" type="BLOB"/>
<timestamp-column name="version" type="NUMBER"/>
</string-keyed-table>
</string-keyed-jdbc-store>
</local-cache>
</cache-container>
</subsystem>
<subsystem xmlns="urn:jboss:domain:modeshape:1.0">
<repository name="testRepository" cache-name="testRepository" cache-container="modeshape"/>
</subsystem>
{code}
On calling login on the session I get the following error.
{code}
17:07:51,996 ERROR [au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService] (http-localhost-127.0.0.1-8080-1) Failed to start JCR change observer bean: javax.jcr.RepositoryException: Error while starting 'testRepository' repository: null
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:579)
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:536)
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:145)
at au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService.login(JcrService.java:111) [classes:]
at au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService.registerSchema(JcrService.java:122) [classes:]
at au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService.getInstance(JcrService.java:43) [classes:]
at au.com.infomedix.jcrloadtest.jcrserver.restapi.NodeCrudMethods.queryNodes(NodeCrudMethods.java:158) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_33]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_33]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_33]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_33]
Caused by: java.lang.NullPointerException
at org.modeshape.jcr.txn.SynchronizedTransactions.begin(SynchronizedTransactions.java:60)
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:333)
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:308)
at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:130)
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1033)
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:921)
at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:346)
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:577)
... 34 more
{code}
any ideas on what I might have missed in the configuration?
thanks