Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ActiveMQ 4.0.1 + Oracle ESB?

582987Jun 13 2007 — edited Jun 29 2007
Hi All,
I've spent the last few days trying configure the JMS Adapter to consume an ActiveMQ topic on a remote host.

Here's what I've done so far.

I've deployed the required activemq libraries by using the Oracle ant task (publish-shared-library) to the propery deployerURI.

I've installed JDeveloper and coded a ESB Designer Application, which is very simple. All it does is it consumes a message off an ActiveMQ Topic, and routes it to a FileAdapter.

This is very very complex (probably around 20 detailed steps) to get to this point.

I'm trying to use the built in Oracle JMS Adapter's TopicConnectionFactory (eis/Jms/TopicConnectionFactory) and it tries to connect to the topic 5x, and outputs an error:

<SUPPL_DETAIL><![CDATA[ORABPEL-12134
ERRJMS_ERR_CR_TOPIC_CONS.
Error while creating Topic consumer:.
Please examine the log file to determine the problem.

at oracle.tip.adapter.jms.JMS.JMSConnection.createConsumer(JMSConnection.java:461)
at oracle.tip.adapter.jms.JMS.JMSConnection.createConsumer(JMSConnection.java:381)
at oracle.tip.adapter.jms.JMS.JMSMessageConsumer.createConsumer(JMSMessageConsumer.java:272)
at oracle.tip.adapter.jms.JMS.JMSMessageConsumer.init(JMSMessageConsumer.java:213)
at oracle.tip.adapter.jms.inbound.JmsConsumer.init(JmsConsumer.java:154)
at oracle.tip.adapter.jms.JmsEndpoint.run(JmsEndpoint.java:151)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.jms.InvalidDestinationException: Destination cannot be null.
at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1072)
at com.evermind.server.jms.JMSUtils.toInvalidDestinationException(JMSUtils.java:1134)
at com.evermind.server.jms.EvermindMessageConsumer.<init>(EvermindMessageConsumer.java:66)
at com.evermind.server.jms.EvermindTopicSubscriber.<init>(EvermindTopicSubscriber.java:50)
at com.evermind.server.jms.EvermindTopicSession.createSubscriber(EvermindTopicSession.java:83)
at com.evermind.server.jms.EvermindTopicSession.createSubscriber(EvermindTopicSession.java:74)
at oracle.tip.adapter.jms.JMS.JMSConnection.createConsumer(JMSConnection.java:455)
... 10 more
]]></SUPPL_DETAIL>

Alternatively, I've also tried to modify the oc4j-xml for the jms adapter located here to have a custom entry for ActiveMQ. When I try to do that, I get a no class found error. Here's what I put for my entry:

<connector-factory location="eis/activeMQ/Topic" connector-name="activemq-rar">
<config-property name="connectionFactoryLocation" value="ConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory; java.naming.provider.url=tcp://hostname:61616"/>
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="false"/>
<config-property name="username" value=""/>
<config-property name="password" value=""/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>

I have confirmed through my SOA Console that my shared library is loaded (containing the proper activemq.rar file)

The error when using this configuration is this:
<PAYLOAD>
<MSG_TEXT>ESB bootstrap: Error occured while initializing ESB server from the ping thread</MSG_TEXT>
<SUPPL_DETAIL><![CDATA[java.lang.NoClassDefFoundError
at org.apache.commons.httpclient.SimpleHttpConnectionManager.getConnectionWithTimeout(SimpleHttpConnectionManager.java:132)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:147)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:437)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at oracle.tip.esb.server.bootstrap.ESBBaseResourceAdapter$PingTester.ping(Unknown Source)
at oracle.tip.esb.server.bootstrap.ESBBaseResourceAdapter$PingTester.run(Unknown Source)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
at java.lang.Thread.run(Thread.java:595)
]]></SUPPL_DETAIL>
</PAYLOAD>

Not very useful... as it doesn't say what class isn't found!!

Has anyone been able to configure the JMS Adapter that's part of the Oracle SOA suite to listen to a topic?

Comments

582987
When the server gets to this state, I am unable to register any ESB Projects from JDeveloper. I get the following error:


error code: 0 : 10
summary: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.NullPointerException
at oracle.tip.esb.console.XMLConsoleManagerImpl.commit(Unknown Source)
at oracle.tip.esb.configuration.deployment.JDevDeploymentManager.deploy(Unknown Source)
at oracle.tip.esb.configuration.deployment.DeploymentServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
".
Fix: -
582987
I've since changed my oc4j-ra.xml to the following (now using proper connector-name) and now I get no errors... but I don't seem to be receiving any messages either. Any ideas on the best way to unit test a JMSAdapter set to consume messages?

<connector-factory location="eis/activeMQ/Topic" connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation" value="ConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory; java.naming.provider.url=tcp://se01:61616"/>
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="false"/>
<config-property name="username" value="oc4jadmin"/>
<config-property name="password" value="oc4jadmin"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
525992
Hi,

Interesting in deed. It's on my plate to try it out. You are couple of steps ahead of me...:-)
Can't offer much help at this point..but have you looked into the following article about configuring ActiveMQ resourse adapter in 10gAS

http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-use-activemq-JCA-RA/doc/how-to-use-activemq-JCA-RA.html

Are you configuring as third-party or JCA+JMS provider from JMS adapter wizard?

Regards,
Rajesh
582987
Hi Rajesh,
I did use those instructions to build the ActiveMQ rar and deploy the shared library into my server.

I am using the adapter wizard which references the custom Jms Adapter connector factory I added in my oc4j-ra.xml.

Any ideas on how best to unit test a JMS consumer in Oracle SOA Suite (specifically, esb-dt in the OC4J server).

How do I configure as a separate third party? Does that mean I create my own adapter from scratch? That would seem to be more difficult?
582987
I've distilled down all my steps to 2 simple configuration steps to deploy the activemq client jar into the server, and attempt a topic subscription.

1) deploy the activemq client jar by modifying the library path entry in application.xml at %ORACLE_HOME%\j2ee\home\config to have the following:

<library path="../../home/lib/scheduler.jar;C:\incubator-activemq-4.0.1\lib\activemq-core-4.0.1.jar"/>

(add the activemq client jar at the end).

2) modify oc4j-ra.xml for the JMS Adapter (add an entry for ActiveMQ/Topic) at
C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\application-deployments\default\jmsadapter:

<connector-factory location="eis/activeMQ/Topic" connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation" value="ConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory;java.naming.provider.url=tcp://achan-lap:61616;topic.MyTopic=topic.event.publication;connectionFactoryNames=ConnectionFactory"/>
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="false"/>
<config-property name="username" value=""/>
<config-property name="password" value=""/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>

With those two configurations, you can then use the JMSAdapter component from within JDeveloper, deploy it to the remote Oracle SOA instance, and start it with no errors.

This is now what I see in my log.xml:
<PAYLOAD>
<MSG_TEXT>Successfully finished endpoint activation for operation "PS01-DSB.PurismaJMSIn_RS.Consume_Message".</MSG_TEXT>
</PAYLOAD>

Now however, I get no output in my filewriter! I did make sure to put in an expression and a mapping in my routing service, but I still don't get any output when I put a message on my topic. Does anyone else have any ideas???
582987
Anyone have any ideas on this? Still stuck
518653
I set up an ActiveMQ connection a couple of months ago (not sure which version though). It was a simple BPEL process, set up to publish a message to a queue. If you could try to do this, and it works, we eliminate a few options :-)

I do not currently have access to the environment where I did it, but if I remember correctly:

- I copied the ActiveMQ .jar files to the $SOA_HOME/j2ee/oc4j_soa/applib directory (and restarted the appserver)

- Then I created an entry in the oc4j-ra.xml file, similar to the one you describe

After that, all I had to do was set up the JMS adapter using the wizard and the EIS JNDI name.

(In addition, I remember there was a version mismatch with the apache commons logger used by ActiveMQ and SOA Suite, but after I replaced both jar-files with the latest version, that problem went away too. But that could have been a problem only in that particular case).
582987
Yes I was able to get BPEL working just last night! I happened to use the same exact steps you laid out. I wish you had posted earlier... none of this is really well documented.

Now I'm trying to get durable subscribers working.

ESB seems to be a bit more problematic than BPEL (no errors and yet no messages)

Another question for you, since this isn't really well documented at all... is it necessary to enter in the JNDI values in the wizard as well as in the oc4j-ra.xml text file? I don't think the wizard entries are used at all (I had to enter the clientID for my durable subscriber in the .xml, and yet when I entered it in the wizard I was getting errors in my log that no clientID was specified)

What exactly is needed in the wizard, and what is needed in the oc4j-ra.xml file. Can I get it to work by just inputting the reference to the EIS connection in the wizard, and put all my JNDI values in the oc4j-ra.xml file, and leave the rest of the JNDI entries in the wizard blank?
518653
Ah, that's too bad, I'm sorry I didn't notice the thread before. :-)

Anyway, the way the process picks up parameters from the oc4j-ra vs the wizard works is something like this:

- If there is an EIS reference, read oc4j-ra.xml, see if there is a match with the EIS JNDI. If there is a match, use this EIS.
- If there is no EIS reference or RA match, read the mcf properties from the WSDL (i.e. what you enter in the wizard)

(This approach is documented in the Oracle® Application Server Adapters for Files, FTP, Databases, and Enterprise Messaging - User’s Guide: Figure 4-71)

So the answer to your question is yes, as long as you are not using the connection in JDeveloper to discover information about queues etc, it is OK to just use the JNDI.

Cheers,
Rune
582987
Ah yes. I didn't know to check the database adapter docs for information on when the oc4j-ra.xml file kicks in :)

Another question, is there a recommended way to swap out a shared system library (e.g., apache.commons.logging) The way I did it was a pure hack - I just replaced the commons-logging.jar with the updated one. I didn't see a way to do it from the admin console.
518653
I'm sure you mean the Enterprise Messaging docs ;-)

About the library swap... To be quite honest, I don't know, I just did the same thing you did.
Maybe someone else could share some wisdom on this issue?
582987
What JMS Connection JNDI name do I use if I don't want to refer to an entry in the oc4j-ra.xml file? I cannot leave this blank in the .wsdl wizard (the next button is greyed out). I thought if I left it blank it would use the entries I entered in the wizard.

And yes I meant the database adapter docs... try googling "User’s Guide: Figure 4-71 oc4j-ra.xml" and tell me what you find :)
518653
Try using "eis/JMS/Doesnotreallyexist". Or something like that.
As long as it does not exist in the oc4j-ra.xml, it will fall back on the mcf properties.

Btw, chapter 4 is definitely about databases. :-)

Cheers,
Rune
1 - 13
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 27 2007
Added on Jun 13 2007
13 comments
1,458 views