java - Eclipse/Junit/Tomcat8/dbcp2 AbstractMethodError -


i getting following error when trying run junit tests eclipse. if deploy application , add ojdbc7.jar tomcat 8 lib have no problems.

caused by: java.lang.abstractmethoderror: oracle.jdbc.driver.oracleconnection.isvalid(i)z @ org.apache.commons.dbcp2.delegatingconnection.isvalid(delegatingconnection.java:914) @ org.apache.commons.dbcp2.poolableconnection.validate(poolableconnection.java:283) @ org.apache.commons.dbcp2.poolableconnectionfactory.validateconnection(poolableconnectionfactory.java:357) @ org.apache.commons.dbcp2.basicdatasource.validateconnectionfactory(basicdatasource.java:2304) @ org.apache.commons.dbcp2.basicdatasource.createpoolableconnectionfactory(basicdatasource.java:2287) @ org.apache.commons.dbcp2.basicdatasource.createdatasource(basicdatasource.java:2038) @ org.apache.commons.dbcp2.basicdatasource.getconnection(basicdatasource.java:1533) @ org.hibernate.engine.jdbc.connections.internal.datasourceconnectionproviderimpl.getconnection(datasourceconnectionproviderimpl.java:139) @ org.jadira.usertype.spi.shared.abstractusertypehibernateintegrator.use42api(abstractusertypehibernateintegrator.java:85) @ org.jadira.usertype.spi.shared.abstractusertypehibernateintegrator.integrate(abstractusertypehibernateintegrator.java:63) @ org.hibernate.internal.sessionfactoryimpl.<init>(sessionfactoryimpl.java:312) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1859) @ org.hibernate.jpa.boot.internal.entitymanagerfactorybuilderimpl$4.perform(entitymanagerfactorybuilderimpl.java:857) @ org.hibernate.jpa.boot.internal.entitymanagerfactorybuilderimpl$4.perform(entitymanagerfactorybuilderimpl.java:850) @ org.hibernate.boot.registry.classloading.internal.classloaderserviceimpl.withtccl(classloaderserviceimpl.java:425) @ org.hibernate.jpa.boot.internal.entitymanagerfactorybuilderimpl.build(entitymanagerfactorybuilderimpl.java:849) @ org.springframework.orm.jpa.vendor.springhibernatejpapersistenceprovider.createcontainerentitymanagerfactory(springhibernatejpapersistenceprovider.java:60) @ org.springframework.orm.jpa.localcontainerentitymanagerfactorybean.createnativeentitymanagerfactory(localcontainerentitymanagerfactorybean.java:343) @ org.springframework.orm.jpa.abstractentitymanagerfactorybean.afterpropertiesset(abstractentitymanagerfactorybean.java:318) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1633) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1570) ... 40 more 

i have added following projects pom.xml:

<dependency>     <groupid>com.oracle</groupid>     <artifactid>ojdbc7</artifactid>     <version>12.1.0.2</version> </dependency> 

and added jar repository using mvn install:install-file -dfile=c:\ojdbc7.jar -dgroupid=com.oracle -dartifactid=ojdbc7 -dversion=12.1.0.2 -dpackaging=jar

as issue in eclipse.

test-context:

    <bean id="spdatasource" class="org.apache.commons.dbcp2.basicdatasource"     destroy-method="close">     <property name="driverclassname" value="${db.driver}" />     <property name="url" value="${db.url}" />     <property name="username" value="${db.username}" />     <property name="password" value="${db.password}" /> </bean> 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -