javax.persistence.PersistenceException: [PersistenceUnit: klmsdb] Unable to build EntityManagerFacto
来源:互联网 发布:linux虚拟网桥 编辑:程序博客网 时间:2024/06/05 00:14
javax.persistence.PersistenceException: [PersistenceUnit: klmsdb] Unable to build EntityManagerFactory
在Stack Overflow找到解决方法,他没错,只不过给了个成功的例子:Stack Overflow
原persistence.xml
<?xml version="1.0" encoding="UTF-8" ?><persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="klmsdb" transaction-type="RESOURCE_LOCAL"> <properties> <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" /> <property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost/klmsdb;INIT=create schema IF NOT EXISTS sowa" /> <property name="javax.persistence.jdbc.user" value="sa" /> <property name="javax.persistence.jdbc.password" value="" /> <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.show_sql" value="true" /> </properties> </persistence-unit></persistence>
修改后的
<?xml version="1.0" encoding="UTF-8" ?><persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="klmsdb" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" /> <property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/klmsdb;INIT=create schema IF NOT EXISTS sowa" /> <property name="hibernate.connection.driver_class" value="org.h2.Driver" /> <property name="hibernate.connection.username" value="sa" /> <property name="hibernate.connection.password" value="" /> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.format_sql" value="false" /> </properties> </persistence-unit></persistence>
阅读全文
1 0
- javax.persistence.PersistenceException: [PersistenceUnit: klmsdb] Unable to build EntityManagerFacto
- javax.persistence.PersistenceException: [PersistenceUnit: cmf.server] Unable to build EntityManagerF
- Caused by: javax.persistence.PersistenceException: [PersistenceUnit: SimpleTe] Unable to build Entit
- 解决Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibe
- javax.persistence.PersistenceException 异常
- javax.persistence.PersistenceException
- javax.persistence.PersistenceException: invalid persistence.xml
- javax.persistence.PersistenceException: org.hibernate.PropertyAccessException
- javax.persistence.PersistenceException: No Persistence provider for EntityManager named ***
- javax.persistence.PersistenceException: No Persistence provider for EntityManager named ***
- javax.persistence.PersistenceException: No Persistence provider for EntityManager named ***
- javax.persistence.PersistenceException: No Persistence provider for EntityManager named userPU
- javax.persistence.PersistenceException: No Persistence provider for EntityManage
- [JPA错误]javax.persistence.EntityNotFoundException: Unable to find xxx
- [JPA错误]javax.persistence.EntityNotFoundException: Unable to find xxx
- hibernate实现jpa文档,persistence.xml配置问题(javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Canno
- [JPA] javax.persistence.EntityNotFoundException: Unable to find XXXX with id 0 问题原因
- [JPA] javax.persistence.EntityNotFoundException: Unable to find XXXX with id 0 问题原因
- Ubuntu——终端下安装deb安装包
- React-Native学习指南
- java util包
- 对象序列化后部分属性无故消失的解决办法
- 使用SASL机制的KAFKA集群的安装
- javax.persistence.PersistenceException: [PersistenceUnit: klmsdb] Unable to build EntityManagerFacto
- java 删除文件 目录 文件夹
- SQL join(inner join、left join、right join、full outer join、union、union all)的区别
- vcs和verdi的联合仿真
- Android中shape属性详解
- C# 委托/事件在Unity中的使用(续)
- 【字符串】字符串转为整数(atoi)
- Windows系统基础配置
- 乱码解决方案