0 Replies Latest reply: Feb 12, 2013 5:03 AM by user1415307 RSS

    Spring and Jms message: no message in the queue

    user1415307
      Hi all,
      this is my application
      Spring 3.0.5 + Oc4j 10.1.3.3 + Oracle DB + Oracle Aq
      This is the flow:
      1. Update datas
      2. Send jms message

      The application updates correctly datas, in the same transaction sends a message to an oracle jms queue but the queue table is empty.
      Transaction starts with method avvService.updateStatoService()

      This is a log snapshot
      2013-02-07 11:04:48,982 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:365) CLIENT: HOST: - Creating new transaction with name [it.mycompany.gevi.service.avvenimenti.AvvenimentoService.updateStatoAvvenimentoService]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-java.lang.Exception 
      2013-02-07 11:04:52,340 [DEBUG] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO.updateService - getStatement  
      2013-02-07 11:04:52,340 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - SQL is: 
                UPDATE TABLE_NAME
                SET STATO = ?
                WHERE COD = ?
                 
      2013-02-07 11:04:52,918 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - {1=1, 2=1200300146} 
      2013-02-07 11:04:52,949 [INFO] it.mycompany.gevi.service.GenericService.updateService(GenericService.java:50) CLIENT: HOST: - Risultato updateService:1 
      2013-02-07 11:04:52,965 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:470) CLIENT: HOST: - Participating in existing transaction 
      2013-02-07 11:04:53,730 [DEBUG] org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:464) CLIENT: HOST: - Executing callback on JMS Session: oracle.jms.AQjmsSession@ee2a92 
      2013-02-07 11:04:54,167 [DEBUG] org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:567) CLIENT: HOST: - Sending created message: oracle.jms.AQjmsTextMessage@27fdb9 
      2013-02-07 11:04:54,526 [INFO] it.mycompany.gevi.service.JMSSenderService.sendMessage(JMSSenderService.java:64) CLIENT: HOST: - JSM Message Sent! 
      2013-02-07 11:04:54,526 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:752) CLIENT: HOST: - Initiating transaction commit 
      Spring bean configuration file
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx" 
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:jee="http://www.springframework.org/schema/jee"
           xmlns:orcl="http://www.springframework.org/schema/data/orcl" 
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="
                http://www.springframework.org/schema/beans 
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/tx
                http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
                http://www.springframework.org/schema/aop
                http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                http://www.springframework.org/schema/context 
                http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/task 
                http://www.springframework.org/schema/task/spring-task-3.0.xsd
                http://www.springframework.org/schema/data/orcl
                http://www.springframework.org/schema/data/orcl/spring-data-orcl-1.0.xsd
                http://www.springframework.org/schema/jee 
                http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"
           
           default-lazy-init="true" default-autowire="byName">
           
           <jee:jndi-lookup id="geviDs" jndi-name="jdbc/DBGeviDS" />
           
           <jee:jndi-lookup id="geviAqAdmDs" jndi-name="jdbc/AQAdmGeviDS" />
           
           <orcl:aq-jms-connection-factory id="topicConnectionFactory" data-source="geviAqAdmDs" 
            connection-factory-type="TOPIC_CONNECTION" />
           
           <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
                <property name="sessionTransacted" value="true"/>
              <property name="connectionFactory" ref="topicConnectionFactory"/>
              <property name="explicitQosEnabled" value="true"/>
              <property name="timeToLive" value="60000"/>
              <property name="pubSubDomain" value="true"/>
              <property name="defaultDestinationName" value="VR_INFO_VAR_TOPIC"/>
          </bean> 
           
           <tx:jta-transaction-manager/>
      
           <tx:annotation-driven transaction-manager="transactionManager"  proxy-target-class="true" />
           
           <aop:config>
                <aop:pointcut id="genericServiceMethods" expression="execution(* it.mycompany.gevi.service..*Service.*(..))" />
                
                <aop:advisor pointcut-ref="genericServiceMethods" advice-ref="txServiceAdvice"/>
           </aop:config>
           
           <tx:advice id="txServiceAdvice" transaction-manager="transactionManager">
                <tx:attributes>
                     <tx:method name="read*Service" read-only="true"/>
                   <!-- Other methods use the default transaction settings (see below) -->
                   <tx:method name="insertReturning*Service"    propagation="REQUIRED" />
                   <tx:method name="create*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                   <tx:method name="delete*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                   <tx:method name="update*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                   <tx:method name="sendMessage" propagation="REQUIRED" rollback-for="java.lang.Exception" />
                </tx:attributes>
           </tx:advice>
      
           <bean name="genericService" class="it.mycompany.gevi.service.GenericService" />
           <bean name="avvService" class="it.mycompany.gevi.service.avvenimenti.AvvenimentoService"/>
           
           <bean name="jmsSender" class="it.mycompany.gevi.service.JMSSenderService" >
                <property name="jmsTemplate" ref="jmsTemplate"/>
           </bean>
           
      </beans>
      Thanks in advance.