This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JPA Certification (OCEJPA) and the fly likes JPA Could not find Entity Manager. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » JPA Certification (OCEJPA)
Bookmark "JPA Could not find Entity Manager." Watch "JPA Could not find Entity Manager." New topic

JPA Could not find Entity Manager.

Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
Hi All,

I dontknow what the error mean, please help me...

I could not run any examples of JPA.

I just downloaded the example from java2s and its not working,

I know its problem in my system, But i dont know where to fix.

[java] 0 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA
[java] 16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
[java] 31 [main] INFO org.hibernate.cfg.Environment - not found
[java] 31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[java] 47 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[java] 109 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA
[java] 109 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.4.0.GA
[java] 130353 [main] ERROR org.hibernate.ejb.packaging.PersistenceXmlLoader - Error parsing XML: XML InputStream(154) The element type "meta" mus
t be terminated by the matching end-tag "</meta>".
[java] java.lang.ExceptionInInitializerError
[java] Caused by: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
[java] at org.hibernate.ejb.Ejb3Configuration.configure(
[java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(
[java] at javax.persistence.Persistence.createEntityManagerFactory(
[java] at javax.persistence.Persistence.createEntityManagerFactory(
[java] at Main.<clinit>(
[java] Caused by: org.xml.sax.SAXParseException: The element type "meta" must be terminated by the matching end-tag "</meta>".
[java] at
[java] at
[java] at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(
[java] at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(
[java] at org.hibernate.ejb.Ejb3Configuration.configure(
[java] ... 4 more
[java] Could not find the main class: Main. Program will exit.
[java] Exception in thread "main"

Bennet Xavier X.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32635

Can you show your persistence.xml file? It sounds like it might have mismatched XML tags.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
Hi Jeanne,

Only word which comes to my mind is "Wow"..

that was the problem. the <persistence> tag with wrong dtd mapping.

Thank You so much,

Bennet Xavier X.
I agree. Here's the link:
subject: JPA Could not find Entity Manager.
It's not a secret anymore!