We also encountered this if the start method was called directly in the
activator. It seems that the connection/session thread of ActiveMQ conflicts
with the OSGi classloader (we saw some hint in the error log). We know call
start() in a Job (org.eclipse.core.runtime.jobs.Job) which is executed
asynchronous. I don't know if this is the right solution but it works for
us.


AFinnell wrote:
> 
> ActiveMQ version: 5.2, 5.1, 4.1.1 
> Eclipse Equinox OSGi Version: 3.4 
> JVM: 1.6.0_11 
> 
> I have a very simple example to illustrate the problem I am experiencing.
> Connect to an ActiveMQ broker within a simple OSGi Equinox container. The
> connection either fails or takes over 15 seconds to establish the
> connection. Something is interferring with the ActiveMQ connection and I
> can't figure out what. This doesn't happen outside of the OSGi framework.
> 
> Put the following code in the start() method of a plugin and run the
> plugin by itself. 
> 
> ActiveMQConnectionFactory connectionFactory = 
>       new ActiveMQConnectionFactory("tcp://localhost:61616"); 
> 
> TopicConnection connection = 
>            (TopicConnection) connectionFactory.createTopicConnection(); 
> 
> System.out.println ("Starting connection"); 
> connection.start(); // <-- this takes over 15 seconds.
> System.out.println("Connection established"); 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Will-pay-%24-to-fix-problem-with-connections-failing.-Simple-example-included.-tp22163371p22163615.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to