gpt4 book ai didi

java - Hibernate Search、Infinispan、jgroups、Wildfly 集群集成配置

转载 作者:行者123 更新时间:2023-12-02 02:25:57 26 4
gpt4 key购买 nike

我正在尝试在 Wildfly 上配置 jgroups、infinispan、hibernate 搜索集群。我在 Netbeans 中有两个独立的文件,一个是 war,一个是 ejb jar。所以我将ejb作为war中的依赖项,然后仅将war插入wildfly 10.0.0。问题是 jndi 方式不起作用,幸运的是我看到了这个问题。现在我尝试使用xml配置文件对其进行配置,但我仍然总是陷入com.ctc.wstx.exc.WstxIOException:Stream已关闭。我尝试将 xml 配置文件放入 src、WEB-INF、META-INF 中,但我陷入了同样的异常。

我已经检查了这些( Configuring Infinispan CacheProvider in Seam 2.3"experimental" status of JGroups Master/Slave backend for hibernate search and infinispanInfinispanDirectoryProvider with Wildfly 10.1 ),但没有结果。

这就是我在 persistence.xml 中声明属性的方式

属性名称=“hibernate.search.infinispan.configuration_resourcename”值=“infinispan-config.xml”

[Server:server-one] Caused by: org.infinispan.commons.CacheConfigurationException: com.ctc.wstx.exc.WstxIOException: Stream closed [Server:server-one]
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:110) [Server:server-one] at org.infinispan.hibernate.search.impl.InfinispanConfigurationParser.parseFile(InfinispanConfigurationParser.java:57) [Server:server-one] at org.infinispan.hibernate.search.impl.InfinispanConfigurationParser.parseFile(InfinispanConfigurationParser.java:42) [Server:server-one] at org.infinispan.hibernate.search.impl.DefaultCacheManagerService.start(DefaultCacheManagerService.java:79) [Server:server-one] at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startService(StandardServiceManager.java:303) [Server:server-one] at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startVirtual(StandardServiceManager.java:268) [Server:server-one] at org.hibernate.search.engine.service.impl.StandardServiceManager.createAndCacheWrapper(StandardServiceManager.java:205) [Server:server-one] at org.hibernate.search.engine.service.impl.StandardServiceManager.requestService(StandardServiceManager.java:87) [Server:server-one] at org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider.initialize(InfinispanDirectoryProvider.java:66) [Server:server-one] at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:64) [Server:server-one] ... 28 more [Server:server-one] Caused by: com.ctc.wstx.exc.WstxIOException: Stream closed [Server:server-one]
at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:550) [Server:server-one] at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:605) [Server:server-one] at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:618) [Server:server-one] at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324) [Server:server-one] at __redirected.__XMLInputFactory.createXMLStreamReader(__XMLInputFactory.java:134) [Server:server-one] at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:116) [Server:server-one] at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:105) [Server:server-one] ... 37 more [Server:server-one] Caused by: java.io.IOException: Stream closed [Server:server-one] at java.io.BufferedInputStream.getInIfOpen(Unknown Source) [Server:server-one] at java.io.BufferedInputStream.fill(Unknown Source) [Server:server-one] at java.io.BufferedInputStream.read1(Unknown Source) [Server:server-one] at java.io.BufferedInputStream.read(Unknown Source) [Server:server-one] at com.ctc.wstx.io.StreamBootstrapper.ensureLoaded(StreamBootstrapper.java:478) [Server:server-one] at com.ctc.wstx.io.StreamBootstrapper.resolveStreamEncoding(StreamBootstrapper.java:302) [Server:server-one] at com.ctc.wstx.io.StreamBootstrapper.bootstrapInput(StreamBootstrapper.java:166) [Server:server-one] at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:545) [Server:server-one] ... 43 more

有什么新想法吗?

Infinispan 8.2.4、Hibernate 搜索 5.6.4、Wildfly 10.0.0、Hibernate OGM 5.1.0

最佳答案

此类错误是由于捆绑了不兼容的版本引起的;由于您提到 Hibernate Search 5.6.4 这不是 WildFly 10 中包含的版本,我猜您在应用程序中捆绑了该库的副本。

您可以更新库,但这需要专家组装自定义模块;最好采用现有的模块集之一,因为它们将由相应的发布团队(Hibernate/WildFly/Infinispan)进行测试。

最简单的方法是使用 WildFly 中包含的 Hibernate Search 版本,如 Hibernate Search documentation 中所述。 .

对于 WildFly 10,这是 Hibernate Search 版本 5.5.1,如您在 the tagged sources 中看到的那样.

接下来获取 Infinispan 版本,该版本旨在与此特定版本的应用程序服务器兼容;您需要 Infinispan downloads 中的“WildFly/EAP 模块” .

或者使用任何 Hibernate Search 版本包含的模块,如 section 3.10.2 中所述。但这些不包括 Infinispan,您必须从 Infinispan 获取兼容版本。

关于java - Hibernate Search、Infinispan、jgroups、Wildfly 集群集成配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47755797/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com