Hi, I having trouble using Bitronix with Apache Camel 2.4.0 and the
ActiveMQComponent with ActiveMQ 5.4.1.  When using Bitronix with the
ActiveMQComponent, I get the error below.  However, I don't seem to have
the problem when using Bitronix directly with a
DefaultMessageListenerContainer.  I am somewhat perplexed I do not see
anything special with how the ActiveMQComponent creates a
DefaultMessageListenerContain.

I attached a modified spring camel example that reproduces my problem.
The output from running this example is attached as well.  Do you have
any ideas why I have this problem when using the ActiveMQComponent in
Camel, but not when using DefaultMessageListenerContainer directly in a
non-camel environment?

**You may need to manually kill the java process when finished running
the example as I set a high receive timeout in the ActiveMQComponent.

010-11-24 17:39:56,710 WARN
[org.springframework.jms.listener.DefaultMessageListenerContainer]
(myThreadPoolExecutor-0) Setup of JMS message listener invoker failed
for destination 'testQueue' - trying to recover. Cause: null

java.lang.NullPointerException

        at
bitronix.tm.internal.XAResourceHolderState.start(XAResourceHolderState.j
ava:192)

        at
bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:89)

        at
bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:
74)

        at
bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTran
saction(TransactionContextHelper.java:51)

        at
bitronix.tm.resource.jms.MessageConsumerWrapper.enlistResource(MessageCo
nsumerWrapper.java:42)

        at
bitronix.tm.resource.jms.MessageConsumerWrapper.receive(MessageConsumerW
rapper.java:63)

        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
.receiveMessage(AbstractPollingMessageListenerContainer.java:405)

        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)

        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
.receiveAndExecute(AbstractPollingMessageListenerContainer.java:241)

        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe
ssageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java
:1056)

        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe
ssageListenerInvoker.run(DefaultMessageListenerContainer.java:952)

        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886)

        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908)

        at java.lang.Thread.run(Thread.java:619)

s833...@llvad00168060 /cygdrive/c/camel-example-spring-jms
$ /cygdrive/c/apache-maven-2.2.0/bin/mvn.bat compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel :: Example :: Spring :: JMS
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [antrun:run {execution: create-prop}]
[INFO] Executing tasks
     [echo] Maven version: 2.4.0
     [echo] OSGi version: 2.4.0
[INFO] Executed tasks
[INFO] [properties:read-project-properties {execution: default}]
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus
.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 3 resources
[INFO] [resources:resources {execution: default}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Dec 15 18:19:01 EST 2010
[INFO] Final Memory: 22M/40M
[INFO] ------------------------------------------------------------------------

s833...@llvad00168060 /cygdrive/c/camel-example-spring-jms
$ /cygdrive/c/apache-maven-2.2.0/bin/mvn.bat exec:java -PCamelServer
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel :: Example :: Spring :: JMS
[INFO]    task-segment: [exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
[pache.camel.spring.Main.main()] MainSupport                    INFO  Apache 
Camel 2.4.0 starting
[pache.camel.spring.Main.main()] CamelNamespaceHandler          INFO  
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
[pache.camel.spring.Main.main()] bstractCamelContextFactoryBean INFO  JMXAgent 
enabled: CamelJMXAgent[usePlatformMBeanServer=true, createConnector=true, 
statist
icsLevel=All]
[pache.camel.spring.Main.main()] BrokerService                  INFO  Using 
Persistence Adapter: MemoryPersistenceAdapter
[pache.camel.spring.Main.main()] BrokerService                  INFO  ActiveMQ 
5.3.2 JMS Message Broker (localhost) is starting
[pache.camel.spring.Main.main()] BrokerService                  INFO  For help 
or more information please see: http://activemq.apache.org/
[pache.camel.spring.Main.main()] TransportServerThreadSupport   INFO  Listening 
for connections at: tcp://localhost:61610
[pache.camel.spring.Main.main()] TransportConnector             INFO  Connector 
tcp Started
[pache.camel.spring.Main.main()] BrokerService                  INFO  ActiveMQ 
J MS Message Broker (localhost, ID:llvad00168060-1039-1292455149925-0:0) started
[pache.camel.spring.Main.main()] BitronixTransactionManager     INFO  Bitronix 
T ransaction Manager version 2.1.0
[pache.camel.spring.Main.main()] Configuration                  INFO  JVM 
unique ID: <spring-btm>
[pache.camel.spring.Main.main()] DiskJournal                    WARN  active 
log file is unclean, did you call BitronixTransactionManager.shutdown() at the 
end of the last run?
[pache.camel.spring.Main.main()] Recoverer                      INFO  recovery 
committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 
0 resource(s) [] (restricted to serverId 'spring-btm')
[pache.camel.spring.Main.main()] IncrementalRecoverer           INFO  
incremental recovery committed 0 dangling transaction(s) and rolled back 0 
aborted transaction(s) on resource [activeMQJmsFactory] (restricted to serverId 
'spring-btm')
[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Apache 
Camel 2.4.0 (CamelContext: camel) is starting
[pache.camel.spring.Main.main()] DefaultManagementAgent         INFO  JMX 
Connector thread started and listening at: 
service:jmx:rmi:///jndi/rmi://llvad00168060:1099/jmxrmi/camel
[pache.camel.spring.Main.main()] AnnotationTypeConverterLoader  INFO  Found 4 
packages with 15 @Converter classes to load
[pache.camel.spring.Main.main()] DefaultTypeConverter           INFO  Loaded 
146 type converters in 0.406 seconds
[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Route: 
test started and consuming from: 
Endpoint[activeMQComponent://testQueue?concurrentConsumers=1]
[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Route: 
route1 started and consuming from: Endpoint[jms://queue:numbers]
[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Started 
2routes
[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Apache 
Camel 2.4.0 (CamelContext: camel) started in 0.828 seconds
[aultMessageListenerContainer-1] efaultMessageListenerContainer WARN  Setup of 
JMS message listener invoker failed for destination 'testQueue' - trying to 
recover. Cause: null

Attachment: VIRUS_DETECTED_AND_REMOVED.TXT
Description: camel-example-spring-jms.zip

Reply via email to