5 Replies Latest reply on Aug 28, 2013 4:05 PM by beaster

    Jboss 7.2.0 Final and infinispan

    fabrizio.benedetti

      Hi all,

      I'm trying to deploy an application from 7.1.3 to 7.2.0 Final. This app makes use of infinispan. When the app tries to start a CacheManager from an external xml, receives a parser error.

       

      Here is server.log:

      ...
      org.infinispan.config.ConfigurationException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
      Message: Unexpected element '{urn:infinispan:config:5.2}infinispan'
          at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:87) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]
          at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:353) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]
          at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:326) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]
          at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:313) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]
      ...

       

      The java code is:

      DefaultCacheManager cacheManager = new DefaultCacheManager("mycluster.xml"); cacheManager.start(); 

       

      mycluster.xml is:

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan xmlns="urn:infinispan:config:5.2">
          <global>
              <transport clusterName="${jgroups.cluster_name:MyPartition}" distributedSyncTimeout="15000">
                  <properties>
                      <property name="configurationFile" value="${jgroups.transport_file}" />
                  </properties>
              </transport>
              <shutdown hookBehavior="DONT_REGISTER"/>
          </global>
          <default>
              <jmxStatistics enabled="true"/>
              <clustering mode="distribution">
                  <l1 enabled="false" lifespan="10000"/>
                  <hash numOwners="2" />
                  <sync replTimeout="10000"/>
              </clustering>
          </default>
          <namedCache name="myCache"/>
      </infinispan>

       

      The XML file seems to be valid, infact I wrote a simple standalone java code (importing infinispan 5.2.1) that makes the same thing and goes fine!

       

      Why from within as 7.2.0 Final the parser does not validate the external XML?

       

      Regards

      /Fabrizio

        • 1. Re: Jboss 7.2.0 Final and infinispan
          nadirx

          Fabrizio, are you packaging the Infinispan Jar in your application or importing it from the AS ?

          • 2. Re: Jboss 7.2.0 Final and infinispan
            fabrizio.benedetti

            I'm importing it via jboss-deployment-structure.xml in the ear.

            • 3. Re: Jboss 7.2.0 Final and infinispan
              nadirx

              You need to import services. I think it should look like this:

               

              <module name="org.infinispan" services="import" />

              • 4. Re: Jboss 7.2.0 Final and infinispan
                fabrizio.benedetti

                Yes, it works!

                 

                Thank you Tristan.

                • 5. Re: Jboss 7.2.0 Final and infinispan
                  beaster

                  We are doing something similar where we do the following:

                   

                  new DefaultCacheManager("cacheDelegator.xml");

                   

                  Very simple XML in cacheDelegator.xml

                   

                  <?xml version="1.0" encoding="UTF-8"?>
                  <infinispan>

                      <namedCache name="inboxSummary">
                          <eviction maxEntries="500" strategy="LRU"/>
                          <expiration lifespan="60000"/>
                      </namedCache>

                  </infinispan>

                   

                  Running an EAR with JBoss 7.2.0

                   

                  I have included <module name="org.infinispan" services="import"/> in jboss-deployment-structure.xml in META-INF of the EAR.

                   

                  Unfortunately it is not working.  It will not parse the file.

                   

                  Message: Unexpected element 'infinispan'

                  at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:87)

                  at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:353)

                  at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:326)

                  at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:313)

                  ...

                  Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]

                  Message: Unexpected element 'infinispan'

                  at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108)

                  at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)

                  at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:77)

                  ... 183 more