我正在尝试在 jboss 7 上运行耳朵,每次运行耳朵时都会收到此错误:
"缺少/不可用依赖项的服务" => ["jboss.persistenceunit.\"PROJECTNAME.jar#PROJECTNAMEPU\" 缺少 [ jboss.naming.context.java.PROJECTNAME ]"]
同样在此错误之前,我会为每个会话/实体 bean 获得此反馈;
INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor](MSC 服务线程 1-8)部署“PROJECTNAME.ear”的部署单元子部署“PROJECTNAME.war”中名为 SESSIONBEAN 的会话 bean 的 JNDI 绑定如下:
我试着查找它并找出我缺少的东西,有什么建议或帮助吗?
更新: 在我的独立.xml 中为 jboss
<datasource jndi-name="java:jboss/datasources/PROJECTNAME" enabled="true" use-java-context="true" pool-name="PROJECTNAME" use-ccm="false">
<connection-url>jdbc:oracle:thin:@SERVER:PORT:support</connection-url>
<driver>ojdbc14.jar</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>USERNAME</user-name>
<password>PASS</password>
</security>
</datasource>
<xa-datasource jndi-name="java:jboss/datasources/PROJECTNAME" pool-name="PROJECTNAME">
<driver>ojdbc14.jar</driver>
<xa-datasource-property name="URL">jdbc:oracle:thin:@SERVER</xa-datasource-property>
<xa-pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</xa-pool>
<security>
<user-name>USERNAME</user-name>
<password>PASS</password>
</security>
</xa-datasource>
<drivers>
<driver name="oracle" module="com.oracle.ojdbc14">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
我的 persitence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="PROJECTNAMEPU" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/PROJECTNAME</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>