Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

错误信息:

Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
	at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1837)
	at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:769)
	at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
	at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
	at com.common.tool.util.CreateTable.main(CreateTable.java:33)

 产生原因:javaee.jar中的部分类与hibernate-jpa-2.0-api-1.0.0.Final.jar存在版本冲突

 解决办法:找到javaee.jar包所在的位置,用压缩工具打开,删除里面javax目录下的persistence文件夹即可。

 

posted @ 2012-10-19 12:54  の对的  阅读(1103)  评论(0)    收藏  举报