- 浏览: 24625 次
文章分类
最新评论
javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at junit.test.PersonTest.<init>(PersonTest.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.runners.TestClassMethodsRunner.createTest(TestClassMethodsRunner.java:52)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:58)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:70)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:89)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:222)
... 20 more
今天做个JPA的列子,运行程序报以上错误。Google了一下,原来是persistence.xml文件中的注释写错造成的。汗.....
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at junit.test.PersonTest.<init>(PersonTest.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.runners.TestClassMethodsRunner.createTest(TestClassMethodsRunner.java:52)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:58)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:70)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:89)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:222)
... 20 more
今天做个JPA的列子,运行程序报以上错误。Google了一下,原来是persistence.xml文件中的注释写错造成的。汗.....
发表评论
-
spring activeMq 参考资料
2014-11-14 15:41 0Configuring ActiveMQ transactio ... -
启动和停止Java应用程序的Shell脚本
2013-08-08 00:05 2826转载:http://blog.csdn.net/jadyer/ ... -
解决 safari window.open 无法实现的问题
2013-07-09 15:11 2940今天在做浏览器兼容问题是,发现safari window.op ... -
由MyEclipse内存不足谈谈JVM内存
2013-06-07 18:37 738转载:http://www.javatang.co ... -
httpClient4的使用
2013-05-02 14:06 0参考地址: http://backend.blog.163.c ... -
ireport 分组求和
2013-01-09 17:22 3194在ireport中实现分组,求和。效果如下 name ... -
个人笔word 2007 失去焦点后鼠标无法编辑的解决方案 ( 转载),个人笔记
2012-12-28 10:08 988最近频繁的使用word 2007做文档,一填突然发现我的wor ... -
ireport使用javabean做数据源
2012-12-23 12:34 1104Java开源报表JasperReport、iReport4.5 ... -
2010-02-11 09:56 javascript转换字符串为json对象的方法
2012-07-04 01:30 0http://hi.baidu.com/zhwinde/ite ... -
httpClient请求服务器报javax.xml.stream.XMLStreamException: ParseErro错误
2012-06-06 09:34 2476今天用httpClient获取服务器端的xml数据时,报如下错 ... -
使用CA签发的服务器证书搭建Tomcat双向SSL认证服务
2012-03-23 16:28 0http://www.rsky.com.cn/Article/ ... -
HTTP Status 404(The requested resource is not available)的几种解决方法
2012-03-03 11:26 0http://blog.csdn.net/IBM_linghb ... -
Servlet.service() for servlet action threw exception错误
2012-02-14 22:48 1514今天在做项目时Servlet.service() for se ... -
web Service请求是报There must be a method name element错误
2011-09-24 14:35 6187今天写了个测试web Service客户端的程序报如下错误,查 ...
相关推荐
4.取变量时,如果dao层接口使用的是@param("别名")注解,则根据别名取值 5.mapper.xml中$和#取值的区别 4.mybatis的xml中如何设置返回值 resultType返回的数据类型 5.$和#区别 1. #将传入的数据都当成一个字符串,会...
在使用jpa时,比如我使用hibernate作为实现,默认情况下如果classpath下有bean validation实现会自动开启JSR-303验证。其通过Listener实现,即可以在如insert、update之前执行验证,如果验证失败会直接抛出验证失败...
使用aspectj是使用注解的方式,如果不能使用,也可以用XML配置文件来配置切面。 1 删除Audience类中所有关于切面的注解 恢复原先的三个方法,除了component注解以外的全部注解都删除。 2 修改beans.xml文件 7 在切点...
-- 异常处理,权限注解会抛出异常,根据异常返回相应页面 --> class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> ...
303数据校验、错误消息的显示及国际化、Ajax返回JSON、使用HttpMessageConverter、国际化_通过超链接切换中英文、文件上传、自定义的拦截器、拦截器的零Xml配置、异常处理(ExceptionHandler注解、 ...
driven配置、InitBinder注解、数据的格式化、JSR303数据校验、错误消息的显示及国际化、Ajax返回JSON、使用HttpMessageConverter、国际化_通过超链接切换中英文、文件上传、自定义的拦截器、拦截器的零Xml配置、异常...
通过注解绑定:小心抛出异常 使用命令/表单对象绑定 使用Servlet API对象作为入参 使用Spring的Servlet API代理类 使用IO对象作为入参 其他类型的参数 HttpMessageConverter HttpMessageConverter实现类 使用...
没有冗余代码生成和XML配置的要求使用类注解方式书写SQL语句, 简化XML配置,全部采用注解形式,内置Tomcat容器, 帮助开发者能够实现快速开发,SpringBoot的Web组件 默认集成的是SpringMVC框架。 SpringMVC是...
Bean、通过 FactoryBean 配置 Bean、通过注解配置 Bean、泛型依赖注入、AOP 基础、前置通知、后置通知、返回通知、异常通知、环绕通知、切面的优先级、切点表达式、使用 XML 文件的方式配置 AOP、使用 JdbcTemplate ...
sort编程语言+JAVAspring+Web服务+RESTful ...以及如何使用JAVAspring的Web服务来开发RESTful API,包括HTTP方法、URI、状态码、请求和响应的格式、JSON和XML的转换、异常处理等内容,以及一些配置文件和注解的用法。
flutter编程语言+JAVAspring+Web服务+RESTful...以及如何使用JAVAspring的Web服务来开发RESTful API,包括HTTP方法、URI、状态码、请求和响应的格式、JSON和XML的转换、异常处理等内容,以及一些配置文件和注解的用法。
事务简介 二、程序举例环境搭建 o1. 创建数据表 ...三、使用 Spring 的事务注解管理事务 o1. 声明事务管理器 o2. 开启注解驱动 o3. 完整Spring配置文件 o4. 业务层 public 方法加入事务属性 o5. 测试
SpringBoot 快速整合Mybatis(去XML化+注解进阶) SpringBoot 快速整合Mybatis(去XML化+通用Service) SpringBoot 快速整合SpringDataJPA (优雅篇) SpringBoot 快速开启事务(附常见坑点) 模板引擎 SpringBoot ...
5.1.9使用CGLIB以XML形式配置事务 130 5.2 Spring+Hibernate 131 5.2.1 HibernateTemplate模板 131 5.2.2 声明式事务 131 配置XML文件 131 拓展: 132 注解形式: 137 拓展: 138 6 Struts2+spring+hibernate 141 ...
测试spring事务管理 搭建了ssh框架的web工程 本工程用到的数据库表很简单 user(id, name) 可自行创建 本例所有的事务放在service层进行管理,方法中间抛出... 第5种方式:全注解 详见spring-core-transaction-5.xml
但这个不是绝对的,考虑到多线程的特性,可能有时候不会使用缓存超时控制@DataProvider注解支持配置超时,超时将引发中断异常(InterruptedException),伴随异常处理逻辑使用方法1.配置pom.xml < dependency>
4.10.2 使用注解配置信息启动Spring容器 4.10.3 自动装配Bean 4.10.4 Bean作用范围及生命过程方法 4.11 基于Java类的配置 4.11.1 使用Java类提供Bean定义信息 4.11.2 使用基于Java类的配置信息启动Spring容器 4.12 ...
适合对SSM没有使用过的同学,讲解通俗易懂,覆盖了当前SSM使用的基本操作 课程内容: 1、Spring简介及快速入门 2、Spring配置文件及其相应API 3、Spring注解开发 4、Spring web环境及其Junit的集成 5、Spring ...
4.10.2 使用注解配置信息启动Spring容器 4.10.3 自动装配Bean 4.10.4 Bean作用范围及生命过程方法 4.11 基于Java类的配置 4.11.1 使用Java类提供Bean定义信息 4.11.2 使用基于Java类的配置信息启动Spring容器 4.12 ...
后台全注解式的开发(除了必要的spring和hibernate的xml配置以外) 03. 后台通过自定义注解结合一个访问拦截器实现整个系统的权限控制 04. 系统前台采用全采用的Html+jQuery开发 05. 系统前台与后台的交互全部...