-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: persistence.xml does not support namespace
PostPosted: Tue Aug 04, 2015 4:30 pm 
Newbie

Joined: Tue Aug 04, 2015 4:22 pm
Posts: 1
Dear,

I just try to custom my persistence.xml with a namespace : xmlns:persistence="http://java.sun.com/xml/ns/persistence". It looks like hibernate do not like it because if I don't use it it works perfectly.

For example :

It's work :
Code:
<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="demojpa-pu">
      <properties>
         <property name="hibernate.archive.autodetection" value="class" />
         <property name="hibernate.format_sql" value="true" />
         <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
         <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/demojpa" />
         <property name="javax.persistence.jdbc.user" value="root" />
         <property name="javax.persistence.jdbc.password" value="formation" />
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
         <property name="hibernate.hbm2ddl.auto" value="create" />
      </properties>
   </persistence-unit>
</persistence>


It does not work :
Code:
<persistence:persistence version="2.0"
   xmlns:persistence="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:persistence-unit name="demojpa-pu">
      <persistence:properties>
         <persistence:property name="hibernate.archive.autodetection" value="class" />
         <persistence:property name="hibernate.format_sql" value="true" />
         <persistence:property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
         <persistence:property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/demojpa" />
         <persistence:property name="javax.persistence.jdbc.user" value="root" />
         <persistence:property name="javax.persistence.jdbc.password" value="formation" />
         <persistence:property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
         <persistence:property name="hibernate.hbm2ddl.auto" value="create" />
      </persistence:properties>
   </persistence:persistence-unit>
</persistence:persistence>


I tried with EclipseLink, EclipseLink supports namespace.

What do you think ? It's a bug ?
Thanks for your advice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.