今天用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

解决方案 »

  1.   

    我有导入以下jar包
    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
      

  2.   

    hibernate-jpa-2.0-api-1.0.0.Final
    和MyEclipse自带的javaee.jar包冲突了
    我自己的解决方法:
    Window--Preferences--MyEclipse Enterprise Workbench--Java Enterprise Project--Library Sets
    在Java EE 5.0 标签栏删除javaee.jar记得给分!
      

  3.   

    移除javaee.jar这个jar的类没有了,比如httprequest类没有了怎么进行开发啊