Search code examples
jdbcjbosswildflyhibernate-searchinfinispan

Infinispan/Wildfly: Cannot find a parser for element 'string-keyed-jdbc-store' in namespace


I am trying to configure a JDBC-backed Infinispan cache for storing Hibernate Search indices on Wildfly 10/JBoss EAP 7. I have installed the Infinispan 8.1.x Wildfly/JBoss modules from infinispan.org within my application server, and I've FINALLY gotten a basic infinispan.xml file working with file persistence, and now I am trying to change it over to use JDBC for persistence. My infinispan.xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:infinispan:config:8.1 http://www.infinispan.org/schemas/infinispan-config-8.1.xsd
                        urn:infinispan:config:jdbc:8.0 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-8.0.xsd"
    xmlns="urn:infinispan:config:8.1" xmlns:jdbc="urn:infinispan:config:store:jdbc:8.0">

    <jgroups>
        <stack-file name="default-jgroups-udp" path="default-configs/default-jgroups-udp.xml" />
    </jgroups>


    <cache-container name="HibernateSearch" default-cache="default"
        statistics="false" shutdown-hook="DONT_REGISTER">

        <transport stack="default-jgroups-udp" />

        <jmx duplicate-domains="true" />

        <!-- *************************************** -->
        <!-- Cache to store Lucene's file metadata -->
        <!-- *************************************** -->
        <replicated-cache name="LuceneIndexesMetadata" mode="SYNC"
            remote-timeout="25000">
            <locking striping="false" acquire-timeout="10000"
                concurrency-level="500" write-skew="false" />
            <transaction mode="NONE" />
            <eviction max-entries="-1" strategy="NONE" />
            <expiration max-idle="-1" />
            <persistence passivation="false">
                <file-store preload="true" purge="true"
                    path="${jboss.server.temp.dir}/indexes" />
            </persistence>
            <indexing index="NONE" />
            <state-transfer enabled="true" timeout="480000"
                await-initial-transfer="true" />
        </replicated-cache>

        <!-- **************************** -->
        <!-- Cache to store Lucene data -->
        <!-- **************************** -->
        <replicated-cache name="LuceneIndexesData" mode="SYNC"
            remote-timeout="25000">
            <locking striping="false" acquire-timeout="10000"
                concurrency-level="500" write-skew="false" />
            <transaction mode="NONE" />
            <eviction max-entries="-1" strategy="NONE" />
            <expiration max-idle="-1" />
            <persistence passivation="false">
                <string-keyed-jdbc-store xmlns="urn:infinispan:config:store:jdbc:8.0"
                    fetch-state="false" read-only="false" purge="false">
                    <data-source jndi-url="java:jboss/datasources/InfinispanCacheDS" />
                    <string-keyed-table drop-on-exit="false"
                        create-on-start="true" prefix="ISPN_STRING_TABLE">
                        <id-column name="ID_COLUMN" type="VARCHAR(255)" />
                        <data-column name="DATA_COLUMN" type="BINARY" />
                        <timestamp-column name="TIMESTAMP_COLUMN" type="BIGINT" />
                    </string-keyed-table>
                </string-keyed-jdbc-store>
            </persistence>
            <!-- <persistence passivation="false"> <file-store preload="true" purge="true" 
                path="${jboss.server.temp.dir}/indexes" /> </persistence> -->
            <indexing index="NONE" />
            <state-transfer enabled="true" timeout="480000"
                await-initial-transfer="true" />
        </replicated-cache>

        <!-- ***************************** -->
        <!-- Cache to store Lucene locks -->
        <!-- ***************************** -->
        <replicated-cache name="LuceneIndexesLocking" mode="SYNC"
            remote-timeout="25000">
            <locking striping="false" acquire-timeout="10000"
                concurrency-level="500" write-skew="false" />
            <transaction mode="NONE" />
            <eviction max-entries="-1" strategy="NONE" />
            <expiration max-idle="-1" />
            <persistence passivation="false">
                <file-store preload="true" purge="true"
                    path="${jboss.server.temp.dir}/indexes" />
            </persistence>
            <indexing index="NONE" />
            <state-transfer enabled="true" timeout="480000"
                await-initial-transfer="true" />
        </replicated-cache>
    </cache-container>

</infinispan>

I am also using the following jboss-deployment-structure.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <dependencies>

            <!-- Core Java/Java EE Dependencies -->
            <module name="javax.transaction.api" export="true" services="import" />

            <!-- JPA/Hibernate Search Dependencies -->
            <module name="javax.persistence.api" export="true" />

            <module name="org.hibernate.search.engine" export="true"
                services="import" slot="5.5" />
            <module name="org.hibernate.search.orm" export="true"
                services="import" slot="5.5" />

            <module name="org.infinispan.hibernate-search.directory-provider"
                slot="for-hibernatesearch-5.5" export="true" services="import" /><!-- 
                <module name="org.apache.lucene" export="true" services="import" /> <module 
                name="org.infinispan.lucene-directory" slot="ispn-8.1" /> -->

            <module name="org.infinispan.core" slot="ispn-8.1" services="import"
                export="true" />
            <module name="org.infinispan.persistence.jdbc" slot="ispn-8.1"
                services="import" export="true" />
            <module name="org.infinispan.persistence.remote" slot="ispn-8.1"
                services="import" export="true" />

        </dependencies>
    </deployment>
</jboss-deployment-structure>

However, when I deploy my application I get the following exception:

ISPN000327: Cannot find a parser for element 'string-keyed-jdbc-store' in namespace 'urn:infinispan:config:store:jdbc:8.0'. Check that your configuration is up-to date for this version of Infinispan.

Everything works fine if I change persistence from JDBC to "file". However, once I put in the JDBC parameters I get the parsing error. I'm sure I'm doing something minor and stupid to cause this, but I can't for the life of me figure out what. Any help would be GREATLY appreciated!!


Solution

  • After trying to investigate this problem I ended opening a bug report:

    The problem is that I expected the org.infinispan.core module to depend on its extensions, but this is not the case. I previously mentioned a wokraround, but editing the module XML files is not enough as there's no easy solution which would be able to maintain the isolation of different modules which need to be isolated.

    The problem is fixed now, please upgrade to either Infinispan version 9.0.0.Final which will contain the fix, or get Infinispan 8.2.7.Final as I'll backport this fix as well.