Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.2-r422266:898935 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property. |
|
A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
ConnectionDriverName属性没有配置,发下配置看看 |
|
34分 |
检查一下 数据源 配置, 看你的异常应该是 使用 JTA 事物 ,容器没有实例化 EntityManager
|
<persistence-unit name=”main-persistence” transaction-type=”RESOURCE_LOCAL”>
<class>org.hibernate.ejb.HibernatePersistence</class> <properties> <!– 数据库方言 –> <property name=”hibernate.dialect” value=”org.hibernate.dialect.MySQL5Dialect”/> <property name=”hibernate.connection.driver_class” value=”com.mysql.jdbc.Driver”/> <property name=”hibernate.connection.url” value=”jdbc:mysql://localhost:3306/sm?useUnicode=true&characterEncoding=utf-8″ /> <property name=”hibernate.connection.username” value=”root” /> <property name=”hibernate.connection.password” value=”root” /> <property name=”hibernate.cache.provider_class” value=”org.hibernate.cache.HashtableCacheProvider”/> <property name=”hibernate.show_sql” value=”true” /> <property name=”hibernate.jdbc.batch_size” value=”10″/> <property name=”connection.autoReconnect” value=”true”/> <property name=”connection.autoReconnectForPools” value=”true”/> <property name=”connection.is-connection-validation-required” value=”true”/> </properties> </persistence-unit> |
|
<persistence-unit name=”main-persistence” transaction-type=”RESOURCE_LOCAL”> |
|
<?xml version=”1.0″ encoding=”UTF-8″?>
<persistence xmlns=”http://java.sun.com/xml/ns/persistence” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”1.0″> <persistence-unit name=”coffee” transaction-type=”JTA”> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/oracleds)</jta-data-source> <class>com.inetpsa.coffee.example.representations.DepartmentRepresentation</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> 参考下, |
|
A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
说的清楚啊!你的driver的name找不到匹配的驱动!好像是driverClass不是driver_class! |
|
http://blog.csdn.net/dongja3/article/details/44617137
|