• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPA Could not find Entity Manager.

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic