[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.ecf] Re: Communication between OSGi/Equinox - JMS/ActiveMQ

Hi Scott,

thank you for your reply and this tip.

I implements the following code [1] and it seems to work but I get the error message [2] and I don't know how I send a message to the ActiveMQ and receive it again.

---- [1]
try {
IContainer cont = ContainerFactory.getDefault().createContainer("ecf.jms.activemq.tcp.client");
ID targetID = IDFactory.getDefault().createID(cont.getConnectNamespace(), "tcp://localhost:61616/mytest");
cont.connect(targetID, null);
} catch (ContainerCreateException e) {
e.printStackTrace();
} catch (IDCreateException e) {
e.printStackTrace();
} catch (ContainerConnectException e) {
e.printStackTrace();
}
---- [2]
log4j:WARN No appenders could be found for logger (org.activemq.transport.tcp.TcpTransportChannel).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger (org.activemq.ActiveMQConnection).
log4j:WARN Please initialize the log4j system properly.


org.eclipse.ecf.core.ContainerConnectException: JMS Connect or Setup Exception
at org.eclipse.ecf.provider.jms.channel.AbstractJMSClientChannel.connect(AbstractJMSClientChannel.java:69)
at org.eclipse.ecf.provider.generic.ClientSOContainer.connect(ClientSOContainer.java:146)
at com.javaworld.sample.helloworld.Activator.start(Activator.java:51)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:350)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1118)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:634)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:282)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:468)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:297)
org.eclipse.ecf.core.ContainerConnectException[0]: javax.jms.JMSException: syncSendTimedOut: connection no longer OK
at org.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1336)
at org.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1306)
at org.activemq.ActiveMQSession.addConsumer(ActiveMQSession.java:1208)
at org.activemq.ActiveMQMessageConsumer.<init>(ActiveMQMessageConsumer.java:143)
at org.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:622)
at org.eclipse.ecf.provider.jms.channel.JmsTopic.<init>(JmsTopic.java:31)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSChannel.setupJMS(AbstractJMSChannel.java:175)
at org.eclipse.ecf.provider.jms.channel.AbstractJMSClientChannel.connect(AbstractJMSClientChannel.java:63)
at org.eclipse.ecf.provider.generic.ClientSOContainer.connect(ClientSOContainer.java:146)
at com.javaworld.sample.helloworld.Activator.start(Activator.java:51)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:350)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1118)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:634)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:282)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:468)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:297)
----


I need really a simple example. I have too little know-how.

Scott Lewis wrote:

In my own copy of the org.eclipse.ecf.provider.jms.activemq bundle I have the various jars referenced on the bundle classpath inside the lib directory. Are these not present for you inside your project? I checked on the CVS repository and they also seem to be there.

I'm not sure what is the problem you identify above (i.e. why the activemq jars are not included).

As for the analog of what you have above within ECF...the parts dealing strictly with JMS (i.e. not specific to ActiveMQ) are in:

org.eclipse.ecf.provider.jms.channel.AbstractJMSClientChannel

which is in the org.eclipse.ecf.provider.jms bundle

and the JMS-specific bits are in the sub-class


org.eclipse.ecf.provider.jms.activemq.container.ActiveMQJMSClientContainer.ActiveMQClientChannel

(which is an inner class inside ActiveMQJMSClientContainer) inside the org.eclipse.ecf.provider.jms.activemq bundle.

I forgot to import the other packages of ecf (CVS).

The intention here is to separate the active-mq-specific stuff from the JMS-generic stuff for session/topic setup, so that it is relatively easy to create other providers based upon other JMS implementers. So, for example, we have a Webshere JMS impl that is also based upon org.eclipse.ecf.provider.jms. We would, of course, welcome other JMS impls and if they want to use/reuse the org.eclipse.ecf.provider.jms to create them that that is great.

I didn't found this example of WebSphere. Where is it?

Thanks.

Best regards,
Sebastian