Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » cvc-elt.1: error on jboss using Persistence.createEntityManagerFactory(getting cvc-elt.1: Cannot find the declaration of element 'persistence' error)
cvc-elt.1: error on jboss using Persistence.createEntityManagerFactory [message #1219826] Fri, 06 December 2013 04:07
Mike Sullivan is currently offline Mike SullivanFriend
Messages: 1
Registered: October 2013
Junior Member
I've been using EclipseLink 2.5.1 with JBoss EAP 6.1.0 successfully while using persistence injection:
@PersistenceContext(unitName = "NpacDao")
private EntityManager em;

In this case I need to explicitly call the em factory as I'm in a Bean Validation container, e.g.

EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpaTest1");

The call fails with (see complete log in attached server.log):
Caused by: javax.persistence.PersistenceException: Invalid persistence.xml.
Error parsing XML (line-1 : column -1): cvc-elt.1: Cannot find the declaration of element 'persistence'.
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(
at org.hibernate.ejb.Ejb3Configuration.configure(
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(
at javax.persistence.Persistence.createEntityManagerFactory(
at javax.persistence.Persistence.createEntityManagerFactory(
at com.ics.npac.common.daowrapper.BaseService.<clinit>(

When I call the same functionality from the eclipse JPA project in a java main there is no issue.

Any idea why this fails?
  • Attachment: persistence.xml
    (Size: 7.60KB, Downloaded 403 times)
  • Attachment: server.log
    (Size: 192.18KB, Downloaded 254 times)
Previous Topic:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
Next Topic:Retrieve joined element using criteria api
Goto Forum:

Current Time: Thu Apr 09 04:19:47 GMT 2020

Powered by FUDForum. Page generated in 0.05306 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top