[PersistenceUnit: <name>]: unable to build EntityManagerFactory

pijadura

New Member
As stated on the subject, my problem is the \[code\]EntityManagerFactory\[/code\] cannot be built. I am using Maven + Hibernate. I am connecting to a MySQL DB (\[code\]<jdbc://mysql://localhost:3306/<dbname>\[/code\]). The weird thing here is during debugging in Eclipse, it is working fine. But when I build it using Maven build, the JAR file is throwing such error. I checked the Manifest file already and all the necessary JARs were included in the Class-Path. Below is the error of the JAR displayed in the console:===========================================================================\[code\]Feb 3, 2012 5:01:16 PM org.hibernate.annotations.common.Version <clinit>INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}Feb 3, 2012 5:01:16 PM org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.0.1.Final}Feb 3, 2012 5:01:16 PM org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not foundFeb 3, 2012 5:01:16 PM org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassistFeb 3, 2012 5:01:16 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)Feb 3, 2012 5:01:16 PM class <name>.<name>.<name> <name>SEVERE: [ERROR]: [PersistenceUnit: <name>] Unable to build EntityManagerFactory[ERROR]: [PersistenceUnit: <name>] Unable to build EntityManagerFactory\[/code\]===========================================================================below is my persistence.xml:\[code\]<persistence xmlns="http://java.sun.com/xml/ns/persistence"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/persistencehttp://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"version="1.0"><persistence-unit name="<name>"><provider>org.hibernate.ejb.HibernatePersistence</provider><class>classname</class><properties><!-- <property name="hibernate.ejb.cfgfile" value="http://stackoverflow.com/classifyPE.cfg.xml"/> --><property name="hibernate.connection.driver_class" value="http://stackoverflow.com/questions/9126531/com.mysql.jdbc.Driver" /><property name="hibernate.connection.password" value="http://stackoverflow.com/questions/9126531/<value>" /><property name="hibernate.connection.url" value="http://stackoverflow.com/questions/9126531/jdbc:mysql://localhost:3306/<name>" /><property name="hibernate.connection.username" value="http://stackoverflow.com/questions/9126531/root" /><property name="hibernate.dialect" value="http://stackoverflow.com/questions/9126531/org.hibernate.dialect.MySQLDialect" /></properties></persistence-unit></persistence>\[/code\]===========================================================================What am I doing wrong here? Or what am I lacking?
As mentioned, it's working on Debug. But when I package it into JAR,(with all the necessary JARs present in the libs folder), it's not.
 
Top