我有一个使用 spring、hibernate (3.6.4)、GWT(2.3)、drools 的 maven 项目......在我开始使用 hibernate OneToMany、ManyToMany 关系之前,一切都正常工作......
当我从“mvn jetty:run”运行应用程序时,它可以工作,但是当我从 gwt 嵌入式码头和我嵌入在我的应用程序中的码头版本运行应用程序时,我得到:
[INFO] Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
[INFO] at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1912)
[INFO] at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:796)
[INFO] at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:707)
[INFO] at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035)
[INFO] at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989)
[INFO] at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398)
[INFO] at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
[INFO] at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
[INFO] at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
[INFO] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
[INFO] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
[INFO] ... 95 more
这些是罐子:
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.6.11:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.6.11:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- net.sf.flexjson:flexjson:jar:2.1:compile
[INFO] +- org.apache.commons:commons-io:jar:1.3.2:compile
[INFO] +- org.springframework.roo:org.springframework.roo.annotations:jar:1.1.5.RELEASE:provided
[INFO] +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.0.5.RELEASE:test (scope not updated to compile)
[INFO] +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
[INFO] +- org.hsqldb:hsqldb:jar:1.8.0.10:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.4.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.6:compile
[INFO] | +- commons-collections:commons-collections:jar:3.1:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:3.6.4.Final:compile
[INFO] | \- javassist:javassist:jar:3.12.0.GA:compile
[INFO] +- org.hibernate:hibernate-validator:jar:4.1.0.Final:compile
[INFO] +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] +- cglib:cglib-nodep:jar:2.2:compile
[INFO] +- javax.transaction:jta:jar:1.1:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
[INFO] +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.3:compile
[INFO] +- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework.webflow:spring-js-resources:jar:2.2.1.RELEASE:compile
[INFO] +- commons-digester:commons-digester:jar:2.0:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- javax.servlet.jsp.jstl:jstl-api:jar:1.2:compile
[INFO] +- org.glassfish.web:jstl-impl:jar:1.2:compile
[INFO] +- javax.el:el-api:jar:1.0:provided
[INFO] +- joda-time:joda-time:jar:1.6:compile
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:compile
[INFO] +- commons-codec:commons-codec:jar:1.4:compile
[INFO] +- com.google.gwt:gwt-servlet:jar:2.3.0:compile
[INFO] +- com.google.gwt:gwt-user:jar:2.3.0:provided
[INFO] +- org.json:json:jar:20090211:compile
[INFO] +- com.google.gwt.inject:gin:jar:1.5.0:compile
[INFO] | +- com.google.inject:guice:jar:3.0-rc2:compile
[INFO] | | \- javax.inject:javax.inject:jar:1:compile
[INFO] | \- com.google.inject.extensions:guice-assistedinject:jar:3.0-rc2:compile
[INFO] +- javax.validation:validation-api:jar:sources:1.0.0.GA:compile
[INFO] +- xalan:xalan:jar:2.7.1:compile
[INFO] | \- xalan:serializer:jar:2.7.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.17:compile
[INFO] +- proj.Dependencies:advancedComponents:jar:2.0.6:compile
[INFO] +- proj.Dependencies:gwtent:jar:2.0RC1:compile
[INFO] +- proj.Dependencies:gwtent-orm:jar:2.0RC1:compile
[INFO] +- proj.Dependencies:gwt-crypto:jar:3.0.0:compile
[INFO] +- javax.mail:mail:jar:1.4.4:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- com.thoughtworks.paranamer:paranamer-generator:jar:2.3:compile
[INFO] | +- com.thoughtworks.qdox:qdox:jar:1.12:compile
[INFO] | \- asm:asm:jar:3.3:compile
[INFO] +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] +- com.lowagie:itext:jar:2.0.8:compile
[INFO] | +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO] | \- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO] +- proj.Dependencies:core-renderer:jar:8:compile
[INFO] +- proj.Dependencies:core-renderer-minimal:jar:8:compile
[INFO] +- proj.Dependencies:xml-apis-xerces:jar:2.9.1:compile
[INFO] +- org.apache.poi:poi:jar:3.8-beta4:compile
[INFO] +- org.apache.poi:poi-ooxml:jar:3.8-beta4:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.8-beta4:compile
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] | \- stax:stax-api:jar:1.0.1:compile
[INFO] +- proj.Dependencies:gwt_i18n_server:jar:1.0:compile
[INFO] +- org.mortbay.jetty:jsp-api-2.1-glassfish:jar:2.1.v20100127:compile
[INFO] +- org.mortbay.jetty:jsp-2.1-glassfish:jar:2.1.v20100127:compile
[INFO] | +- org.eclipse.jdt.core.compiler:ecj:jar:3.5.1:compile
[INFO] | \- ant:ant:jar:1.6.5:compile
[INFO] +- org.eclipse.jetty:jetty-server:jar:7.2.2.v20101205:compile
[INFO] | +- org.eclipse.jetty:jetty-continuation:jar:7.2.2.v20101205:compile
[INFO] | \- org.eclipse.jetty:jetty-http:jar:7.2.2.v20101205:compile
[INFO] | \- org.eclipse.jetty:jetty-io:jar:7.2.2.v20101205:compile
[INFO] +- org.eclipse.jetty:jetty-webapp:jar:7.2.2.v20101205:compile
[INFO] | \- org.eclipse.jetty:jetty-xml:jar:7.2.2.v20101205:compile
[INFO] | \- org.eclipse.jetty:jetty-util:jar:7.2.2.v20101205:compile
[INFO] +- org.eclipse.jetty:jetty-servlet:jar:7.2.2.v20101205:compile
[INFO] | \- org.eclipse.jetty:jetty-security:jar:7.2.2.v20101205:compile
[INFO] +- org.drools:drools-core:jar:5.3.1.Final:compile
[INFO] | \- org.mvel:mvel2:jar:2.1.0.drools4:compile
[INFO] +- org.drools:droolsjbpm-knowledge:pom:5.3.1.Final:compile
[INFO] +- org.drools:droolsjbpm-integration:pom:5.3.1.Final:compile
[INFO] +- org.drools:droolsjbpm-tools:pom:5.3.1.Final:compile
[INFO] +- org.drools:droolsjbpm-parent:pom:5.3.1.Final:compile
[INFO] +- org.drools.planner:drools-planner:pom:5.3.1.Final:compile
[INFO] +- org.drools:drools-multiproject:pom:5.3.1.Final:compile
[INFO] +- org.drools:knowledge-api:jar:5.3.1.Final:compile
[INFO] +- org.jbpm:jbpm-flow-builder:jar:5.2.0-SNAPSHOT:compile
[INFO] | \- org.jbpm:jbpm-flow:jar:5.2.0-SNAPSHOT:compile
[INFO] \- org.drools:drools-compiler:jar:5.3.1.Final:compile
[INFO] +- org.antlr:antlr-runtime:jar:3.3:compile
[INFO] +- org.antlr:antlr:jar:3.3:compile
[INFO] \- org.antlr:stringtemplate:jar:3.2.1:compile
我发现有人暗示这意味着有对 jpa 1.0 jar 的引用,但我似乎找不到...除了hibernate jpa 2.0 v. 1.0 final,找不到任何与jpa或持久性相关的东西。我的类路径上没有 ejb3-persistance.jar ......
我该怎么办?
非常感谢。