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 Sullivan
Messages: 1
Registered: October 2013
Junior Member
Hi,
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(PersistenceXmlLoader.java:147)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:171)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:325)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:71)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.ics.npac.common.daowrapper.BaseService.<clinit>(BaseService.java:12)

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

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


Current Time: Fri Oct 31 22:27:22 GMT 2014

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

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