Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA Could not find Entity Manager.

 
Bennet Xavier
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 - hibernate.properties 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(Ejb3Configuration.java:265)
[java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
[java] at Main.<clinit>(Main.java:10)
[java] Caused by: org.xml.sax.SAXParseException: The element type "meta" must be terminated by the matching end-tag "</meta>".
[java] at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
[java] at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
[java] at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:70)
[java] at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:89)
[java] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:222)
[java] ... 4 more
[java] Could not find the main class: Main. Program will exit.
[java] Exception in thread "main"

Thanks,
Bennet Xavier X.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show your persistence.xml file? It sounds like it might have mismatched XML tags.
 
Bennet Xavier
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic