我正在使用Eclipse和WildFly11开发一个基于maven的JSF+JPA+EJB3.2项目。启动应用程序服务器时,我收到以下错误:
20:37:27,664 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment erpmini.war
20:37:28,116 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-4) HV000001: Hibernate Validator 5.3.5.Final
20:37:28,552 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'UserManagementServiceSlsb' in deployment unit 'deployment "erpmini.war"' are as follows:
java:global/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
java:app/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
java:module/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
java:jboss/exported/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
java:global/erpmini/UserManagementServiceSlsb
java:app/erpmini/UserManagementServiceSlsb
java:module/UserManagementServiceSlsb
20:37:29,879 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."erpmini.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."erpmini.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "erpmini.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class com.itsys.erp.server.commonservices.usermgmt.slsbadapter.UserManagementServiceSlsb for component UserManagementServiceSlsb has errors:
WFLYJPA0033: Can't find a persistence unit named null in deployment "erpmini.war"
at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:157)
at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:186)
at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:143)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
20:37:30,098 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Chakra' 8.2.8.Final
20:37:31,825 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started client-mappings cache from ejb container
20:37:32,131 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "erpmini.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"erpmini.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"erpmini.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class com.itsys.erp.server.commonservices.usermgmt.slsbadapter.UserManagementServiceSlsb for component UserManagementServiceSlsb has errors:
WFLYJPA0033: Can't find a persistence unit named null in deployment \"erpmini.war\""},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"erpmini.war\".beanmanager"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"erpmini.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"erpmini.war\".beanmanager]",
"jboss.deployment.unit.\"erpmini.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"erpmini.war\".beanmanager]"
]
}
我正在无状态bean中注入EntityManager:
@Stateless
public class UserManagementServiceSlsb implements UserManagementService {
/** The Entity Manager */
@PersistenceContext(name = "TELCOAppPU")
private EntityManager entityManager;
private UserManagementService userMgmtService;
....
}
为什么容器找不到persistence.xml文件?persistence.xml存在于META-INF目录中。如有任何帮助,我们将不胜感激。多谢了。
更新:这里是项目目录结构,persistence.xml在META-INF目录中。
项目目录结构
xml包含实体类和MySql数据库连接细节。
<persistence-unit name="TELCOAppPU">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.itsys.erp.server.dal.entities.City</class>
<class>com.itsys.erp.server.dal.entities.Machine</class>
<class>com.itsys.erp.server.dal.entities.Product</class>
<class>com.itsys.erp.server.dal.entities.ProductType</class>
<class>com.itsys.erp.server.dal.entities.ProductionLog</class>
...
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/erpdb" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="root" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
通过将resources
文件夹(作为源文件夹)添加到路径src/main/resources
中,并将meta-inf
文件夹移动到resources
文件夹中,从而使maven将resources
目录下的所有文件放到目标/类
和WEB-INF/类
中。
问题内容: 我刚刚完成了重新安装操作系统的工作,并且像往常一样安装和测试了我使用的标准工具,现在当我尝试从eclipse启动Jboss 5时,出现了前所未有的错误: 以前有没有人遇到过类似的问题?到目前为止我从未遇到过 问题答案: 看起来像是JRE和OS版本的某些特定组合发生的错误(请参阅https://jira.jboss.org/jira/browse/JBAS-6981)。基本上,JBoss
我正在使用WildFly8.1和一个包含实体的EJB项目(EJB3.2)。当尝试将实体管理器注入到我的一个bean中时,我得到了以下信息: 这是我尝试注入EntityManager的SessionBean: 我指定了以下文件,并将其放入“project-name”/ejbmodule/meta-inf。 类似问题及其解决方法 找不到持久性单元建议包含persistence.xml 在Wildfly
我刚刚安装了Ruby193和Ruby200,在创建了一个新的应用程序之后,我正在尝试加载服务器,但是我得到了下面的错误。 我用gem'sqlite3'替换了sqlite3 gem,'~ 有人知道怎么修吗? Gemfile是 Bundle Show提供捆绑包中包含的宝石: actionmailer(3.2.13) actionpack(3.2.13) activemodel(3.2.13) acti
在IBM WebSphere application Server was 7中启动EJB应用程序时,我遇到了以下错误。 JPAPUnitInfo E CWWJP0015E:org.hibernate.ejb.HibernatePersistence 持久性提供程序在尝试为 *YOUR_PERSISTENCE_UNIT* 持久性单元创建容器实体管理器工厂时出错。出现以下错误: [持久性单位: *Y
Hibernate被设置为pom.xml中的依赖项: 当我们在Wildfly8和9上时,这些依赖关系运行良好。想知道我可能在配置中遗漏了什么?