您的位置:首页 > 编程语言 > Java开发

java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z 问题

2012-03-23 13:38 411 查看
一个简单一对一联系 两个类 其中一个用了@OnetoOne 注解
错误提示:
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.<init>(SchemaExport.java:128)

at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)

at text.HibernateORmappingText.TextSchemaExpory(HibernateORmappingText.java:8)

at text.HibernateORmappingText.main(HibernateORmappingText.java:12)

原因hibernate的jar包里面加了那个ejb3的jar包与JPA包冲突 ejb删就OK了
本次问题成功解决

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐