- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
TL:DR 我收到以下错误,我看不出有什么原因,索引已启用,并且 SearchFactoryIntegrator 位于需要查看它的所有内容的类路径中。
Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
长版:
我正在尝试构建一个简单的测试应用程序来针对 Infinispan 缓存运行查询。
我已成功将对象添加到缓存中。缓存定义为 private org.infinispan.Cache<String, Agent> cache;
代理是我自己的对象。
尝试查询缓存时,我从该行收到以下错误 SearchManager searchManager = Search.getSearchManager(cache);
17:35:43,873 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SearchableCacheTest].[Faces Servlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalArgumentException: Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:40) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
at org.infinispan.query.SearchManagerImpl.<init>(SearchManagerImpl.java:56) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
at org.infinispan.query.Search.getSearchManager(Search.java:39) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
重要的部分是
Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
在此错误之前cache.getCacheConfiguration().indexing().enabled()
解析为 true
缓存是已在standalone-ha.xml
中配置的默认“集群”缓存的修改版本。 JBoss 的。
<cache-container name="cluster" aliases="ha-partition" default-cache="default" start="EAGER">
<transport lock-timeout="60000"/>
<replicated-cache name="default" mode="SYNC" batching="true" indexing="LOCAL">
<locking isolation="REPEATABLE_READ"/>
<store class="org.infinispan.loaders.file.FileCacheStore" preload="true" passivation="false" fetch-state="true" purge="false">
<property name="location">
/tempCacheIndex
</property>
</store>
</replicated-cache>
</cache-container>
我看到索引是在配置的文件位置创建的,因此启用的 boolean 值解析为 true 似乎是当前状态的事实表示。
我在 JBoss 中创建了一个 org.infinispan.query 模块,它包含以下内容
上述所有内容都在该模块的 module.xml 中定义为资源根。我修改了模块的 module.xml org.infinispan
依赖于模块 org.infinispan.query
我已经在我的 jboss-deployment-structure.xml 中声明了对这两个模块的依赖
有没有人知道为什么会发生这种情况并且可能有解决方案?
注意:有一个非常相似的问题here但他最终没有成功,选择了不同的路线。
最佳答案
注意:我从一个干净的 JBoss 7.1.1 实例开始,因此从 Infinispan 5.1.6 恢复到 5.1.2
根据我的需要,我修改了现有的集群缓存,使其看起来像这样
<cache-container name="cluster" aliases="ha-partition"
default-cache="default" start="EAGER">
<transport lock-timeout="60000" />
<replicated-cache name="default" mode="SYNC" batching="true"
indexing="LOCAL">
<locking isolation="REPEATABLE_READ" />
<store class="org.infinispan.loaders.file.FileCacheStore"
preload="true" passivation="false" fetch-state="true" purge="false">
<property name="location">
/tempCacheIndex
</property>
</store>
</replicated-cache>
然后为了真正能够查询缓存,创建包含以下 module.xml 中提到的 jar 的 org.infinispan.query 模块
<module xmlns="urn:jboss:module:1.1" name="org.infinispan.query">
<resources>
<resource-root path="avro-1.5.1.jar"/>
<resource-root path="hibernate-commons-annotations-4.0.1.Final.jar"/>
<resource-root path="hibernate-search-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-analyzers-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-engine-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-orm-4.1.0.Beta1.jar"/>
<resource-root path="infinispan-query.jar"/>
<resource-root path="jackson-core-asl-1.9.2.jar"/>
<resource-root path="jackson-mapper-asl-1.9.2.jar"/>
<resource-root path="lucene-analyzers-3.5.0.jar"/>
<resource-root path="lucene-core-3.5.0.jar"/>
<resource-root path="lucene-grouping-3.5.0.jar"/>
<resource-root path="lucene-highlighter-3.5.0.jar"/>
<resource-root path="lucene-memory-3.5.0.jar"/>
<resource-root path="lucene-misc-3.5.0.jar"/>
<resource-root path="lucene-smartcn-3.5.0.jar"/>
<resource-root path="lucene-spatial-3.5.0.jar"/>
<resource-root path="lucene-spellchecker-3.5.0.jar"/>
<resource-root path="lucene-stempel-3.5.0.jar"/>
<resource-root path="paranamer-2.3.jar"/>
<resource-root path="slf4j-api-1.6.1.jar"/>
<resource-root path="snappy-java-1.0.4.1.jar"/>
<resource-root path="solr-analysis-extras-3.5.0.jar"/>
<resource-root path="solr-commons-csv-3.5.0.jar"/>
<resource-root path="solr-core-3.5.0.jar"/>
<resource-root path="solr-solrj-3.5.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="org.hibernate"/>
<module name="org.infinispan" services="import" export="true"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.io"/>
<module name="org.apache.commons.lang"/>
<module name="com.google.guava"/>
<module name="org.slf4j" export="true"/>
<module name="org.jboss.logging"/>
</dependencies>
修改 org.jboss.as.clustering.infinspan
模块 xml 以包含对新查询模块的依赖性以及对已存在的 org.hibernate
模块的依赖性。因此,将以下内容添加到该文件。
<module name="org.hibernate" services="import"/>
<module name="org.infinispan.query" services="import"/>
您的应用程序的 jboss-deployment-structure.xml 需要添加以下依赖项
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module export="true" name="org.hibernate" services="import"/>
<module export="true" name="org.infinispan" services="import"/>
<module export="true" name="org.infinispan.query" services="import"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
为了注释您的对象,以便它们可以被索引和搜索,我建议您查看样本 here
编辑:进一步注意:为了让索引对象真正共享缓存,我现在必须
关于java - 由于 SearchFactoryIntegrator 不在注册表中,无法在 JBoss 7 上查询 Infinispan,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18291687/
我不想使用 Infinispan 作为我的数据源。提供什么样的数据库支持?是否需要 Hibernate 二级缓存? 最佳答案 Infinispan 可以配置持久缓存加载器,并且在支持的选项中,支持基于
我刚刚尝试将我的应用程序更新到 Infinspan 10.1.8.Final。我通过 build.gradle 中的此依赖项将 Infinispan 用作 2 级休眠 (5.4.18.Final) 缓
我正在使用 Infinispan 缓存。有没有办法在运行时获取条目的 TTL(或 lifepsan)?我看到界面CacheEntry作为 getLifespan() API,但我看不到如何获取 Cac
我们有三个服务必须位于集群中。因此,我们使用 Infinispan 来集群节点并在这些服务之间共享数据。成功重新启动后,有时我会遇到异常,并收到另一节点中左侧节点的“ View 已更改”事件。实际上所
我有以下 infinispan xml 并得到解析异常。javax.xml.stream.XMLStreamException:[行,列] 处的 ParseError:[3,36]消息:遇到意外元素“
我已将我的应用程序部署为 tomcat 6 服务上的 myApp1。由于一些要求,我复制了myApp1并粘贴到webapp下作为myApp2。现在我重新启动了tomcat并点击 myApp1 的网址。
我使用 infinispan-5.1.6.FINAL 作为远程缓存服务器和热棒协议(protocol)来访问它。但发现它没有按预期工作,即按照下面的配置,在 1ms 后不会驱逐键的缓存值
交叉张贴在 https://developer.jboss.org/thread/279735 假设我们有多个 docker 容器(每个都有 java webapps,所以本质上是多个 JVM),每个
我有一个使用 Infinispan 6.0.1.Final 的 Spring Boot 应用程序。我有两个类 A 和 B。B 扩展了 A。并且我有一个存储 B 类型对象的缓存。现在,我做了一个小更改,
在 jgroups 自动选择集群中对大约 180,000,000 条记录进行索引,一切正常(我索引和查询数据,结果似乎有效),但在每次启动和关闭时我都会遇到此类错误。这是我必须担心的实验模式造成的吗?
我们需要一个重新启动的持久缓存。主要目标是在启动时预加载尽可能多的数据。 因此要求是: 从磁盘存储预加载 从已使用热缓存运行的邻居节点预加载 看起来 Infinispan 可能是一个合适的选择,但
我编写了一个小型 infinispan 缓存 PoC(代码如下)来尝试评估 infinispan 性能。在运行它时,我发现对于我的配置 infinispan 显然不会从磁盘中清除缓存条目的旧副本,导致
我们使用 Infinispan 4.0 作为我们的缓存提供程序(我知道它有点过时,因为版本 9 是最新的)。话虽如此,我在阅读文档时有点困惑: Infinispan, by default, acqu
根据 infinispan 的文档:http://docs.jboss.org/infinispan/5.0/apidocs/ evict() API 不会从调用它的缓存存储上的集群中的任何其他缓存存
尝试在 thorntail project-defaults.yaml 上配置缓存,但是在尝试在 wildfly 上启动或部署时遇到以下问题。 错误必须在全局配置中设置传输才能定义集群缓存。 不确定我
环境 嵌入 Infinispan 9.4.18 3 个节点以复制模式缓存 RocksDB 存储(或其他,无关紧要) 重现步骤 创建基于 TCP 的集群 创建缓存 将实体添加到缓存 检查实体是否存储在每
如何将数据预加载到infinispan本地缓存?我有一个预先存在的应用程序表,其中包含键值对。我希望 infinispan 缓存表中的数据,当我读/写数据到缓存时,我希望基础表保持同步。 infini
我使用 JBoss 6.4 EAP 和 Infinispan 6。 org.infinispan infinispan-core 6.0.2.G1.Final 我有
我们使用具有 6 个实例的 JBoss 集群 (EAP 6.4.10),并大量使用捆绑的 Infinispan 5.2.11 来处理不同的内存网格用例。然而,它们中的大多数是分布式缓存(实际上是复制的
我们计划在客户端服务器模式下使用 Infinispan。该架构有许多客户端(客户端 1、客户端 2 等)和分布式 infinispan 网络。 我们需要定期更新缓存中的数据,比如每5小时更新一次。所有
我是一名优秀的程序员,十分优秀!