OneToOne.orphanRemoval()Z

错误提示:

 

Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1560)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:762)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:726)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:838)
at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:128)
at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:91)
at text.HibernateORmappingText.TextSchemaExpory(HibernateORmappingText.java:8)
at text.HibernateORmappingText.main(HibernateORmappingText.java:12)

 

原因hibernate的jar包里面加了那个ejb3的jar包与JPA包冲突 ejb删就OK了

 

这样下去就剩下一个包hibernate-jpa-2.0-api-1.0.1.Final.jar就可以了

posted on 2015-01-21 14:02  ziyi_ang  阅读(219)  评论(0编辑  收藏  举报

导航