You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by avin98 <av...@yahoo.com> on 2006/12/08 02:13:25 UTC

ActiveMQ connection problems

I have defined my JMS resources within the resource plan. I define a resource
adapter somewhat similar to this.
However the point of importance here is that I define my Active MQ to be
hosted on a different server location as follows:

<config-property-setting name="ServerUrl">
        tcp://server2:61616
</config-property-setting>


the problem that I am facing is that everytime, I restart the server2, I
need to correspondingly restart my server on localhost. Can this be avoided
somehow ?

I get a javax.jms.JMSException: syncSendTimedOut: connection no longer OK 

if I don't restart my server

---------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<connector
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
    <environment
        xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
        <moduleId>
            <groupId>console.jms</groupId>
            <artifactId>SampleResourceGroup</artifactId>
            <version>1.0</version>
            <type>rar</type>
        </moduleId>
        <dependencies>
            <dependency>
                <groupId>geronimo</groupId>
                <artifactId>activemq-broker</artifactId>
                <type>car</type>
            </dependency>
        </dependencies>
    </environment>

  <resourceadapter>
    <!-- how to connect to the JMS Server -->
    <resourceadapter-instance>
      <resourceadapter-name>
        My JMS Resources
      </resourceadapter-name>
      <config-property-setting name="ServerUrl">
        tcp://server2:61616
      </config-property-setting>
      <config-property-setting name="UserName">
        geronimo
      </config-property-setting>
      <config-property-setting name="Password">
        geronimo
      </config-property-setting>
      <workmanager>
        <gbean-link>DefaultWorkManager</gbean-link>
      </workmanager>
    </resourceadapter-instance>
    <!-- defines a ConnectionFactory -->
    <outbound-resourceadapter>
      <connection-definition>
        <connectionfactory-interface>
          javax.jms.ConnectionFactory
        </connectionfactory-interface>
        <connectiondefinition-instance>
          <name>MyConnectionFactory</name>
          <implemented-interface>
            javax.jms.QueueConnectionFactory
          </implemented-interface>
          <implemented-interface>
            javax.jms.TopicConnectionFactory
          </implemented-interface>
          <connectionmanager>
            <xa-transaction>
              <transaction-caching />
            </xa-transaction>
            <single-pool>
              <max-size>10</max-size>
              <min-size>0</min-size>
              <blocking-timeout-milliseconds>
                5000
              </blocking-timeout-milliseconds>
              <idle-timeout-minutes>
                0
              </idle-timeout-minutes>
              <match-one/>
            </single-pool>
          </connectionmanager>
        </connectiondefinition-instance>
      </connection-definition>
    </outbound-resourceadapter>
  </resourceadapter>
  <!-- defines a Topic -->
  <adminobject>
    <adminobject-interface>
      javax.jms.Topic
    </adminobject-interface>
    <adminobject-class>
      org.activemq.message.ActiveMQTopic
    </adminobject-class>
    <adminobject-instance>
      <message-destination-name>
        MyTopic
      </message-destination-name>
      <config-property-setting name="PhysicalName">
        MyTopic
      </config-property-setting>
    </adminobject-instance>
  </adminobject>
  <!-- defines a Queue -->
  <adminobject>
    <adminobject-interface>
      javax.jms.Queue
    </adminobject-interface>
    <adminobject-class>
      org.activemq.message.ActiveMQQueue
    </adminobject-class>
    <adminobject-instance>
      <message-destination-name>
        MyQueue
      </message-destination-name>
      <config-property-setting name="PhysicalName">
        MyQueue
      </config-property-setting>
    </adminobject-instance>
  </adminobject>
</connector>


-- 
View this message in context: http://www.nabble.com/ActiveMQ-connection-problems-tf2778169.html#a7751143
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ connection problems

Posted by avin98 <av...@yahoo.com>.
I am using Geronimo 1.1 which comes inbuilt with Active MQ 3.2.4

I modified all my resource adapters "serverUrls" to
reliable:tcp://server2:61616 

And deployed these, but they still don't seem to reconnect.

The error stack trace shows something like:

16:22:36,227 INFO  [ActiveMQManagedConnection] Error occured during close of
a JMS connection.
javax.jms.JMSException: syncSendTimedOut: connection no longer OK
	at
org.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1403)
	at
org.activemq.ActiveMQConnection.sendConnectionInfoToBroker(ActiveMQConnection.java:1628)
	at org.activemq.ActiveMQConnection.close(ActiveMQConnection.java:763)
	at
org.activemq.ra.ActiveMQManagedConnection.destroy(ActiveMQManagedConnection.java:225)
	at
org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalDestroy(SinglePoolConnectionInterceptor.java:121)
	at
org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.destroy(AbstractSinglePoolConnectionInterceptor.java:138)
	at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.destroy(ConnectionHandleInterceptor.java:75)
	at
org.apache.geronimo.connector.outbound.TCCLInterceptor.destroy(TCCLInterceptor.java:57)
	at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.destroy(ConnectionTrackingInterceptor.java:86)
	at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.doStop(AbstractConnectionManager.java:169)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.destroyInstance(GBeanInstance.java:1143)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStop(GBeanInstanceState.java:337)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:188)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:548)
	at
org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423)
	at
org.apache.geronimo.kernel.config.KernelConfigurationManager$ShutdownHook.run(KernelConfigurationManager.java:310)
	at
org.apache.geronimo.kernel.basic.BasicKernel.notifyShutdownHooks(BasicKernel.java:668)
	at
org.apache.geronimo.kernel.basic.BasicKernel.shutdown(BasicKernel.java:645)
	at org.apache.geronimo.system.main.Daemon$1.run(Daemon.java:259)





James.Strachan wrote:
> 
> Try using a failover URL
> 
> http://incubator.apache.org/activemq/how-can-i-support-auto-reconnection.html
> 
> On 12/8/06, avin98 <av...@yahoo.com> wrote:
>>
>> I have defined my JMS resources within the resource plan. I define a
>> resource
>> adapter somewhat similar to this.
>> However the point of importance here is that I define my Active MQ to be
>> hosted on a different server location as follows:
>>
>> <config-property-setting name="ServerUrl">
>>         tcp://server2:61616
>> </config-property-setting>
>>
>>
>> the problem that I am facing is that everytime, I restart the server2, I
>> need to correspondingly restart my server on localhost. Can this be
>> avoided
>> somehow ?
>>
>> I get a javax.jms.JMSException: syncSendTimedOut: connection no longer OK
>>
>> if I don't restart my server
>>
>> ---------------------------------------------------------------------------------------------------------------------------
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <connector
>>     xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
>>     <environment
>>         xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>         <moduleId>
>>             <groupId>console.jms</groupId>
>>             <artifactId>SampleResourceGroup</artifactId>
>>             <version>1.0</version>
>>             <type>rar</type>
>>         </moduleId>
>>         <dependencies>
>>             <dependency>
>>                 <groupId>geronimo</groupId>
>>                 <artifactId>activemq-broker</artifactId>
>>                 <type>car</type>
>>             </dependency>
>>         </dependencies>
>>     </environment>
>>
>>   <resourceadapter>
>>     <!-- how to connect to the JMS Server -->
>>     <resourceadapter-instance>
>>       <resourceadapter-name>
>>         My JMS Resources
>>       </resourceadapter-name>
>>       <config-property-setting name="ServerUrl">
>>         tcp://server2:61616
>>       </config-property-setting>
>>       <config-property-setting name="UserName">
>>         geronimo
>>       </config-property-setting>
>>       <config-property-setting name="Password">
>>         geronimo
>>       </config-property-setting>
>>       <workmanager>
>>         <gbean-link>DefaultWorkManager</gbean-link>
>>       </workmanager>
>>     </resourceadapter-instance>
>>     <!-- defines a ConnectionFactory -->
>>     <outbound-resourceadapter>
>>       <connection-definition>
>>         <connectionfactory-interface>
>>           javax.jms.ConnectionFactory
>>         </connectionfactory-interface>
>>         <connectiondefinition-instance>
>>           <name>MyConnectionFactory</name>
>>           <implemented-interface>
>>             javax.jms.QueueConnectionFactory
>>           </implemented-interface>
>>           <implemented-interface>
>>             javax.jms.TopicConnectionFactory
>>           </implemented-interface>
>>           <connectionmanager>
>>             <xa-transaction>
>>               <transaction-caching />
>>             </xa-transaction>
>>             <single-pool>
>>               <max-size>10</max-size>
>>               <min-size>0</min-size>
>>               <blocking-timeout-milliseconds>
>>                 5000
>>               </blocking-timeout-milliseconds>
>>               <idle-timeout-minutes>
>>                 0
>>               </idle-timeout-minutes>
>>               <match-one/>
>>             </single-pool>
>>           </connectionmanager>
>>         </connectiondefinition-instance>
>>       </connection-definition>
>>     </outbound-resourceadapter>
>>   </resourceadapter>
>>   <!-- defines a Topic -->
>>   <adminobject>
>>     <adminobject-interface>
>>       javax.jms.Topic
>>     </adminobject-interface>
>>     <adminobject-class>
>>       org.activemq.message.ActiveMQTopic
>>     </adminobject-class>
>>     <adminobject-instance>
>>       <message-destination-name>
>>         MyTopic
>>       </message-destination-name>
>>       <config-property-setting name="PhysicalName">
>>         MyTopic
>>       </config-property-setting>
>>     </adminobject-instance>
>>   </adminobject>
>>   <!-- defines a Queue -->
>>   <adminobject>
>>     <adminobject-interface>
>>       javax.jms.Queue
>>     </adminobject-interface>
>>     <adminobject-class>
>>       org.activemq.message.ActiveMQQueue
>>     </adminobject-class>
>>     <adminobject-instance>
>>       <message-destination-name>
>>         MyQueue
>>       </message-destination-name>
>>       <config-property-setting name="PhysicalName">
>>         MyQueue
>>       </config-property-setting>
>>     </adminobject-instance>
>>   </adminobject>
>> </connector>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ActiveMQ-connection-problems-tf2778169.html#a7751143
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-connection-problems-tf2778169.html#a7800081
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ connection problems

Posted by James Strachan <ja...@gmail.com>.
Try using a failover URL

http://incubator.apache.org/activemq/how-can-i-support-auto-reconnection.html

On 12/8/06, avin98 <av...@yahoo.com> wrote:
>
> I have defined my JMS resources within the resource plan. I define a resource
> adapter somewhat similar to this.
> However the point of importance here is that I define my Active MQ to be
> hosted on a different server location as follows:
>
> <config-property-setting name="ServerUrl">
>         tcp://server2:61616
> </config-property-setting>
>
>
> the problem that I am facing is that everytime, I restart the server2, I
> need to correspondingly restart my server on localhost. Can this be avoided
> somehow ?
>
> I get a javax.jms.JMSException: syncSendTimedOut: connection no longer OK
>
> if I don't restart my server
>
> ---------------------------------------------------------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector
>     xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
>     <environment
>         xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>         <moduleId>
>             <groupId>console.jms</groupId>
>             <artifactId>SampleResourceGroup</artifactId>
>             <version>1.0</version>
>             <type>rar</type>
>         </moduleId>
>         <dependencies>
>             <dependency>
>                 <groupId>geronimo</groupId>
>                 <artifactId>activemq-broker</artifactId>
>                 <type>car</type>
>             </dependency>
>         </dependencies>
>     </environment>
>
>   <resourceadapter>
>     <!-- how to connect to the JMS Server -->
>     <resourceadapter-instance>
>       <resourceadapter-name>
>         My JMS Resources
>       </resourceadapter-name>
>       <config-property-setting name="ServerUrl">
>         tcp://server2:61616
>       </config-property-setting>
>       <config-property-setting name="UserName">
>         geronimo
>       </config-property-setting>
>       <config-property-setting name="Password">
>         geronimo
>       </config-property-setting>
>       <workmanager>
>         <gbean-link>DefaultWorkManager</gbean-link>
>       </workmanager>
>     </resourceadapter-instance>
>     <!-- defines a ConnectionFactory -->
>     <outbound-resourceadapter>
>       <connection-definition>
>         <connectionfactory-interface>
>           javax.jms.ConnectionFactory
>         </connectionfactory-interface>
>         <connectiondefinition-instance>
>           <name>MyConnectionFactory</name>
>           <implemented-interface>
>             javax.jms.QueueConnectionFactory
>           </implemented-interface>
>           <implemented-interface>
>             javax.jms.TopicConnectionFactory
>           </implemented-interface>
>           <connectionmanager>
>             <xa-transaction>
>               <transaction-caching />
>             </xa-transaction>
>             <single-pool>
>               <max-size>10</max-size>
>               <min-size>0</min-size>
>               <blocking-timeout-milliseconds>
>                 5000
>               </blocking-timeout-milliseconds>
>               <idle-timeout-minutes>
>                 0
>               </idle-timeout-minutes>
>               <match-one/>
>             </single-pool>
>           </connectionmanager>
>         </connectiondefinition-instance>
>       </connection-definition>
>     </outbound-resourceadapter>
>   </resourceadapter>
>   <!-- defines a Topic -->
>   <adminobject>
>     <adminobject-interface>
>       javax.jms.Topic
>     </adminobject-interface>
>     <adminobject-class>
>       org.activemq.message.ActiveMQTopic
>     </adminobject-class>
>     <adminobject-instance>
>       <message-destination-name>
>         MyTopic
>       </message-destination-name>
>       <config-property-setting name="PhysicalName">
>         MyTopic
>       </config-property-setting>
>     </adminobject-instance>
>   </adminobject>
>   <!-- defines a Queue -->
>   <adminobject>
>     <adminobject-interface>
>       javax.jms.Queue
>     </adminobject-interface>
>     <adminobject-class>
>       org.activemq.message.ActiveMQQueue
>     </adminobject-class>
>     <adminobject-instance>
>       <message-destination-name>
>         MyQueue
>       </message-destination-name>
>       <config-property-setting name="PhysicalName">
>         MyQueue
>       </config-property-setting>
>     </adminobject-instance>
>   </adminobject>
> </connector>
>
>
> --
> View this message in context: http://www.nabble.com/ActiveMQ-connection-problems-tf2778169.html#a7751143
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/