2 Replies Latest reply on Aug 16, 2011 9:46 AM by Frank Henry

    AS7 Config a custom store for a cache

    Frank Henry Novice

      Hello,

       

      I have been getting my feet wet in AS7 and a lot has really changed. One of my research projects involves a custom store for a standalone cache.

       

      I have configured the cache in the standalone.xml as such:

      ...

      <subsystem xmlns="urn:jboss:domain:ee:1.0">

        <global-modules>

          <module name="com.test.cache-test" slot="main" />

        </global-modules>

      </subsystem>

      ...

      <subsystem xmlns="urn:jboss:domain:infinispan:1.0" default-cache-container="hibernate">

      ...

      <cache-container name="test-cache" default-cache="cache-store">

          <alias>test-cache</alias>

        <local-cache name="cache-store">

            <eviction strategy="NONE"/>

            <custom-store class="com.test.TestStorage"/>

        </local-cache>

      </cache-container>

      ...

      </subsystem>

      ...

       


      Though when I run the server using the standalone.sh it complains with a

       

      11:04:22,471 ERROR [stderr] Exception in thread "Controller Boot Thread" java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

      11:04:22,472 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:89)

      11:04:22,472 ERROR [stderr]     at java.lang.Thread.run(Thread.java:662)

      11:04:22,472 ERROR [stderr] Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

      11:04:22,472 ERROR [stderr]     at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:115)

      11:04:22,472 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:104)

      11:04:22,473 ERROR [stderr]     at org.jboss.as.server.ServerService.boot(ServerService.java:193)

      11:04:22,473 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:83)

      11:04:22,473 ERROR [stderr]     ... 1 more

      11:04:22,473 ERROR [stderr] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[144,19]

      11:04:22,473 ERROR [stderr] Message: Unexpected element '{urn:jboss:domain:infinispan:1.0}custom-store' encountered

      11:04:22,473 ERROR [stderr]     at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:65)

      11:04:22,474 ERROR [stderr]     at org.jboss.as.clustering.infinispan.subsystem.InfinispanExtension.parseCacheElement(InfinispanExtension.java:475)

      11:04:22,474 ERROR [stderr]     at org.jboss.as.clustering.infinispan.subsystem.InfinispanExtension.parseLocalCache(InfinispanExtension.java:361)

      11:04:22,474 ERROR [stderr]     at org.jboss.as.clustering.infinispan.subsystem.InfinispanExtension.parseContainer(InfinispanExtension.java:223)

      11:04:22,474 ERROR [stderr]     at org.jboss.as.clustering.infinispan.subsystem.InfinispanExtension.readElement(InfinispanExtension.java:148)

      11:04:22,474 ERROR [stderr]     at org.jboss.as.clustering.infinispan.subsystem.InfinispanExtension.readElement(InfinispanExtension.java:57)

      11:04:22,475 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)

      11:04:22,475 ERROR [stderr]     at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)

      11:04:22,475 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:311)

      11:04:22,475 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readServerElement(StandaloneXml.java:163)

      11:04:22,475 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:91)

      11:04:22,475 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:79)

      11:04:22,476 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)

      11:04:22,476 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59)

      11:04:22,476 ERROR [stderr]     at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:107)

      11:04:22,476 ERROR [stderr]     ... 4 more

       

       

      I used the example given in https://docs.jboss.org/author/display/ISPN/Getting+Started+Guide+-+JBoss+AS+7 and using the jboss-infinispan.xsd, but I can't figure out what I am doing wrong.

       

      Can anyone see anything?

      Thanks!