maven - camel-test-spring in intelliJ -
i trying use camel-test-spring maven , intellij
my test class looks this:
@runwith(springjunit4classrunner.class) @contextconfiguration("classpath:spring-test-config.xml") public class mytest { ... }
with maven testcases executed , work fine.
problem
if try run testcase intellij (right click on testcase/ run "xyz") following error occurs.
java.lang.nosuchmethoderror: org.springframework.beans.beanutils.instantiateclass(ljava/lang/class;ljava/lang/class;)ljava/lang/object; @ org.springframework.test.context.contextloaderutils.resolvecontextloader(contextloaderutils.java:118) @ org.springframework.test.context.contextloaderutils.buildmergedcontextconfiguration(contextloaderutils.java:594) @ org.springframework.test.context.contextloaderutils.buildmergedcontextconfiguration(contextloaderutils.java:560) @ org.springframework.test.context.testcontext.<init>(testcontext.java:99) @ org.springframework.test.context.testcontextmanager.<init>(testcontextmanager.java:121) @ org.springframework.test.context.junit4.springjunit4classrunner.createtestcontextmanager(springjunit4classrunner.java:119) @ org.springframework.test.context.junit4.springjunit4classrunner.<init>(springjunit4classrunner.java:108) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:39) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:27) @ java.lang.reflect.constructor.newinstance(constructor.java:513) @ org.junit.internal.builders.annotatedbuilder.buildrunner(annotatedbuilder.java:29) @ org.junit.internal.builders.annotatedbuilder.runnerforclass(annotatedbuilder.java:21) @ org.junit.runners.model.runnerbuilder.saferunnerforclass(runnerbuilder.java:59) @ org.junit.internal.builders.alldefaultpossibilitiesbuilder.runnerforclass(alldefaultpossibilitiesbuilder.java:26) @ org.junit.runners.model.runnerbuilder.saferunnerforclass(runnerbuilder.java:59) @ org.junit.internal.requests.classrequest.getrunner(classrequest.java:26) @ com.intellij.junit4.junit4ideatestrunner.startrunnerwithargs(junit4ideatestrunner.java:41) @ com.intellij.rt.execution.junit.junitstarter.preparestreamsandstart(junitstarter.java:212) @ com.intellij.rt.execution.junit.junitstarter.main(junitstarter.java:68) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ com.intellij.rt.execution.application.appmain.main(appmain.java:140)
in other questions suggestion spring available in multiple versions on classpath. can't figure out dependency wrong @ moment.
[info] --- maven-dependency-plugin:2.8:tree (default-cli) @ myproject --- [info] example.project:myproject:war:1.0.0-snapshot [info] +- example.project:myproject-webservice:jar:1.0.0-snapshot:compile [info] | \- org.apache.commons:commons-lang3:jar:3.3.1:compile [info] +- axis:axis:jar:1.4:compile [info] | +- org.apache.axis:axis-jaxrpc:jar:1.4:compile [info] | +- org.apache.axis:axis-saaj:jar:1.4:compile [info] | +- axis:axis-wsdl4j:jar:1.5.1:runtime [info] | +- commons-logging:commons-logging:jar:1.0.4:compile [info] | \- commons-discovery:commons-discovery:jar:0.2:runtime [info] +- org.apache.camel:camel-core:jar:2.14.1:compile [info] | \- com.sun.xml.bind:jaxb-impl:jar:2.2.7:compile [info] | +- com.sun.xml.bind:jaxb-core:jar:2.2.7:compile [info] | | +- javax.xml.bind:jaxb-api:jar:2.1:provided [info] | | | +- javax.xml.stream:stax-api:jar:1.0-2:provided [info] | | | \- javax.activation:activation:jar:1.1:provided [info] | | \- com.sun.istack:istack-commons-runtime:jar:2.16:compile [info] | \- com.sun.xml.fastinfoset:fastinfoset:jar:1.2.12:compile [info] | \- javax.xml.bind:jsr173_api:jar:1.0:compile [info] +- org.apache.camel:camel-ognl:jar:2.14.1:compile [info] | +- org.apache.servicemix.bundles:org.apache.servicemix.bundles.ognl:jar:3.0.8_1:compile [info] | \- org.apache.servicemix.bundles:org.apache.servicemix.bundles.javassist:jar:3.12.1.ga_3:compile [info] +- org.apache.camel:camel-cxf:jar:2.14.1:compile [info] | +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.2:compile [info] | | +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile [info] | | \- javax.annotation:javax.annotation-api:jar:1.2:compile [info] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.2:compile [info] | | +- xml-resolver:xml-resolver:jar:1.2:compile [info] | | +- asm:asm:jar:3.3.1:compile [info] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.2:compile [info] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.2:compile [info] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:3.0.2:compile [info] | | \- org.apache.cxf:cxf-rt-ws-policy:jar:3.0.2:compile [info] | | \- org.apache.neethi:neethi:jar:3.0.3:compile [info] | +- org.apache.cxf:cxf-rt-rs-security-oauth:jar:3.0.2:compile [info] | | +- org.apache.cxf:cxf-rt-rs-client:jar:3.0.2:compile [info] | | \- net.oauth.core:oauth-provider:jar:20100527:compile [info] | | \- net.oauth.core:oauth:jar:20100527:compile [info] | +- org.springframework:spring-core:jar:3.2.11.release:compile [info] | +- org.springframework:spring-beans:jar:3.2.11.release:compile [info] | +- org.springframework:spring-context:jar:3.2.11.release:compile [info] | +- org.apache.cxf:cxf-rt-features-clustering:jar:3.0.2:compile [info] | \- org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.2:compile [info] | +- org.apache.cxf:cxf-rt-wsdl:jar:3.0.2:compile [info] | | \- wsdl4j:wsdl4j:jar:1.6.3:compile [info] | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.2:compile [info] +- org.apache.camel:camel-cxf-transport:jar:2.14.1:compile [info] +- org.apache.camel:camel-jaxb:jar:2.14.1:compile [info] +- org.apache.camel:camel-http:jar:2.14.1:compile [info] | +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:compile [info] | +- commons-httpclient:commons-httpclient:jar:3.1:compile [info] | \- commons-codec:commons-codec:jar:1.9:compile [info] +- org.apache.camel:camel-spring:jar:2.14.1:compile [info] | +- org.springframework:spring-aop:jar:3.2.11.release:compile [info] | | \- aopalliance:aopalliance:jar:1.0:compile [info] | \- org.springframework:spring-tx:jar:3.2.11.release:compile [info] +- org.apache.camel:camel-spring-javaconfig:jar:2.14.1:compile [info] | \- org.apache.servicemix.bundles:org.apache.servicemix.bundles.cglib:jar:2.1_3_7:compile [info] +- org.apache.camel:camel-dozer:jar:2.14.1:compile [info] | \- net.sf.dozer:dozer:jar:5.5.1:compile [info] | +- commons-beanutils:commons-beanutils:jar:1.9.1:compile [info] | | \- commons-collections:commons-collections:jar:3.2.1:compile [info] | \- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile [info] +- org.apache.cxf:cxf-rt-transports-http:jar:3.0.2:compile [info] | \- org.apache.cxf:cxf-core:jar:3.0.2:compile [info] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile [info] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile [info] | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.1.0:compile [info] +- org.apache.camel:camel-jackson:jar:2.14.1:compile [info] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.1:compile [info] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile [info] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile [info] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.4.1:compile [info] +- org.springframework:spring-web:jar:3.2.11.release:compile [info] +- org.hibernate:hibernate-validator:jar:5.1.3.final:compile [info] | +- javax.validation:validation-api:jar:1.1.0.final:compile [info] | +- org.jboss.logging:jboss-logging:jar:3.1.3.ga:compile [info] | \- com.fasterxml:classmate:jar:1.0.0:compile [info] +- org.slf4j:slf4j-api:jar:1.7.5:compile [info] +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile [info] | \- log4j:log4j:jar:1.2.17:compile [info] \- org.apache.camel:camel-test-spring:jar:2.14.1:test [info] +- org.apache.camel:camel-test:jar:2.14.1:test [info] | \- junit:junit:jar:4.11:test [info] | \- org.hamcrest:hamcrest-core:jar:1.3:test [info] +- org.springframework:spring-test:jar:3.2.11.release:test [info] \- org.springframework:spring-expression:jar:3.2.11.release:compile
here bom dependency-management block:
<properties> <camel-version>2.14.1</camel-version> <cxf-version>3.0.2</cxf-version> <jaxb-api-version>2.1</jaxb-api-version> <spring-version>3.2.11.release</spring-version> <slf4j-version>1.7.5</slf4j-version> <junit.version>4.11</junit.version> <hamcrest-all.version>1.3</hamcrest-all.version> <hibernate-validator.version>5.1.3.final</hibernate-validator.version> </properties> <dependencymanagement> <dependencies> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-cxf</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-cxf-transport</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-jaxb</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-http</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-ognl</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-spring</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-spring-javaconfig</artifactid> <version>${camel-version}</version> <exclusions> <!-- don't want have spring-test compile time dependency --> <exclusion> <groupid>org.springframework</groupid> <artifactid>spring-test</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-dozer</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-jackson</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-test-spring</artifactid> <version>${camel-version}</version> <scope>test</scope> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>${hibernate-validator.version}</version> </dependency> <dependency> <groupid>javax.xml.bind</groupid> <artifactid>jaxb-api</artifactid> <version>${jaxb-api-version}</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.apache.cxf</groupid> <artifactid>cxf-rt-frontend-jaxws</artifactid> <version>${cxf-version}</version> </dependency> <dependency> <groupid>org.apache.cxf</groupid> <artifactid>cxf-rt-transports-http</artifactid> <version>${cxf-version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-core</artifactid> <version>${spring-version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>${spring-version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-test</artifactid> <version>${spring-version}</version> <scope>test</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-expression</artifactid> <version>${spring-version}</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>${slf4j-version}</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>${slf4j-version}</version> </dependency> </dependencies> </dependencymanagement>
it great if tell me dependency wrong.
thanks in advance,
max
edit 1:
i have changed dependency camel-test-spring3:
[info] \- org.apache.camel:camel-test-spring3:jar:2.14.1:test [info] +- org.apache.camel:camel-test:jar:2.14.1:test [info] | \- junit:junit:jar:4.11:test [info] | \- org.hamcrest:hamcrest-core:jar:1.3:test [info] +- org.springframework:spring-test:jar:3.2.11.release:test [info] \- org.springframework:spring-expression:jar:3.2.11.release:compile
but in intellij there still java.lang.nosuchmethoderror error. executin maven still works.
Comments
Post a Comment