4 Replies Latest reply on Jan 30, 2013 9:33 AM by nadirx

    invalid xml in new config (5.2.0.CR1)

    jaydev

      I am trying to work with a jdbc cache store but the samples from the documentation do not work (xml errors).

       

      Here is my simiple config:

       

      <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd

                             urn:infinispan:config:jdbc:5.2 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-5.2.xsd"

                xmlns="urn:infinispan:config:5.2" xmlns:jdbc="urn:infinispan:config:jdbc:5.2">

       

      <namedCache name="strategyExposureCache">

                          <jmxStatistics enabled="true" />

                          <eviction strategy="LIRS" maxEntries="20" />

                          <expiration lifespan="72000000" maxIdle="72000000"

                                    wakeUpInterval="300000" />

                          <loaders passivation="true">

                                    <stringKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:5.2"

                                              singletonStore="false" fetchPersistentState="false"

                                              ignoreModifications="false" key2StringMapper="com.ejb.cache.StrategyFactorExposureKey2StringMapper" purgeOnStartup="false"

                                              datasource="java:/jdbc/local/mysqlInfinispan">

                                              <stringKeyedTable dropOnExit="false" createOnStart="true"

                                                        prefix="ISPN">

                                                        <idColumn name="ID_COLUMN" type="VARCHAR(255)" />

                                                        <dataColumn name="DATA_COLUMN" type="BINARY(255)" />

                                                        <timestampColumn name="TIMESTAMP_COLUMN" type="BIGINT" />

                                              </stringKeyedTable>

                                    </stringKeyedJdbcStore>

                          </loaders>

                </namedCache>

      </infinispan>

       

      In Eclipse, the errors are:

       

      Multiple annotations found at this line:

      - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element

                 'stringKeyedJdbcStore'.

                - Start tag of element <stringKeyedJdbcStore>

       

      What do I need to do to make this work?  Both the jdbc and the core infinispan jars are in the classpath.

       

      Thanks!

        • 1. Re: invalid xml in new config (5.2.0.CR1)
          nadirx

          Firstly, your XML above is incorrect. Here is the corrected one:

           

           

          {code:xml}

          <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd

                                 urn:infinispan:config:jdbc:5.2 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-5.2.xsd"

             xmlns="urn:infinispan:config:5.2" xmlns:jdbc="urn:infinispan:config:jdbc:5.2">

             <namedCache name="strategyExposureCache">

                <jmxStatistics enabled="true" />

                <eviction strategy="LIRS" maxEntries="20" />

                <expiration lifespan="72000000" maxIdle="72000000" wakeUpInterval="300000" />

                <loaders passivation="true">

                   <stringKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:5.2" fetchPersistentState="false" ignoreModifications="false" key2StringMapper="com.ejb.cache.StrategyFactorExposureKey2StringMapper" purgeOnStartup="false">

                      <dataSource jndiUrl="java:/jdbc/local/mysqlInfinispan" />

                         <stringKeyedTable dropOnExit="false" createOnStart="true" prefix="ISPN">

                            <idColumn name="ID_COLUMN" type="VARCHAR(255)" />

                            <dataColumn name="DATA_COLUMN" type="BINARY(255)" />

                            <timestampColumn name="TIMESTAMP_COLUMN" type="BIGINT" />

                         </stringKeyedTable>

                         <singletonStore enabled="false" />

                   </stringKeyedJdbcStore>

                </loaders>

             </namedCache>

          </infinispan>

          {code}

           

          I have found a small issue with the infinispan-config-5.2.xsd schema, although I doubt it is the reason for Eclipse's validation failure: the <loaders> element is declared as a <sequence> which can have a <xs:any namespace="##other" minOccurs="0"/> child. We need to add a maxOccurs="unbounded" to that, but it should still validate with a single element.

          • 2. Re: invalid xml in new config (5.2.0.CR1)
            jaydev

            Thanks Tristan for your reply.  However, I still get the same error when pasting your xml in my config file.

            • 3. Re: invalid xml in new config (5.2.0.CR1)
              nadirx

              The public XSD should be updated soon, but I wouldn't worry about Eclipse. The XML should work fine: I tested it with a simple enough application.

              • 4. Re: invalid xml in new config (5.2.0.CR1)
                nadirx

                Hi Julien,

                I finally figured out why the validation was failing. I am working on fixing it today: https://issues.jboss.org/browse/ISPN-2775