6 Replies Latest reply on Apr 7, 2009 9:34 AM by mielket

    JMS Transaction Manager

    fouquet.f

      Hi ,

       

      Have a problem with the transactionManager

       

      Hier is the JMS endpoint bean

       

       

        <jms:consumer service="damcap:PivotEnvoiJMSConsume"

                      endpoint="PivotEnvoiJMSConsume"

                      destinationStyle="queue"

                      destinationName="queue/PivotEnvoi"

                      connectionFactory="#connectionFactory"

                      targetService="damcap:ComSortPojoRoutage"

                      targetEndpoint="ComSortPojoRoutage"

                      transacted="xa" />

       

       

        <amqpool:xa-pool id="connectionFactory"

                         url="tcp://localhost:61616"

                         maxConnections="8"

                         transactionManager="#transactionManager" />

       

        <jencks:transactionManager

                  id="transactionManager"

                  transactionLogDir="./data/txlogjms"

                  defaultTransactionTimeoutSeconds="600" />

       

       

      Hier is the stack strace

       

       

       

          at org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)

          at org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)

          at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:555)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:354)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:257)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:668)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:632)

          at java.util.TimerThread.mainLoop(Timer.java:512)

          at java.util.TimerThread.run(Timer.java:462)

      15:37:57,739 | WARN  | Timer-2    | AutoDeploymentService    | ramework.AutoDeploymentService  671 | Directory: hotdeploy: Automatic install of D:\Mes Documents\server\fuse\hotdeploy\ComSort-SA-0.0.1-SNAPSHOT.zip failed

      javax.jbi.management.DeploymentException: Failed to update Service Assembly: ComSort-SA

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:369)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:257)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:668)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:632)

          at java.util.TimerThread.mainLoop(Timer.java:512)

          at java.util.TimerThread.run(Timer.java:462)

      Caused by: java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>

      <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message" version="1.0">

      <jbi-task-result>

      <frmwk-task-result>

      <frmwk-task-result-details>

      <task-result-details>

      <task-id>deploy</task-id>

      <task-result>FAILED</task-result>

      <message-type>ERROR</message-type>

      </task-result-details>

      </frmwk-task-result-details>

      </frmwk-task-result>

      <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

          <component-name>servicemix-file</component-name>

          <component-task-result-details>

              <task-result-details>

                  <task-id>deploy</task-id>

                  <task-result>SUCCESS</task-result>

              </task-result-details>

          </component-task-result-details>

      </component-task-result>

      <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

          <component-name>servicemix-jms</component-name>

          <component-task-result-details>

              <task-result-details>

                  <task-id>deploy</task-id>

                  <task-result>FAILED</task-result>

                  <message-type>ERROR</message-type>

                  <task-status-msg>

      <msg-loc-info>

      <loc-token/>

      <loc-message>Could not deploy xbean service unit</loc-message>

      </msg-loc-info>

      </task-status-msg>

                  <exception-info>

                      <nesting-level>1</nesting-level>

                      <msg-loc-info>

                          <loc-token/>

                          <loc-message>Error creating bean with name 'org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint#0' defined in file : Cannot resolve reference to bean 'connectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in file : Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'url' of bean class : No property 'url' found</loc-message>

                          <stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint#0' defined in file : Cannot resolve reference to bean 'connectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in file : Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'url' of bean class : No property 'url' found

          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

          at java.security.AccessController.doPrivileged(Native Method)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

          at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86)

          at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)

          at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

          at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:520)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:354)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:257)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:668)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:632)

          at java.util.TimerThread.mainLoop(Timer.java:512)

          at java.util.TimerThread.run(Timer.java:462)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in file : Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'url' of bean class : No property 'url' found

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

          at java.security.AccessController.doPrivileged(Native Method)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

          ... 26 more

      Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'url' of bean class : No property 'url' found

          at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

          ... 35 more

      ]]></stack-trace>

                      </msg-loc-info>

                  </exception-info>

              </task-result-details>

          </component-task-result-details>

      </component-task-result>

      <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

          <component-name>servicemix-bean</component-name>

          <component-task-result-details>

              <task-result-details>

                  <task-id>deploy</task-id>

                  <task-result>SUCCESS</task-result>

              </task-result-details>

          </component-task-result-details>

      </component-task-result>

      </jbi-task-result>

      </jbi-task>

       

          at org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)

          at org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)

          at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:555)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:354)

          ... 6 more

        • 1. Re: JMS Transaction Manager
          mielket

          I am seeing the same problem here and am investigating.

          • 2. Re: JMS Transaction Manager
            mielket

            Using the url property seems to be out of date. Instead try the property brokerURL:

            <amqpool:xa-pool xmlns:amqpool="http://jencks.org/amqpool/2.0"
               id="connectionFactory2" 
               maxConnections="8"
               brokerURL="tcp://localhost:61616"
               transactionManager="#transactionManager" />
            

             

            • 3. Re: JMS Transaction Manager
              fouquet.f

              Hi ,

               

              Thanks again for your quick reply

               

              the new bean is good but I have another question

              when configuring this bean I must declare a transactionManager and by the way i can't use the same directory data/txlog so I must declare a unik transaction directory for each SU like that

               

               

              Have you any explanation to understand better this choice ?

               

               

               

              Regards

              • 4. Re: JMS Transaction Manager
                mielket

                There is no need to declare your own transaction manager in xbean.xml.

                Have a look at conf/tx.xml, it already defines a Jencks transaction manager:

                 

                  <jencks:transactionManager
                            id="transactionManager"
                            transactionLogDir="./data/txlog"
                            defaultTransactionTimeoutSeconds="600" />
                

                 

                Instead of defining your own, it is better to re-use what's already there.

                You can lookup that transaction manager using JNDI via this configuration in your xbean.xml

                 

                <jee:jndi-lookup xmlns:jee="http://www.springframework.org/schema/jee"
                            id="transactionManager" 
                            jndi-name="java:comp/env/smx/TransactionManager"/>
                

                 

                 

                which is the same as setting

                 

                <bean id="transactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName" value="java:comp/env/smx/TransactionManager"></property>
                </bean>
                

                 

                • 5. Re: JMS Transaction Manager
                  fouquet.f

                  Ok I understand ,

                  Why not sharing ConnectionFactory by the way for all Spring context ?

                   

                  Other question :

                  I have very poor performance using XA with JMS endpoint but it work very well in case of server crash .

                   

                  Does configuring a JCA will improve perf ?

                  In this case , have you an example a have difficulty to found example.

                   

                  Does Throttling on JMS consumer is include in Fuse ESB to improve performance like in OpenESB ?

                   

                  regards

                  • 6. Re: JMS Transaction Manager
                    mielket

                    Lets discuss your other question as part of ID-776.