This content has been marked as final.
Show 4 replies
-
1. Re: JBoss5.0.0.CR1 and EJB3 persistence
jaikiran Jul 17, 2008 6:41 AM (in response to jc7442)<persistence-unit name="audittrail"> <jta-data-source>java:/DemoDS</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> </properties> <!-- ../ is a workaround for http://jira.jboss.com/jira/browse/EJBTHREE-724 --> <!--jar-file>../demo-1.0-SNAPSHOT.jar</jar-file--> <jar-file>file:/D:/demo/demo.ear/demo-1.0-SNAPSHOT.jar</jar-file> </persistence-unit>
Re-order the contents to move the jar-file element before the properties element as follows:<persistence 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_1_0.xsd" version="1.0"> <persistence-unit name="audittrail"> <jta-data-source>java:/DemoDS</jta-data-source> <!-- ../ is a workaround for http://jira.jboss.com/jira/browse/EJBTHREE-724 --> <!--jar-file>../demo-1.0-SNAPSHOT.jar</jar-file--> <jar-file>file:/D:/demo/demo.ear/demo-1.0-SNAPSHOT.jar</jar-file> <!--Jaikiran: Moved this after the jar-file element --> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> </properties> </persistence-unit> </persistence>
-
2. Re: JBoss5.0.0.CR1 and EJB3 persistence
jaikiran Jul 17, 2008 6:47 AM (in response to jc7442)"jaikiran" wrote:
Re-order the contents to move the jar-file element before the properties element
Having said that, i am not sure whether the xml validation should be strict on the ordering of the child elements of persistence-unit. -
3. Re: JBoss5.0.0.CR1 and EJB3 persistence
jaikiran Jul 17, 2008 7:16 AM (in response to jc7442)"jaikiran" wrote:
Having said that, i am not sure whether the xml validation should be strict on the ordering of the child elements of persistence-unit.
Just looked at the XSD http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd. The elements in the persistence-unit are enclosed within a <xsd:sequence> and so the order IS important. So yes, changing the order in your persistence.xml is the right way to fix this exception. -
4. Re: JBoss5.0.0.CR1 and EJB3 persistence
jc7442 Jul 17, 2008 9:13 AM (in response to jc7442)Thank you. I haven't take care to the order.