cancel
Showing results for 
Search instead for 
Did you mean: 

JMS and Message Driven Beans

Former Member
0 Kudos

Hi all!

In my project, I need to use Oracle Advanced Queueing instead SAP WAS JMS Provider to communicate with 3rd party system.

I can develop an application client to this JMS system. In OAQ you can get Connection Factory using Oracle JDBC driver and specifying Oracle database host and port (no JNDI lookup for Connection Factory).

Synchronous communication works perfect (I have WD clients generating requests and 3rd party system responses in a moment); but now I want to recieve messages asynchrounous.

One way is develop a daemon process (as Message Listener) and run it on server, where my SAP WAS running.

Another (i prefer this solution ) way is using Message Driven Bean - and i have a problem to use it correct.

So, i want to ask, if is it possible to develop MDB without references to ConnectionFactory in JNDI in MDB deployment descriptor. I want only to get JDBC driver factory and create connection in EJBCreate method... but all my attempts ended with deployment errors.

Thanks for any answer.

Best regards,

Juraj Sedik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Oracle's <b>AQ</b> is supposed to be JMS compliant. As such it can provide you with a JNDI for a QCF. The problem you are running into here is that you will have to link the foreign JNDI defined on the oracle server to your local JNDI define on SAP. Once you have managed that you should be able to do what you want.

Look into adding the Oracle J2EE client to the Classpath, check the InitialContext factory and url and add them to your initial context etc...

The other way is to just add the j2ee client to the classpath and define the InitialContext with the hashtable. This would allow you to place a JMS listener to the queue but is not scalable.

To get a true scalable implementation you have to be able to integrate both JNDIs

Enjoy

Former Member
0 Kudos

Hi,

thanks for your answer,

but there is no Oracle J2EE server in my system landscape. I need to use messaging system provided by standard Oracle Database server (my WAS is running on that DBMS, queues and topics are created by DB scripts and i need ORA JDBC driver, when i want to get ConnectionFactory object)

What i tried -> create Object based JMS connection in WAS JNDI registry (through Visual Administrator) - but no success, just 2 nigths of NullPointerExceptions

I don't know how to specify DB host and port, when registering Object based JMS connection...

Best regards,

Juraj Sedik

Vlado
Advisor
Advisor
0 Kudos

Hi Juraj,

Unfortunately, I'm not so familiar with Oracle AQ and Oracle JMS. While googling around, I could find out that it's in many aspects different from usual JMS providers. As you said before, it is RDBMS/JDBC based and, for example, you get a ConnectionFactory by using some oracle specific class oracle.jms.AQjmsFactory:


Properties info = new Properties();
info.put("aquser", "aquser");
TopicConnectionFactory topicConnectionFactory = AQjmsFactory.getTopicConnectionFactory(
    "jdbc:oracle:thin:@HOST:1521:SID",info);

(http://www.akadia.com/services/ora_advanced_queueing.html)

Anyway, since what you are basically trying to do is to integrate an external JMS provider with the SAP Web AS, I would suggest to have a look at the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/cf4e71c46cdb4da31153be96c5389f/frameset.htm">JMS Connector Service</a> in the Administration Manual, especially the topics how to integrate an external JMS provider and how to register a ConnectionFactory using non-JNDI JMS provider. Hopefully, you can find the necessary information in the Oracle AQ <a href="http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10785/toc.htm">user guide</a>.

Hope that helps a bit!

-Vladimir

Former Member
0 Kudos

Hi Vladimir,

thanks a lot for your response.

I have read that manual, but probably i'm doing something wrong..

I have deployed OracleJms library, with these jars :

aqapi.jar

dms.jar

jms.jar

jta.jar

ojdbc14dms.jar

orai18.jar

Then I have created new Factory in JMS Connector resource tab.

General >>>

Factory Name: AqFactory

Provider Type: Object Factory

Library: OracleJms

Provider >>>

Object Factory Class: oracle.jms.AQjmsConnectionFactory

JMS Factory Class: oracle.jms.AQjmsTopicConnectionFactory

But when i want to start that connection:

java.rmi.RemoteException: Error occurred while starting ...

Caused By:

at oracle.jms.AQjmsConnectionFactory.getObjectInstance(AQjmsConnectionFactory.java:260)

at com.sap.engine.services.jmsconnector.deploy.ContainerImpl.loadFactory(ContainerImpl.java:1921)

at com.sap.engine.services.jmsconnector.deploy.ContainerImpl.prepareStart(ContainerImpl.java:698)

I don't know, where to specify DB host, port, service...

Best Regards,

Juraj Sedik

Vlado
Advisor
Advisor
0 Kudos

Hi Juraj,

I think we are on the right way.

As the documentation for <a href="http://help.sap.com/saphelp_nw04/helpdata/en/85/c763fd97ded342a45de926b770c2e9/frameset.htm">Registering a JMS ConnectionFactory using Non-JNDI Provider</a> suggests, in the Provider tab <i>"You can add any Object Factory-specific properties using the Additional tab."</i> You just have to figure out the exact format of the properties required by AQjmsConnectionFactory. Ideally the exception thrown at oracle.jms.AQjmsConnectionFactory.getObjectInstance(AQjmsConnectionFactory.java:260) should contain some hints about that. Or probably you can find some in the AQ documentation available to you. Unfortunately, the javadoc and other Oracle documentation that I have found so far is hardly comprehensive on this topic...

HTH!

-Vladimir

Answers (0)