我正在尝试在JBoss EAP 7(或Wildfly 10)服务器上创建JDBC支持的Infinispan缓存。 cache-container
中的standalone-full.xml
定义如下所示:
<cache-container name="SearchCacheContainer" default-cache="SearchCache" module="org.infinispan.cachestore.jdbc">
<local-cache name="SearchCache">
<expiration max-idle="60000" interval="6000"/>
<transaction mode="FULL_XA"/>
<string-keyed-jdbc-store data-source="java:jboss/datasources/InfinispanCacheDS" preload="true" passivation="false" purge="false">
<property name="databaseType">
postgres
</property>
<property name="createTableOnStart">
true
</property>
<string-keyed-table prefix="str_">
<id-column name="id" type="VARCHAR2(200)"/>
<data-column name="datum" type="BLOB"/>
<timestamp-column name="version" type="NUMBER"/>
</string-keyed-table>
</string-keyed-jdbc-store>
</local-cache>
</cache-container>
我还在服务器中声明了必要的JDBC数据源,如下所示:
<datasource jndi-name="java:jboss/datasources/InfinispanCacheDS" pool-name="InfinispanCacheDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/db_infinispan_cache</connection-url>
<driver>postgresql-jdbc4</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>infinispan_cache</user-name>
<password>mypasswordhere</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
</validation>
<statement>
<track-statements>true</track-statements>
</statement>
</datasource>
但是,当我尝试启动JBoss服务器时,我看到以下错误并且服务器无法启动:
14:02:09,692 ERROR [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0362: Capabilities required by resource '/subsystem=infinispan/cache-container=SearchCacheContainer/local-cache=SearchCache/store=string-jdbc' are not available:
org.wildfly.data-source.java:jboss/datasources/InfinispanCacheDS; There are no known registration points which can provide this capability.
任何人都可以解释我在这里做错了什么吗?关于这个特殊功能的文档看起来很薄,所以我确定有一些我缺少的东西,但无法弄清楚是什么。谢谢!
答案 0 :(得分:-1)