maven 2 - Spring 3.2.3 : activemq 5.5 dependency problems -
i'm trying upgrade project spring 3.2.3, spring 3.0.7. i'm stuck on problem activemq dependencies , can't figure out jar need or conflicting in first place. following stacktrace
org.unitils.core.unitilsexception: unable create application context locations [classpath:producerservicecontext-test.xml] @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:36) @ org.unitils.core.util.annotatedinstancemanager.getinstanceimpl(annotatedinstancemanager.java:234) @ org.unitils.core.util.annotatedinstancemanager.getinstance(annotatedinstancemanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.getapplicationcontext(applicationcontextmanager.java:65) @ org.unitils.spring.springmodule.getapplicationcontext(springmodule.java:235) @ org.unitils.spring.springmodule$1.isapplicablefor(springmodule.java:108) @ org.unitils.database.transaction.impl.defaultunitilstransactionmanager.gettransactionmanagementconfiguration(defaultunitilstransactionmanager.java:180) @ org.unitils.database.transaction.impl.defaultunitilstransactionmanager.starttransaction(defaultunitilstransactionmanager.java:96) @ org.unitils.database.databasemodule.starttransaction(databasemodule.java:410) @ org.unitils.database.databasemodule.starttransactionfortestmethod(databasemodule.java:381) @ org.unitils.database.databasemodule$databasetestlistener.beforetestsetup(databasemodule.java:535) @ org.unitils.core.unitils$unitilstestlistener.beforetestsetup(unitils.java:273) @ org.unitils.unitilsjunit4testclassrunner$testlistenerinvokingmethodroadie.runbeforesthentestthenafters(unitilsjunit4testclassrunner.java:151) @ org.junit.internal.runners.methodroadie.runtest(methodroadie.java:84) @ org.junit.internal.runners.methodroadie.run(methodroadie.java:49) @ org.unitils.unitilsjunit4testclassrunner.invoketestmethod(unitilsjunit4testclassrunner.java:95) @ org.junit.internal.runners.junit4classrunner.runmethods(junit4classrunner.java:61) @ org.unitils.unitilsjunit4testclassrunner.access$000(unitilsjunit4testclassrunner.java:44) @ org.unitils.unitilsjunit4testclassrunner$1.run(unitilsjunit4testclassrunner.java:62) @ org.junit.internal.runners.classroadie.rununprotected(classroadie.java:34) @ org.junit.internal.runners.classroadie.runprotected(classroadie.java:44) @ org.unitils.unitilsjunit4testclassrunner.run(unitilsjunit4testclassrunner.java:68) @ org.eclipse.jdt.internal.junit4.runner.junit4testreference.run(junit4testreference.java:50) @ org.eclipse.jdt.internal.junit.runner.testexecution.run(testexecution.java:38) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:467) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:683) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.run(remotetestrunner.java:390) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.main(remotetestrunner.java:197) caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'org.apache.activemq.xbean.xbeanbrokerservice#0' defined in class path resource [producerservicecontext-test.xml]: initialization of bean failed; nested exception java.lang.nosuchfielderror: null @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:529) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:458) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:292) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:626) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:932) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:479) @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:117) ... 28 more caused by: java.lang.nosuchfielderror: null @ org.springframework.expression.typedvalue.(typedvalue.java:32) @ org.springframework.expression.spel.support.standardevaluationcontext.setrootobject(standardevaluationcontext.java:88) @ org.springframework.expression.spel.support.standardevaluationcontext.(standardevaluationcontext.java:74) @ org.springframework.context.expression.standardbeanexpressionresolver.evaluate(standardbeanexpressionresolver.java:124) @ org.springframework.beans.factory.support.abstractbeanfactory.evaluatebeandefinitionstring(abstractbeanfactory.java:1312) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.evaluate(beandefinitionvalueresolver.java:225) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:201) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1387) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1128) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:519) ... 37 more
the following activemq pom dependencies
<dependency> <groupid>org.apache.activemq</groupid> <artifactid>activemq-core</artifactid> <version>5.5.0</version> </dependency> <dependency> <groupid>org.apache.activemq</groupid> <artifactid>activemq-pool</artifactid> <version>5.5.0</version> </dependency>
furthermore i'm using distribution bundle of spring 3.2.3. avoid copy pasting 1 here since quite dependencies , rather keep concise , point.
this applicationcontext won't load up
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <!-- lets create embedded activemq broker --> <amq:broker usejmx="false" persistent="false"> <amq:transportconnectors> <amq:transportconnector uri="tcp://localhost:0" /> </amq:transportconnectors> </amq:broker> <!-- activemq destinations use --> <amq:queue id="destination" physicalname="org.apache.activemq.spring.test.spring.embedded" /> <!-- jms connectionfactory use, configuring embedded broker using xml --> <amq:connectionfactory id="jmsfactory" brokerurl="vm://localhost?broker.persistent=false" /> <!-- spring jms template --> <bean id="fastjmstemplate" class="org.springframework.jms.core.jmstemplate"> <property name="connectionfactory"> <!-- lets wrap in pool avoid creating connection per send --> <bean class="org.springframework.jms.connection.singleconnectionfactory"> <property name="targetconnectionfactory"> <ref local="jmsfactory" /> </property> </bean> </property> </bean> <bean id="consumerjmstemplate" class="org.springframework.jms.core.jmstemplate"> <property name="connectionfactory" ref="jmsfactory" /> </bean> <bean id="fastjmsproducer" class="com.emakina.truvo.ssls.fast.service.util.fastjmsproducer"> <property name="template"> <ref bean="fastjmstemplate"></ref> </property> <property name="destination"> <ref bean="destination" /> </property> </bean> <bean id="consumer" class="com.emakina.truvo.ssls.fast.service.util.simplefastjmsconsumer"> <property name="template" ref="consumerjmstemplate" /> <property name="destination" ref="destination" /> </bean> </beans>
if came across same integration problem appreciate feedback.
i have found dependency causing problem. spring security still managing old version of it.
<dependency> <groupid>org.springframework</groupid> <artifactid>spring-expression</artifactid> <version>${org.springframework.version}</version> </dependency>
it seems spring-security bringing in spring-expression 3.0.7. caused problems activemq start it's broker since uses classes lib. found problem putting breakpoint on nosuchfield exception, , @ class stopped in , lib class belonged to. hope other people well.
in case had add dependency new spring version.
Comments
Post a Comment