Infinispan / Wildfly:无法找到元素的解析器' string-keyed-jdbc-store'在命名空间

时间:2017-03-07 18:49:36

标签: jdbc jboss wildfly hibernate-search infinispan

我正在尝试配置一个支持JDBC的Infinispan缓存,用于在Wildfly 10 / JBoss EAP 7上存储Hibernate Search索引。我在我的应用服务器中安装了infinispan.org的Infinispan 8.1.x Wildfly / JBoss模块,我和#39; ve最终获得了一个使用文件持久性的基本infinispan.xml文件,现在我正在尝试将其更改为使用JDBC进行持久化。我的infinispan.xml文件如下所示:

import numpy as np
np.dtype([(d[k], d[k.replace('name', 'format')]) for k in d.keys() if k.startswith('name')])

# dtype([('position', 'i1'), ('ID', '<u8'), ('mass', '<f4')])

我也在使用以下jboss-deployment-structure.xml文件:

<?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>

但是,当我部署我的应用程序时,我得到以下异常:

<?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>

如果我将持久性从JDBC更改为&#34; file&#34;,一切正常。但是,一旦我输入JDBC参数,我就会得到解析错误。我确定我做了一些轻微而愚蠢的事情,但是我不能为我的生活弄清楚什么。任何帮助都会非常感激!!

1 个答案:

答案 0 :(得分:3)

在尝试调查此问题后,我结束了错误报告:

问题是我希望org.infinispan.core模块依赖于它的扩展,但事实并非如此。我之前提到过wokraround,但编辑模块XML文件是不够的,因为没有简单的解决方案可以保持需要隔离的不同模块的隔离。

现在问题已解决,请升级到包含此修复程序的Infinispan版本9.0.0.Final,或者获取Infinispan 8.2.7.Final,因为我也会向此修复此修复程序。