我在JBoss服务器7.0上启动示例应用程序时遇到问题。 下面是开始日志:
12:19:10,156 ERROR [org.jboss.as](MSC服务主题1-7)JBoss AS 7.0.0.Final" Lightning" 16391ms开始(有错误) - 331个服务中的207个(67个服务失败或缺少依赖,57个服务是被动或按需) 12:19:10,361 INFO [org.jboss.as.server.controller](DeploymentScanner-threads - 2)部署" crm.war"回滚失败消息{"服务缺失/不可用依赖" => [" jboss.deployment.unit。\" crm.war \" .jndiDependencyService缺失[jboss.naming.context.java.module.crm.crm。\" env / br .com.crm.model.dao.ClienteDAOBean / emf \",jboss.naming.context.java.module.crm.crm。\" env / br.com.crm.model.dao.ContatoDAOBean /电动势\" ]"," jboss.deployment.unit。\" crm.war \" .component.br / com / crm / model / dao / ContatoDAORemote.START缺失[jboss.naming .context.java.module.crm.crm \" ENV / br.com.crm.model.dao.ContatoDAOBean /电动势\" ]"" jboss.persistenceunit \"#crm.war crmUnity \"缺少[jboss.naming.context.java.jdbc / CRMDS]"," jboss.deployment.unit。\" crm.war \" .component.br / com / crm /model/dao/ClienteRemoteDAO.START缺少[jboss.naming.context.java.module.crm.crm。\" env / br.com.crm.model.dao.ClienteDAOBean / emf \" ]"]} 12:19:10,443 INFO [org.jboss.as.server.deployment](MSC服务主题1-6)在82ms停止部署crm.war 12:19:10,445 ERROR [org.jboss.as.deployment](DeploymentScanner-threads - 1){"复合操作失败并被回滚。失败的步骤:" => {"操作步骤-2" => {"缺少/不可用依赖关系的服务" => [" jboss.deployment.unit。\" crm.war \" .jndiDependencyService缺失[jboss.naming.context.java.module.crm.crm。\" env / br .com.crm.model.dao.ClienteDAOBean / emf \",jboss.naming.context.java.module.crm.crm。\" env / br.com.crm.model.dao.ContatoDAOBean /电动势\" ]"," jboss.deployment.unit。\" crm.war \" .component.br / com / crm / model / dao / ContatoDAORemote.START缺失[jboss.naming .context.java.module.crm.crm \" ENV / br.com.crm.model.dao.ContatoDAOBean /电动势\" ]"" jboss.persistenceunit \"#crm.war crmUnity \"缺少[jboss.naming.context.java.jdbc / CRMDS]"," jboss.deployment.unit。\" crm.war \" .component.br / com / crm /model/dao/ClienteRemoteDAO.START缺少[jboss.naming.context.java.module.crm.crm。\" env / br.com.crm.model.dao.ClienteDAOBean / emf \" ]"]}}}
CRM-ds.xml中
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>CRMDS</jndi-name>
<connection-url>jdbc:hsqldb:file:database/crm</connection-url>
<driver>hsqldb.jar</driver>
<user-name>SA</user-name>
<password></password>
</local-tx-datasource>
</datasources>
的persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="crmUnity" transaction-type="JTA">
<jta-data-source>java:/CRMDS</jta-data-source>
<class>br.com.crm.model.entities.Cliente</class>
<class>br.com.crm.model.entities.Contato</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.showSql" value="true"/>
</properties>
</persistence-unit>
</persistence>
主要错误是:
错误[org.jboss.as.deployment](DeploymentScanner-threads - 1){&#34;复合操作失败并被回滚。失败的步骤:&#34; =&GT; {&#34;操作步骤-2&#34; =&GT; {&#34;缺少/不可用依赖关系的服务&#34; =&GT; [&#34; jboss.deployment.unit。\&#34; crm.war \&#34; .component.br / com / crm / model / dao / ClienteRemoteDAO.START缺少[jboss.naming.context.java。 。module.crm.crm \&#34; ENV / br.com.crm.model.dao.ClienteDAOBean /电动势\&#34; ]&#34;,&#34; jboss.deployment.unit。\&#34; crm.war \&#34; .component.br / com / crm / model / dao / ContatoDAORemote.START缺失[jboss.naming .context.java.module.crm.crm \&#34; ENV / br.com.crm.model.dao.ContatoDAOBean /电动势\&#34; ]&#34;,&#34; jboss.deployment.unit。\&#34; crm.war \&#34; .jndiDependencyService缺失[jboss.naming.context.java.module.crm.crm。\&# 34; env / br.com.crm.model.dao.ContatoDAOBean / emf \&#34;,jboss.naming.context.java.module.crm.crm。\&#34; env / br.com.crm。 model.dao.ClienteDAOBean /电动势\&#34; ]&#34;&#34; jboss.persistenceunit \&#34;#crm.war crmUnity \&#34;缺少[jboss.naming.context.java.java:CRMDS]&#34;]}}}
先谢谢你的帮助。
答案 0 :(得分:0)
此错误似乎是缺少数据源的实体管理器。确保persistence.xml和-ds.xml中的JNDI名称相同(例如,它们都应该是java:/ CRMDS)。
JBoss AS 7.0.0也非常过时,如果你要开始一个新项目,你应该使用更新的东西(Wildfly或JBoss EAP)。