3
간단한 EJB 프로젝트를 Jboss 7.1.1에 배포하려고합니다. 나는 H2 데이터베이스를 별도로 설치했다. 나는 또한 standalone.xmlpersistence.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="scube" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.sample.model.Property</class>
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
이클립스의 이름과 일치하는 persistence.xml을 편집 한 이제
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:tcp://localhost/~/test</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
이 포인트 : 다음과 같이
그래서 나는 standalone.xml 변경 오류가 있습니다 : java : jboss/datasources/ExampleDS
오류는 다음과 같습니다 :
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jta-data-source'. One of '{"http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/
xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode,
"http://java.sun.com/xml/ns/persistence":properties}' is expected.
유사한 오류를 찾고 모든 해상도에서 xml 요소의 순서가 중요하거나 jndi 이름이 일치하는 standalone.xml과 일치해야합니다.
누군가가 도와 줄 수 있습니까?
오, 나는 그것을보고 싶어요. 감사합니다 @ 피 오토 –