尝试创建StoredProcedureQuery时出现AbstractMethodError

时间:2019-03-01 10:40:27

标签: java hibernate jpa

我是JPA的新手,尝试使用JPA 2创建StoredProcedureQuery时遇到了一些麻烦

代码如下:

StoredProcedureQuery storedProcedure = manager.createStoredProcedureQuery("storedName");
storedProcedure.registerStoredProcedureParameter("param1", String.class, ParameterMode.OUT);
storedProcedure.registerStoredProcedureParameter("param2", String.class, ParameterMode.OUT);
storedProcedure.registerStoredProcedureParameter("param3", String.class, ParameterMode.OUT);
storedProcedure.registerStoredProcedureParameter("param4", String.class, ParameterMode.IN);
storedProcedure.registerStoredProcedureParameter("param5", String.class, ParameterMode.IN);

代码可以正常编译,但是当我尝试创建存储过程时,出现以下错误:

Exception in thread "main" java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerImpl.createStoredProcedureQuery(Ljava/lang/String;)Ljavax/persistence/StoredProcedureQuery;
at it.eustema.inps.async.protocollo.main.manager.adobe.AdobeStoredExecutorManager.storedName(AdobeStoredExecutorManager.java:16)
at it.eustema.inps.async.protocollo.main.Elaborazione.elabora(Elaborazione.java:100)
at it.eustema.inps.async.protocollo.main.AsyncProtocolloMain.start(AsyncProtocolloMain.java:23)
at it.eustema.inps.async.protocollo.main.AsyncProtocolloMain.main(AsyncProtocolloMain.java:19)

我进行了一些搜索,发现它可能是由于某些版本不匹配的jar版本引起的。我正在使用这些库:

antlr-2.7.7.jar
aopalliance.jar
axis.jar
c3p0-0.9.2.1.jar
ClientWsPortaleFlussiWs.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
commons-codec-1.7.jar
commons-discovery-0.4.jar
dom4j-1.6.1.jar
dom4j-1.6.jar
ehcache-core-2.4.3.jar
hibernate-commons-annotations-4.0.2.Final.jar
hibernate-core-4.2.2.Final.jar
hibernate-ehcache-4.2.2.Final.jar
hibernate-entitymanager-4.2.2.Final.jar
hibernate-envers-4.2.2.Final.jar
hibernate-jpa-2.1-api-1.0.0.final.jar
hibernate-validator-4.2.0.Final.jar
javassist-3.15.0-GA.jar
javax.jar
javax.persistence_2.1.0.v201304241213.jar
javax.servlet.jar
jboss-logging-3.1.0.GA.jar
jboss-logging-3.1.1.GA.jar
jboss-marshalling-1.3.15.GA.jar
jboss-marshalling-river-1.3.15.GA.jar
jboss-transaction-api_1.1_spec-1.0.1.Final.jar
jdom-2.0.1.jar
jgroups-3.2.0.CR1.jar
json-lib-2.4-jdk15.jar
json-rpc.jar
json_simple-1.1.jar
mail-1.4.1.jar
mchange-commons-java-0.2.3.4.jar
org.osgi.core-4.3.1.jar
org.springframework.transaction-3.1.2.RELEASE.jar
proxool-0.8.3.jar
rhq-pluginAnnotations-3.0.4.jar
slf4j-api-1.6.1.jar
slf4j-api-1.7.7.jar
spring-aop-4.1.1.RELEASE.jar
spring-aspects-4.1.1.RELEASE.jar
spring-beans-4.1.1.RELEASE.jar
spring-context-4.1.1.RELEASE.jar
spring-context-support-4.1.1.RELEASE.jar
spring-core-4.1.1.RELEASE.jar
spring-data-commons-1.9.1.RELEASE.jar
spring-data-jpa-1.7.1.RELEASE.jar
spring-data-jpa-2.1.1.RELEASE.jar
spring-expression-4.1.1.RELEASE.jar
spring-instrument-4.1.1.RELEASE.jar
spring-instrument-tomcat-4.1.1.RELEASE.jar
spring-jdbc-4.1.1.RELEASE.jar
spring-jms-4.1.1.RELEASE.jar
spring-messaging-4.1.1.RELEASE.jar
spring-orm-4.1.1.RELEASE.jar
spring-oxm-4.1.1.RELEASE.jar
spring-test-4.1.1.RELEASE.jar
spring-tx-4.1.1.RELEASE.jar
spring-web-4.1.1.RELEASE.jar
spring-webmvc-4.1.1.RELEASE.jar
spring-webmvc-portlet-4.1.1.RELEASE.jar
spring-websocket-4.1.1.RELEASE.jar
sqljdbc4-2.0.jar
stax2-api-3.1.1.jar
staxmapper-1.1.0.Final.jar
woodstox-core-asl-4.1.1.jar

0 个答案:

没有答案