You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tim Bain <tb...@alumni.duke.edu> on 2017/06/01 06:16:26 UTC

Re: ActiveMQ Embedded with Tomcat missing messages while restart

Can you please post the full stack trace for that exception?

Also, is the dataSource bean defined in your webapp's Spring config file,
or are you getting it from Tomcat?

Tim

On May 31, 2017 10:32 AM, "rsahadevan" <pr...@gmail.com> wrote:

> Hi All,
>
> Thanks in Advance.
>
> We have an ActiveMQ embedded running Tomcat with spring configuration.
> After
> Tomcat server restarts few records from the persisted queue are getting
> missed out. Below is my spring config. It seems the issue may be ActiveMQ
> embedded starting faster than tomcat and is not getting Hibernate
> connection
> for database. Could you please advise. While restart I am getting error
> like
> this
> java.lang.NullPointerException
>         at
> org.codehaus.groovy.grails.orm.hibernate.transaction.
> PlatformTransactionManagerProxy.getTransaction(
> PlatformTransactionManagerProxy.java:22)
>
>         <bean id="persistenceAdapter"
> class="org.apache.activemq.store.jdbc.JDBCPersistenceAdapter">
>         <property name="dataSource" ref="dataSource"/>
>         <property name="lockKeepAlivePeriod" value="2000"/>
>         <property name="createTablesOnStartup" value="false"/>
>     </bean>
>         <bean id="broker" class="org.apache.activemq.
> broker.BrokerService">
>                 <property name="useJmx" value="false" />
>                 <property name="persistent" value="true" />
>                 <property name="persistenceAdapter"
> ref="persistenceAdapter"/>
>                 <property name="transportConnectors">
>                         <list>
>                                 <ref bean="tcpConnector" />
>                                 <ref bean="vmConnector" />
>                         </list>
>                 </property>
>         </bean>
>
>         <bean id="tcpConnector"
> class="org.apache.activemq.broker.TransportConnector">
>                 <property name="uri" value="tcp://localhost:61616">
> </property>
>         </bean>
>         <bean id="vmConnector"
> class="org.apache.activemq.broker.TransportConnector">
>                 <property name="uri" value="vm://localhost"></property>
>         </bean>
>
>
>     <bean id="jmsConnectionFactory"
>
> class="org.springframework.jms.connection.TransactionAwareConnectionFact
> oryProxy">
>         <property name="targetConnectionFactory">
>             <bean class="org.apache.activemq.pool.PooledConnectionFactory"
> destroy-method="stop">
>                 <property name="connectionFactory">
>                     <bean
> class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="broker">
>                         <property name="brokerURL" value="vm://localhost"/>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>         <property name="synchedLocalTransactionAllowed" value="true" />
>     </bean>
>
>     <bean id="jmsTemplate" class="org.springframework.
> jms.core.JmsTemplate">
>         <property name="connectionFactory">
>             <ref local="jmsConnectionFactory"/>
>         </property>
>         <property name="sessionTransacted" value="true" />
>     </bean>
>
> Regards
> Viraj
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-Embedded-with-Tomcat-missing-messages-
> while-restart-tp4726828.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>