Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在我的 EJB 项目中使用休眠搜索 4.5,我在 Wildfly 8.0 中部署该项目。但导入语句不起作用。有人可以告诉我如何在 Wildfly 中启用休眠搜索?
您需要在部署中启用该模块,文档中对此进行了描述:
http://docs.jboss.org/hibernate/search/4.5/reference/en-US/html_single/#search-configuration-deploy-on-wildfly
否则,您的应用程序的类加载器将无法“看到”该库,因此您必须明确标记哪些部署应该能够使用每个库。像 EJB 和 JPA 这样的基础服务会自动注入,因为 WildFly 可以识别它们,但除此之外,同样的技术也适用于其他模块。
好处是您可以在同一应用程序服务器中拥有相同库的多个版本,并在每个部署的应用程序中选择您想要独立使用的版本。