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: JPA persistence.xml cannot use namespace prefixes
PostPosted: Tue Jul 12, 2011 9:24 am 
Newbie

Joined: Tue Jul 12, 2011 9:10 am
Posts: 1
This stumped me for a long time and I couldn't find it referenced anywhere. I finally traced through the source. I kept getting this error:

"No Persistence provider for EntityManager named your-name-here"

It turns out I was using a namespace prefix for my persistence tags (assume namespace p is defined); i.e.

Code:
<p:persistence-unit name="pu">...</p:persistence>


Even though the XML is valid Hibernate cannot "see" these elements and throws the exception. I was able to resolve this by setting the default namespace: xmlns="http://java.sun.com/xml/ns/persistence" and then removing the namespace prefix from all my tags.

More accurately PersistenceXmlLoader.deploy() is trying to match a localName to a possibly qualifiedName.


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.