今天用MyEclipse 8.5自动生成一个Web Project,在创建的对话框中我选用“Java EE 5.0”,在项目中加了hibernate3,但是测试时运行不了; 可当我选用“J2EE 1.4”,却一点问题都没有。
报的错误如下:18:07:24,736 INFO Version:43 - Hibernate Annotations 3.5.5-Final
18:07:24,784 INFO Environment:570 - Hibernate 3.5.5-Final
18:07:24,784 INFO Environment:603 - hibernate.properties not found
18:07:24,784 INFO Environment:781 - Bytecode provider name : javassist
18:07:24,799 INFO Environment:662 - using JDK 1.4 java.sql.Timestamp handling
18:07:25,002 INFO Version:37 - Hibernate Commons Annotations 3.2.0.Final
18:07:25,018 INFO Configuration:1518 - configuring from resource: /hibernate.cfg.xml
18:07:25,018 INFO Configuration:1495 - Configuration resource: /hibernate.cfg.xml
18:07:25,189 INFO Configuration:1633 - Configured SessionFactory: null
18:07:25,205 INFO HibernateSearchEventListenerRegister:75 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
18:07:25,283 INFO AnnotationBinder:529 - Binding entity from annotated class: com.courseDesign.po.Admin
18:07:25,361 INFO EntityBinder:501 - Bind entity com.courseDesign.po.Admin on table admin
Initial SessionFactory creation failed.java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
报的错误如下:18:07:24,736 INFO Version:43 - Hibernate Annotations 3.5.5-Final
18:07:24,784 INFO Environment:570 - Hibernate 3.5.5-Final
18:07:24,784 INFO Environment:603 - hibernate.properties not found
18:07:24,784 INFO Environment:781 - Bytecode provider name : javassist
18:07:24,799 INFO Environment:662 - using JDK 1.4 java.sql.Timestamp handling
18:07:25,002 INFO Version:37 - Hibernate Commons Annotations 3.2.0.Final
18:07:25,018 INFO Configuration:1518 - configuring from resource: /hibernate.cfg.xml
18:07:25,018 INFO Configuration:1495 - Configuration resource: /hibernate.cfg.xml
18:07:25,189 INFO Configuration:1633 - Configured SessionFactory: null
18:07:25,205 INFO HibernateSearchEventListenerRegister:75 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
18:07:25,283 INFO AnnotationBinder:529 - Binding entity from annotated class: com.courseDesign.po.Admin
18:07:25,361 INFO EntityBinder:501 - Bind entity com.courseDesign.po.Admin on table admin
Initial SessionFactory creation failed.java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
解决方案 »
- 关于Spring依赖注入问题
- 郁闷的问题,关于多线程操作ConcurrentHashMap!在线等
- 急急急急!ssh整合,保存不成功,大家帮帮忙啊
- String转换为double类型,棘手
- 请教 MAVEN 错误 ……急
- 大家帮忙看看这个面试题!
- 大虾,我看了 孙卫琴的<精通struts 基于mvc的java web设计与开发>,有一些弱弱的问题,望进来各位帮忙!
- 哪位高手能不能有一个struts+spirng+hibernate完整的增删改的dome版, 供我们这些新手学习|
- 弱智问题:一般bean与EJB有什么不同?
- 论一个java程序员需要什么样的功底,才能看懂源码?
- 一个面试题,大家过来看看怎么做啊
- 包含多个User类list<User>,对应数据库要怎么设计
antlr-2.7.6
commons-collections-3.1
dom4j-1.6.1
hibernate3
hibernate-jpa-2.0-api-1.0.0.Final
javassist-3.9.0.GA
jta-1.1
slf4j-api-1.5.8
log4j-1.2.16
slf4j-log4j-1.5.8
和MyEclipse自带的javaee.jar包冲突了
我自己的解决方法:
Window--Preferences--MyEclipse Enterprise Workbench--Java Enterprise Project--Library Sets
在Java EE 5.0 标签栏删除javaee.jar记得给分!