Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » ApacheMQ Provider(Difficulties getting ActiveMQ to work)
ApacheMQ Provider [message #1016807] Thu, 07 March 2013 18:11 Go to next message
Robert Onslow is currently offline Robert OnslowFriend
Messages: 13
Registered: April 2010
Junior Member
Phew. Can't get ApacheMQ to work.

I start ApacheMQ 5.3.2 on localhost at 61616

Then I start ActiveMQ JMS Server from org.eclipse.ecf.provider.jms.activemq pointing at tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000

No logging of any connection

Next I get a container and connect it - but no connection is logged at ApacheMQ, nor is any containerconnectedevent generated

I suspect that neither the server nor the client is connecting. I suspect that I am missing a step here.

Any ideas?

IContainer container = manager.getContainerFactory().createContainer("ecf.jms.activemq.tcp.client", new Object[]{"tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0", "1000000"});
final ISharedObjectContainer soc = (ISharedObjectContainer) ((IAdaptable) container).getAdapter(ISharedObjectContainer.
soc.addListener(new IContainerListener() {

 @Override
  public void handleEvent(
   IContainerEvent event) {
							         System.out.println(event.getClass().getName());
 if (event instanceof IContainerConnectedEvent)
  try {
									
									ISharedObjectManager manager = soc.getSharedObjectManager();
admin = new DistributedEventAdmin(context);
ID id1 = IDFactory.getDefault().createStringID("uk.co.xlegal.xbundle3.remote");
Properties props = new Properties();
									props.put(EventConstants.EVENT_TOPIC, "uk_co_xlegal_xbundle3_remote");

									manager.addSharedObject(id1, (ISharedObject) admin, props);
									((DistributedEventAdmin) admin).start();
									
									
									
} catch (Exception e) {
									Log.log(Log.ERROR, e.getMessage());
								}
							
						}
						
});
ID targetId = IDFactory.getDefault().createID(container.getConnectNamespace(), container.getID().getName());
container.connect(targetId, null);
				
Re: ApacheMQ Provider [message #1016813 is a reply to message #1016807] Thu, 07 March 2013 18:45 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 974
Registered: July 2009
Senior Member
Hi Robert,

Let's start just with the ECF Server process (forget about the client for a moment).

A couple of questions to help with diagnosis.

1) What code are you running to create the ECF server container? When I run the EventAdmin Server (activemq).product, it gets to AbstractEventAdminApplication.createConfigureAndConnectContainer() and when line 155 is executed I can see on the server console this is printed out [A] (this bogus exception output is actually an ActiveMQ 5.3.2 bug, but in this case it's helpful to see that the ECF server is actually connecting to the ActiveMQ broker). *Also*, after creating the server container (with containerId=ecftcp://localhost:61616/defaultTopic), in the ActiveMQ admin interface ( http://localhost:8161) that a 'defaultTopic' has been created in the ActiveMQ broker. All this happens on line 155 of AbstractEventAdminApplication.

2) Do you see any of what I report above? If not...there is something wrong with your server startup (which is what I suspect). It could be the syntax of your activemq uri...I will try yours to see if I can reproduce what you are seeing (using this example code).

[A]
Mar 07, 2013 10:32:33 AM org.apache.activemq.transport.tcp.TcpTransportFactory createTransport
WARNING: path isn't a valid local location for TcpTransport to use
java.lang.NumberFormatException: For input string: "/exampleTopic"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:481)
at java.lang.Integer.parseInt(Integer.java:527)
at org.apache.activemq.transport.tcp.TcpTransportFactory.createTransport(TcpTransportFactory.java:136)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:141)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSChannel.setupJMS(AbstractJMSChannel.java:161)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSServerChannel.<init>(AbstractJMSServerChannel.java:35)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQServerChannel.<init>(ActiveMQServerChannel.java:25)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQJMSServerContainer.start(ActiveMQJMSServerContainer.java:40)
at org.eclipse.ecf.internal.provider.jms.activemq.ActiveMQJMSServerContainerInstantiator.createInstance(ActiveMQJMSServerContainerInstantiator.java:64)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:296)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:315)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.createConfigureAndConnectContainer(AbstractEventAdminApplication.java:157)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.startup(AbstractEventAdminApplication.java:65)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.start(AbstractEventAdminApplication.java:105)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:722)



Re: ApacheMQ Provider [message #1016818 is a reply to message #1016813] Thu, 07 March 2013 19:18 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 974
Registered: July 2009
Senior Member
Hi Robert,

I just tried locally (using the AbstractEventAdminApplication) creating/starting the ECF JMS server container (i.e. containerType ecf.jms.activemq.tcp.manager), with this as the value for containerId

tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000

When I create the server container with this, it this is printed in the console (ActiveMQ bug):

Mar 07, 2013 11:08:21 AM org.apache.activemq.transport.tcp.TcpTransportFactory createTransport
WARNING: path isn't a valid local location for TcpTransport to use
java.lang.NumberFormatException: For input string: "/uk-co-xlegal-liveshow-annotation"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:481)
at java.lang.Integer.parseInt(Integer.java:527)
at org.apache.activemq.transport.tcp.TcpTransportFactory.createTransport(TcpTransportFactory.java:136)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:141)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSChannel.setupJMS(AbstractJMSChannel.java:161)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSServerChannel.<init>(AbstractJMSServerChannel.java:35)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQServerChannel.<init>(ActiveMQServerChannel.java:25)
at org.eclipse.ecf.provider.jms.activemq.container.ActiveMQJMSServerContainer.start(ActiveMQJMSServerContainer.java:40)
at org.eclipse.ecf.internal.provider.jms.activemq.ActiveMQJMSServerContainerInstantiator.createInstance(ActiveMQJMSServerContainerInstantiator.java:64)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:296)
at org.eclipse.ecf.core.ContainerFactory.createContainer(ContainerFactory.java:315)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.createConfigureAndConnectContainer(AbstractEventAdminApplication.java:157)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.startup(AbstractEventAdminApplication.java:65)
at org.eclipse.ecf.examples.internal.eventadmin.app.AbstractEventAdminApplication.start(AbstractEventAdminApplication.java:105)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:722)


And, when I consult the active mq admin webapp I see that this topic has been added:

uk-co-xlegal-liveshow-annotation

If I let just the server run, the test/example sender starts sending and handling/displaying these events:

handleEvent
topic=defaultTopic
message=message #58
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
handleEvent
topic=defaultTopic
message=message #59
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000
handleEvent
topic=defaultTopic
message=message #60
sender=tcp://localhost:61616/uk-co-xlegal-liveshow-annotation?wireFormat.maxInactivityDuration=0&wireFormat.maxInactivityDurationInitalDelay=10000


To summarize...so far I'm not reproducing the issue with the server (not connecting to the ActiveMQ broker)...so it might be something specific to either your startup code or your environment. If you are able to share your server code I would be happy to give it a try./help debug. If you with to do so it might be better to attach to a new ECF bug, rather than post it here on the forum.



Previous Topic:Namespace issue on createContainer
Next Topic:Exception using RemoteServices
Goto Forum:
  


Current Time: Tue Nov 25 23:25:07 GMT 2014

Powered by FUDForum. Page generated in 0.03203 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software