什么是JBOSS-“java不允许空名称段”错误

我是JBOSS开发的新手,并试图从eclipse运行一个项目,但我得到“不允许java的空名称段”错误.我知道当我们的jndi资源名称为空时会出现这样的错误,但在这种情况下它指定为“env”而不是“java”,这在我的情况下.在下面发布我的堆栈跟踪.我正在使用JBOSS 7.1版本.

14:34:04,440 WARN  [org.jboss.as.ee] (MSC service thread 1-5) JBAS011001: Could not resolve resource-env-ref java:/TransactionManager
        14:34:04,440 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."workflow.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."workflow.war".INSTALL: Failed to process phase INSTALL of deployment "workflow.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_51]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_51]
        at java.lang.Thread.run(Thread.java:743) [rt.jar:1.6.0_51]
    Caused by: java.lang.IllegalArgumentException: Empty name segment is not allowed for java
        at org.jboss.msc.service.ServiceName.of(ServiceName.java:85) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceName.append(ServiceName.java:112) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:178)
        at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:190)
        at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:181)
        at org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:124)
        at org.jboss.as.naming.deployment.ContextNames.bindInfoForEnvEntry(ContextNames.java:165)
        at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:319)
        at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)
        at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:194)
        at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        ... 5 more

14:34:04,471 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "workflow.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"workflow.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"workflow.war\".INSTALL: Failed to process phase INSTALL of deployment \"workflow.war\""}}
    14:34:04,471 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
    JBAS014777:   Services which failed to start:      service jboss.deployment.unit."workflow.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."workflow.war".INSTALL: Failed to process phase INSTALL of deployment "workflow.war"

 14:34:04,471 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"workflow.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"workflow.war\".INSTALL: Failed to process phase INSTALL of deployment \"workflow.war\""}}}}
14:34:04,659 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment workflow.war in 184ms

我看到一个警告说JBAS011001:无法解析resource-env-ref java:/ TransactionManager但是不要认为错误是由它引起的.

请指导我.提前致谢.

Zebronix_777

解决方法:

我需要从standalone.xml中提到的数据源中删除java:/前缀.它解决了.因为在persistance.xml中它没有该前缀.

上一篇:java – 带有mysql的Tomcat:“无法为连接URL’null’创建类”的JDBC驱动程序”


下一篇:java – ActiveMQ JNDI查找问题