Jboss EAP 6.3 deployment error: oracle datasource not found
Jboss EAP 6.3 deployment error: oracle datasource not found
部署时出现此错误:
20:02:42,954 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "jboss-employee-rooster-jsp.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"jboss-employee-rooster-jsp.war#primary\" is missing
[jboss.naming.context.java.jboss.datasources.OracleDS]"]}
这是我在 standalone.xml 中的 Oracle DS:
<datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS">
<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
<driver>oracleDriver</driver>
<security>
<user-name>SYSTEM</user-name>
<password>Seventy5</password>
</security>
</datasource>
<drivers>
<driver name="oracleDriver" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
Persistence.xml:
<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="primary">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/OracleDS</jta-data-source>
<class>org.jboss.as.quickstarts.employeerooster.model.Member</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
</properties>
</persistence-unit>
</persistence>
怎么了?
虽然很尴尬,但我不得不更换:
<datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS">
和
datasource jta="true" jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
部署时出现此错误:
20:02:42,954 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "jboss-employee-rooster-jsp.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"jboss-employee-rooster-jsp.war#primary\" is missing
[jboss.naming.context.java.jboss.datasources.OracleDS]"]}
这是我在 standalone.xml 中的 Oracle DS:
<datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS">
<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
<driver>oracleDriver</driver>
<security>
<user-name>SYSTEM</user-name>
<password>Seventy5</password>
</security>
</datasource>
<drivers>
<driver name="oracleDriver" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
Persistence.xml:
<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="primary">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/OracleDS</jta-data-source>
<class>org.jboss.as.quickstarts.employeerooster.model.Member</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
</properties>
</persistence-unit>
</persistence>
怎么了?
虽然很尴尬,但我不得不更换:
<datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS">
和
datasource jta="true" jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">