Pages

Monday, July 13, 2009

Using AQ ( JMS Text message ) in WLS 10.3.1

In Oracle Application Server 10.1.3 ( OC4J) you can use OJMS to expose AQ with JMS (text) Message as type and use it as a normal JMS Queue or Topic in Soa Suite or a Message driven Bean. See my previous blog for more details. With the release of Weblogic 10.3.1 ( WLS FMW11g ) we can do the same with a Foreign JMS Server. Before 10.3.1 we had to make a startup class to achieve this.
First create a Queue and Queue table with SYS.AQ$_JMS_MESSAGE as payload type in your Oracle Database and make sure you enable enqueue /dequeue on this Queue.
In Weblogic we have to create a JMS server and a JMS module.
Create a new JDBC datasource with a schema user which can enqueue or dequeue the just created queue. Use the XA JDBC driver, with this driver you can use global and local transactions. with NON-XA driver you can only use local transactions, this can be problem when you want to use this Queue in Soa Suite.
Select your JMS module in the WLS Console and create a new Foreign Server.
Open the Foreign Server so we can configure this AQ server.
Change JNDI Initial Context Factory to oracle.jms.AQjmsInitialContextFactory and we have to provide the jndi datasource name in the JNDI Properties field, For Example datasource=jdbc/scottDS

Create a JMS connection factory
As local JNDI name you can choose what you like. For Remote you have to choose one of these values. QueueConnectionFactory, TopicConnectionFactory, ConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory or XAConnectionFactory

Now we can create a new Destination.
As Local JNDI name you can choose any name but as Remote JNDI it needs to start with Queues or Topics after that add a / with the database queue or topic name.

We are ready to use this AQ Queue in a Soa Suite Composite application. Where we will use the JMS adapter.
Select Oracle Advanced Queuing as OEMS

and select the Foreign Server Destination.

For more Weblogic AQ JMS details see the official documentation.

110 comments:

  1. Hi Edwin
    I need to access from OSB to this AQJMS... How I must put the URI??

    jms://host:port:/XAQueueConnectionFactory/Queues.Queue_Read
    ??

    Thank You.

    JP

    ReplyDelete
  2. Great article !
    Thanks a lot.

    I'm trying to configure remote destination (pointing to AQ) but I can't find oracle.jms.AQjmsInitialContextFactory
    class.
    Could you please suggest where it is located?

    Thanks.

    ReplyDelete
  3. Hi,

    Strange are you using wls 10.3.1, I didn't do anything special for that.

    thanks

    ReplyDelete
  4. Hi,

    I'm using WL 10.3.1 and I'm still getting the error 'Can not get destination information. The destination JNDI name is jms/xxxxx, the provider URL is null'

    Is there any way to activate some debug logging ?

    ReplyDelete
  5. Hi,

    Did you make a queue and CF in the foreign server. and the remote jndi name must match you queue or topic.

    and in the jms adapter resource , connect to this local CF and local Queue.

    thanks Edwin

    ReplyDelete
  6. I've made some progress :
    - logging can be turned on by adding environment startup property '-Doracle.jms.traceLevel=6'
    - but now the AQjmsContext is used to also lookup the 'weblogic.jms.MessageDrivenBeanConnectionFactory'. Any ideas? The message driven bean just uses the local jndi name of the jms queue.

    The error :
    [ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' [Thu Sep 17 13:36:15 CEST 2009] AQjmsContext.lookup failed for weblogic.jms.MessageDrivenBeanConnectionFactory: Exception
    : javax.naming.NamingException: Unrecognized prefix in: weblogic.jms.MessageDrivenBeanConnectionFactory
    javax.naming.NamingException: Unrecognized prefix in: weblogic.jms.MessageDrivenBeanConnectionFactory
    at oracle.jms.AQjmsContext.lookup(AQjmsContext.java:150)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at weblogic.ejb.container.internal.JMSConnectionPoller.getConnection(JMSConnectionPoller.java:465)
    at weblogic.ejb.container.internal.JMSConnectionPoller.createJMSConnection(JMSConnectionPoller.java:1991)

    ReplyDelete
  7. Ok, Now I know what you mean.

    If you only have to difine in a MDB the local jndi of the queue or topic and not the CF then this will not work, I think

    because with the remote CF jndi name you control where you use XA and when this is a queue or topic.

    Without settings this It won't work.

    maybe you can find some info about foreign server and MDB

    thanks

    ReplyDelete
  8. Can this help

    once you configured foreign jms server, you could treat it as local weblogic jms server. So you don't need to specify provider-url if you deploy it on the local server. For remote access, it looks like:

    * @weblogic.message-driven destination-jndi-name="jms/QUEUE"
    * connection-factory-jndi-name="jms/testqcf"
    * provider-url="t3://wlsservername:port/"
    * initial-context-factory="weblogic.jndi.WLInitialContextFactory"

    ReplyDelete
  9. I came to the same conclusion: setting the connection-factory-jndi-name is sufficient btw.

    ReplyDelete
  10. This method works with Oracle custom XMLType too (not just JMS standard Text message). If you are listening, simply cast the Message to import oracle.jms.AdtMessage; If you are posting cast QueSession to AQjmsSession

    ReplyDelete
  11. Hi im getting the following error..
    how to use this AQ Queue in a Soa Suite Composite application.
    im new to this, so please tell me how to open the soa suite

    and please resolve the following issue.

    D:\bea11g\jdk160_14_R27.6.5-32\bin\javaw.exe -client -classpath D:\JDeveloper\mywork\Application2\Project1\classes;D:\bea11g\modules\javax.servlet_1.0.0.0_2-5.jar;D:\bea11g\modules\javax.jsp_1.1.0.0_2-1.jar;D:\bea11g\modules\glassfish.el_2.1.1.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\antlr.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-beanutils.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-collections.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-digester.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-fileupload.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-logging.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\commons-validator.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\jakarta-oro.jar;D:\bea11g\jdeveloper\jakarta-struts\lib\struts.jar;D:\bea11g\modules\javax.ejb_3.0.1.jar;D:\bea11g\modules\javax.jms_1.1.1.jar;D:\bea11g\wlserver_10.3\server\lib\aqapi.jar;D:\bea11g\modules\javax.transaction_1.0.0.0_1-1.jar;D:\bea11g\wlserver_10.3\server\lib\weblogic.jar -Djavax.net.ssl.trustStore=D:\bea11g\wlserver_10.3\server\lib\DemoTrust.jks oracle.MessageDrivenEJB1BeanClient
    Exception in thread "main" javax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete. The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both
    at oracle.jms.AQjmsContext.incompleteConfiguration(AQjmsContext.java:88)
    at oracle.jms.AQjmsContext.(AQjmsContext.java:74)
    at oracle.jms.AQjmsInitialContextFactory.getInitialContext(AQjmsInitialContextFactory.java:38)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.(InitialContext.java:197)
    at oracle.MessageDrivenEJB1BeanClient.getInitialContext(MessageDrivenEJB1BeanClient.java:159)
    at oracle.MessageDrivenEJB1BeanClient.main(MessageDrivenEJB1BeanClient.java:72)
    Process exited with exit code 1.


    Thank You
    BVU

    ReplyDelete
  12. Hi,

    for aq you don't need to use the jms adapter. Just make sure that your aq object type is of type raw or a oracle type.

    create an soa composite application and add an aq adapter and select your aq queue or topic. remember your jndi name ( eis/AQ/xxxx )

    in the wls console add an datasource ( to the queue schema ) and configure the aq resource adapter and add the eis name with the datasource.

    ReplyDelete
  13. Hi
    i created a queue,qtables using packages
    oracle.aq.aqqueue and oracle.aq.aqqueuetable.

    qtable_prop = new AQQueueTableProperty("RAW");
    qtable_prop.setCompatible("8.1");

    q_table = aq_sess.createQueueTable ("JMSUSER",q_table9",qtable_prop);

    queue = aq_sess.createQueue (q_table, "MYQUEUE9", queue_prop);

    here qtable and queue is created in database

    but to send message from queue
    im type casting this Aq queue to javax.jms queue and using javax.jms.Textmessage

    i want to send a simple hello message to queue...

    here im getting typecasting problem
    while converting from AQQueue to javax.jms.Queue

    is there any other way to send this simple text message

    or else please help me to resolve this typecasting problem

    Thank you
    Sim

    ReplyDelete
  14. Hi,

    How did you create your queue in Oracle did you do like this http://biemond.blogspot.com/2008/11/using-aq-in-weblogic-103.html
    besed on jms_text_message and not raw.

    and if you use the foreign server in wls then you can use plain JMS no specific Aq classes.

    ReplyDelete
  15. Hi Edwin,

    I am trying to access an AQ JMS from weblogic 10.1.3, and not able to resolve the JNDI. I followed your steps of creation of Foreign Server/Connection Factory/Destination. I get error like this The JCA Binding Component is unable to startup the Resource Adapter specified in the element: location='eis/Jms/OrionTopic'.
    The reason for this is most likely that either
    1) the Resource Adapters RAR file has not been deployed successfully to the WebLogic Application server or
    2) the '' element in weblogic-ra.xml has not been set to eis/Jms/OrionTopic. In the last case you will have to add a new WebLogic JCA connection facto
    Please correct this and then restart the Application Server

    eis/Jms/OrionTopic is name of my JNDI when I created the JMS Adapter. Should I redeploy my JMSAdapter after making these changes?

    Thanks
    Sandhya

    ReplyDelete
  16. Hi,

    are you using WLS 10.3.1 or 10.3.2. These are the wls versions which support Foreign server with AQ.

    thanks

    ReplyDelete
  17. Hi Edwin,

    Thanks for getting back. I am using 10.3.1. I got the foreign server to work. I realized I had to create an outbound connection pool in the JMSAdapter whose connection factory referred to the Local JNDI connection factory and redeployed the JMSAdapter. This blog was very useful. Even though I read the documentation seeing the way you done it was very useful.

    Thanks
    Sandhya

    ReplyDelete
  18. Does it work with weblogic 103 (10.3)?

    ReplyDelete
  19. Hi,

    too bad the AQ libraries are not included in 10.3 so you can't use it in the Foreign Server

    need to make a startup class

    ReplyDelete
  20. Hi Edwin,
    Your blogs have been very useful. Please see if you can help me with the problem mentioned below. I want to post an AQ message from a Java Client but even though I can retrieve the datasource using InitialContext and the QueueConnectionFactory from the latter using AQjmsFactory, the createQueueConnection() is failing on the QCF. Even if I use the overloaded createQueueConnection(user, password, I get authentication failure although user and password are correct.
    Please see if you can help me.


    Sample code:
    Properties parm = new Properties();
    parm.setProperty("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");//"com.evermind.server.rmi.RMIInitialContextFactory");
    parm.setProperty("java.naming.provider.url","t3://10.209.125.23:8001");//ormi://localhost:23791/
    parm.setProperty("java.naming.security.principal","weblogic");
    parm.setProperty("java.naming.security.credentials","weblogic1");
    Context ctx = new InitialContext(parm);

    System.out.println("Weblogic Initial Context obtained : " + ctx);
    DataSource ds = (DataSource)ctx.lookup(datasourceJNDI);
    System.out.println("Datasource obtained : " + ds);
    Connection conn = ds.getConnection();
    //String dbUser = conn.getMetaData().getUserName();
    //System.out.println("DB User obtained : " + dbUser);

    ConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(ds);

    QueueConnection connection = factory.createQueueConnection();

    ReplyDelete
  21. Ok,

    I tried this with OC4J not with wls,but you can do this and connect directly to the Oracle Database

    try {
    factory =
    AQjmsFactory.getQueueConnectionFactory(dbIp, dbSid, dbPort, "thin");

    connection = factory.createQueueConnection(dbUser, dbPassword);

    session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    QueueConnection
    connection.start();
    queue = ((AQjmsSession)session).getQueue(dbUser, QueueName);
    sender = ((AQjmsSession)session).createSender(queue);
    } catch (JMSException je) {
    throw new RuntimeException("Fout opgetreden bij het starten ", je);
    } catch (Throwable t) {
    throw new RuntimeException("Fout opgetreden bij het starten ", t);
    }

    ReplyDelete
  22. Thanks a ton Edwin for your reply.

    The keyword "thin" did the trick. I had no idea why oracle.jdbc.driver.OracleDriver was not working in the code below.
    factory =
    AQjmsFactory.getQueueConnectionFactory(dbIp, dbSid, dbPort, "oracle.jdbc.driver.OracleDriver");//thin

    By the way, can you throw some light on the reason as to why a Queue connection cannot be retrieved from the QueueConnectionfactory obtained from a datasource lookup?

    ReplyDelete
  23. Hi,

    you can also enqueue and dequeue to AQ from a java client by using by using a JMS foreign server. In the Foreign server you should use a jdbc url, in my case I used a datasource

    The client must have the following jars on the client-side classpath: aqapi.jar, ojdbc6.jar, orai18n.jar and the wlclient.jar or wlfullclient.jar.

    for more info http://download.oracle.com/docs/cd/E15523_01/web.1111/e13738/aq_jms.htm#CJADCIEB

    thanks

    ReplyDelete
  24. Hi,

    To lookup a datasource in Weblogic you need to set WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"

    for more info see this blog. http://theblasfrompas.blogspot.com/2010/02/accessing-data-source-remotely-in-fmw.html

    thanks

    ReplyDelete
  25. Hi Edwin, how are you doing?

    I'm using the most recent Jdev 11g and WLS 10.3.3... Followed you blog, which is very useful, but still can't get the JMS Adapter to post a JMS Text Message on the AQ Topic.

    The JMS Adapter posts the message to the local Topic but it seems it doesn't get forwarded by the ForeignServer to the AQ destination... Have you tried this configuration with WLS 10.3.3?

    Thanks in advance!
    Luiz Malere

    ReplyDelete
  26. I've got things working with WLS 10.3.3, it was an issue with the local JNDI name for the ConnectionFactory. It's necessary to configure the JMS Adapter Connection Factory JNDI reference and re-deploy the adapter.

    Your blog is very useful, tks!

    ReplyDelete
  27. Hi Edwin,
    We have a simple message producer as a part of a web application which is deployed in a weblogic 11g application server ( say server1).
    The remote JMS server and datasource is setup on a 11g soa server (say server2). We are going directly against the JMS database, and we get the following exception, when we try to create the connection:

    java.lang.UnsupportedOperationException: WebLogic server side components must use AQ JMS datasource configuration

    This is thrown from the following statement:

    Session session = connectionFactory.createConnection().createSession(true, 0);

    I have created a sample standalone program which runs fine. as soon as the code is deployed in the Weblogic container the exception is thrown.

    There is no special setup on server1 where the webapp is deployed. Do I need to create a datasource from server1 pointing to the jms db configured on server2, to get this thing to work ?

    This used to work in weblogic 10.3.

    ReplyDelete
  28. Hi,

    Can you tell me more about the setup.
    Are you using AQ with JMS Foreign Server. And what do you do in your webapp.

    I know AQ is not serializable . So you need to deploy everything on the soa server.

    thanks

    ReplyDelete
  29. Thanks for the quick response. Its an integration between two applications. yes I am using AQ with Foreign Server.

    The web application on server1 does not uses any weblogic resources. It just opens up a dialog where the user clicks a button and the message is send to the aq setup on server2.

    AQjmsFactory.getQueueConnectionFactory(,
    );

    and the next line throws the exception:
    QueueConnection connection = connectionFactory.createQueueConnection()


    This used to work in 10.3. Infact, if i replace the aqapi.jar in weblogic 11g with the older version from 10.3, it works,
    but that's not a good solution as it create other installation related pains.

    ReplyDelete
  30. Ok

    First Weblogic 10.3.X = weblogic 11g so it is strange.

    but you are not using AQ with Foreign Server else you can use the normal Jms like this
    QueueConnectionFactory connectionFactory =
    (QueueConnectionFactory)ctx.lookup(queueConnectionFactoryName);

    connection = connectionFactory.createQueueConnection();
    connection.start();

    What you probably do in your webapp is looking only the datasource up like this
    DataSource ds = (DataSource)ctx.lookup(datasourceJNDI);
    System.out.println("Datasource obtained : " + ds);
    Connection conn = ds.getConnection();
    //String dbUser = conn.getMetaData().getUserName();
    //System.out.println("DB User obtained : " + dbUser);

    ConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(ds);

    QueueConnection connection = factory.createQueueConnection();

    So I think it is no problem to use the old aqapi.jar in your webapp ( only used there).
    I think Oracle is forcing you to use the foreign server.

    You can configure foreign server on your web app server1 and use the normal jms code.

    thanks

    ReplyDelete
  31. Hi there,

    I've done the route of Foreign server on 10.3.3 but am getting the below error when testing the enqueue with the normal lookup. Have I missed something in setting up the foreign server?

    java.lang.ClassCastException: cannot assign instance of weblogic.jdbc.common.internal.RmiDataSource_1033_WLStub to field oracle.jms.AQjmsConnectionFactory.data_source of type javax.sql.DataSource in instance of oracle.jms.AQjmsXAQueueConnectionFactory
    at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(Unknown Source)
    at java.io.ObjectStreamClass.setObjFieldValues(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:598)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at weblogic.jndi.internal.ServerNamingNode_1033_WLStub.lookup(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:405)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
    at javax.naming.InitialContext.lookup(Unknown Source)

    ReplyDelete
  32. I got around that problem by using the java.naming.security.principal and db_url properties, so no datasource. Enqueue and Dequeue then work fine. But I now get an error with the MDB:

    <19/11/2010 7:14:47 AM EST>

    This MDB was working with pure JMS before. So technically, just pointing it to a new JNDI queue name should work?

    -G

    ReplyDelete
  33. Hi,

    did you use the jndi name of the datasource and did you target the datasource to the right server.

    I know it works, did you use this annotations in your MDB

    @weblogic.message-driven destination-jndi-name="xxxx/xxx"
    connection-factory-jndi-name="xxx/xxxxx"

    thanks

    ReplyDelete
  34. Not sure where you want me to put those annnotations - I'm not using any.

    The Enqueuing via an app using T3 gives the error that it doesn't like the datasource=xxx/yyyy so I put in the db_url and credentials, and it works. However, the MDB "wants" the datasource=xxx/yyyy to work.

    So a catch 22. I have tested each part separately and they work. But they can't both work.

    Here is the config from the foreign server that works for the Enqueue.

    <foreign-destination name="AIIR_AQ_ForeignDestination">
    <local-jndi-name>jms/AQaiirQ</local-jndi-name>
    <remote-jndi-name>Queues/AIIR</remote-jndi-name>
    </foreign-destination>
    <foreign-connection-factory name="ForeignConnectionFactory">
    <local-jndi-name>jms/AQForeignServerCF</local-jndi-name>
    <remote-jndi-name>QueueConnectionFactory</remote-jndi-name>
    </foreign-connection-factory>
    <initial-context-factory>oracle.jms.AQjmsInitialContextFactory</initial-context-factory>
    <jndi-properties-credential-encrypted>password</jndi-properties-credential-encrypted>
    <jndi-property>
    <key>java.naming.security.principal</key>
    <value>user</value>
    </jndi-property>
    <jndi-property>
    <key>db_url</key>
    <value>jdbc:oracle:thin:@localhost:1521:xe</value>
    </jndi-property>

    And here's the weblogic-ejb-jar.xml extract:

    <ejb-name>AiirReportMdb</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>64</max-beans-in-free-pool>
    <initial-beans-in-free-pool>16</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>jms/AQaiirQ</destination-jndi-name>
    <connection-factory-jndi-name>jms/AQForeignServerCF</connection-factory-jndi-name>
    </message-driven-descriptor>

    Sorry, I forgot to format the text for the MDB's error, here it is:

    <19/11/2010 12:44:07 PM EST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: AiirReportMdb is unable to connect to the JMS destination: jms/AQaiirQ. The Error was: java.lang.UnsupportedOperationException: WebLogic server side components must use AQ JMS datasource configuration>

    ReplyDelete
  35. Hi,

    remove you ejb or weblogic-ejb xml's

    and add this to your MDB class
    @MessageDriven(activationConfig =
    { @ActivationConfigProperty(propertyName = "acknowledgeMode",
    propertyValue = "Auto-acknowledge")
    }, mappedName = "jms/AqQueue")

    @MessageDestinationConfiguration(connectionFactoryJNDIName = "jms/CF")
    public class WaaiMDBEJBBean implements MessageListener {


    And you should check the targetting of the jms server / module and foreign server . This must match with the datasource.

    thanks

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. This comment has been removed by the author.

    ReplyDelete
  38. Thanks Edwin, but that does not help. There is only 1 local server (development) so the targetting is straightforward.

    The issue remains the same. The below key in the JNDI properties of the Foreign Server is a problem. If it's there, then the MDB works, but then the t3 doesn't.

    If it is not there, then the MDB doesn't work, but the t3 does.

    <key>datasource</key>
    <value>jdbc/aqdatasource</value>

    I could work around this by creating a local cluster and having two foreign servers...but that's far from optimal and won't get anywhere near a production environment.

    The other questions are, why must an MDB connect to a foreign server via datasource, and why is there no built in class casting of an RMI datasource to a javax datasource?

    -G

    ReplyDelete
  39. Hi,

    I got it working perfectly on one wls and just Foreign server with datasource. Please try to create a jmsserver, jmsmodule etc.

    It needs a datasource because the MDB will use XA , JTA.

    thanks

    ReplyDelete
  40. Hi Edwin,

    Thank you for the great article. I tried following your step by step but when I tested with a simple publish composite App I get an error message in the error Logs :

    <3f3d2d8955322f32:-5d57c961:12ca300b9a3:-7fd3-00000000000001f5> <1291229354937> << eis/aqjms/Queue > ResourceAllocationException thrown by resource adapter on call to ManagedConnectionFactory.createManagedConnection(): "BINDING.JCA-12141
    ERRJMS_CONN_FAC_NOT_FOUND.
    ERRJMS_CONN_FAC_NOT_FOUND.
    Unable to instantiate connection factory. JMS adapter was unable to look up the connection factory aqjms/XAQueueConnectionFactory neither through JNDI nor instantiate it as a Java class.
    Please examine the log file to determine the problem.
    ">

    Can you help me with this..I don't know what the problem could be.

    Thanks

    SQ

    ReplyDelete
  41. Does this method only work for JMS TextMessage types? I need to use BytesMessage. Thanks!

    ReplyDelete
  42. Hi,

    it will also work with jms byte messages. No problem.

    thanks

    ReplyDelete
  43. Hi Edwin,

    Firstly, thanks for sharing your knowledge, I solved quite a lot of issues thanks to your blog.

    My problem: I set up an MDB with Spring Integration which connects to my weblogic foreign server to get to the AQ. Just follow this article of yours for the weblogic config.
    In my Spring I have my connection factory and queues obtained via JNDI.
    The JDBC connection within the foreign server is apparently working as I already passed through queue permission problems.

    But now I'm stucked with a JMS-120 when dequeueing. Does it say something to you?

    Thanks in advance,
    Pablo.

    ReplyDelete
  44. Hi Edwin,
    thanks for your article. Unfortunately AQ on my WLS 10.3.3 domains doesn't completely work. I'm able to send message to AQ using the foreign jms server, but when I try to consume that message I get the following exception:

    oracle.jms.AQjmsException: JMS-120: Dequeue failed

    Caused by: oracle.jms.AQjmsException: JMS-122: Internal error Corrupted message

    Can you help me?

    Thanks
    Marco

    ReplyDelete
  45. Hi,

    I solved my JMS-120 issue, it was a problem with the message.
    The pl/sql scripts in this post solved my problem:
    http://technology.amis.nl/blog/2384/enqueuing-aq-jms-text-message-from-plsql-on-oracle-xe

    Anyway, now I have another problem
    javax.naming.NameNotFoundException: Cannot resolve name:Queues/AQREQUEST_TEXTO

    This means my program is solving the local JNDI which is jms/soademo/aqrequest, but this local JNDI points to the remote JNDI Queues/AQREQUEST_TEXTO.

    Don't find anything on this...


    Thanks,
    Pablo.

    ReplyDelete
  46. Hi,

    Ok your queue in the database is called AQREQUEST_TEXTO and does the jdbc datasource connects to this schema of the queue. if not then grant the rights and maybe give the schema the right aq roles.

    hope this helps.

    ReplyDelete
  47. Hi Edwin,
    I have problem in AQ creation ,

    I followed the same steps which u have given to create a foreign server, i am not able to connect thru MDB after deploying in Weblogic server11g,

    Error:

    ReplyDelete
  48. Hi Edwin

    Thank you very much for the Blog.This gives us a lot of information.

    Using the above blog, I would like to have the BPEL jms adapter dequeue the data which is enqueued( produced) on to the AQ by another application say OSB and thus make the BPEL jms adapter to start the bpel flow in the bpel application. Can you please let me know if its possible. Each time a new message in AQ, BPEL jms should deque and kick off an instance.

    ReplyDelete
  49. Hi,

    that is possible, just the aq adapter and select the dequeue option and wire this to the BPEL.

    thanks

    ReplyDelete
  50. Hi,

    Thank you very much for your response. I have created a AQ of type SYS.AQ$_JMS_MESSAGE and this queue doesnot comeup when we try to configure a deque using the AQ adapter. Should I follow your blog and use jms adapter instead

    ReplyDelete
  51. Hi,

    for the AQ adapter you should use RAW ( works good, you can use it as text ) or use an Oracle Object Type like xmltype.

    thanks

    ReplyDelete
  52. Hello.

    Thank you very much for the reply. I tried as per the Blog.

    1. Created AQ's in database-> done without error

    2.Configured jms module as foriegn server-> done
    3.Was also able to create a jms adapter in Bpel-
    > done

    But, when i Wire the adapter with Bpel process (recieve activity), it waits for ever, the message is not dequed.It times out. Could you please throw some light on this

    ReplyDelete
  53. As one of the reader has posted above, I am getting the "Unable to instantiate connection factory. JMS adapter was unable to look up the connection factory aqjms/XAQueueConnectionFactory neither through JNDI nor instantiate it as a Java class" ERROR.

    Any idea which JNDI the JMS Adapter is looking up ?

    ReplyDelete
  54. I am trying to connect to a foreign queue(queue in a different weblogic server)

    from my local weblogic server,but i am not getting exact steps on how to do it.

    Can you please guide?

    ReplyDelete
  55. Hi,

    I don't think you can do it, you have to be on the same jvm / weblogic. Don't think all the classes needed are serializable.

    but you can try, I tried this on 10.3.1

    thanks

    ReplyDelete
  56. Hi Edwin,
    Your blogs have been very useful for me to integrate the AQ and WLS 10.3.3 successfully.
    Now the MDB is able to process the message which came from AQ no issues there, but there is one problem which I am facing which is, Messages are not getting removed from source queue.

    Please see if you can help me.

    Here is code snippet of MDB

    @MessageDestinationConfiguration(connectionFactoryJNDIName = "jms.aq. AQConnectionFactory")
    @MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic") }, mappedName = "jms.aq.aq-Topic")
    public class TestMessageBean implements MessageListener {

    Initially I had @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO-ACKNOWLEDGE") in my ActivationConfig but there was no use so removed it.

    Thx

    ReplyDelete
  57. Hi

    Can you check the status of the aq messages , I think status 4 is handled and can be deleted by the aq cleaning processes. For this you need to set the retention time on the queu table I think and you need to set the aq processes db init parameter to for example 2

    Thanks

    ReplyDelete
  58. Edwin,

    I have learned a lot from you blog posts on integrating with Oracle AQ. Thank you.

    I am working on a POC to integrate webMethods (wM)Integration Server 7 with Oracle AQ and after jumping through several hoops I am now able to successfully consume (text) messages from the AQ topic into wM. However, everytime wM picks up a message it throws this exception -- "java.io.NotSerializableException: oracle.jms.AQjmsTextMessage".

    While this has not hindered my consuming & processing of the message - I am not sure if I this is a true success.

    Upon decompiling the AQjmsTextMessage implementation class from the aqapi.jar and comparing it with other implementations (WLS & wM) I have found that AQ does not implement the java.io.Externalizable interface in this class where Weblogic, wM and probably many other implementation do.

    I am trying to understand this error - whether this is really an issue? Do you have any clue at what point my client is throwing this error? Will this be an issue when implemented in a real environment? Any thoughts? I have seen you mention in one of your responses above that "AQ is not serializable" - what impact does this have on the consumer? How can I work around this?

    Thanks for your help!

    ReplyDelete
  59. Hi,

    It is issue, you need to be in the same jvm else you will get this error.

    Maybe you can do a mdb which retrieves these aq messages and put this in a normal jms queue of web logic

    Thanks

    ReplyDelete
  60. Thanks for the reply.
    I couldn't find the status column of the aq message table and but table is showing the STATE as 0 even though they have been already propagated.
    Retention time on the queue table is 0.
    Queue script snippet
    ,MAX_RETRIES => 5
    ,RETRY_DELAY => 0
    ,RETENTION_TIME => 0

    It will be great if you can tell how to set the aq processes db init parameter.
    Once again thanks for your help.
    Thx

    ReplyDelete
  61. Hi,

    With state = 0 , means is that the message is not processed so I find it strange that it works , maybe it does a rollback

    With retention time = 0 then the message is removed after processed.

    ReplyDelete
  62. Once again thanks for ur reply.
    Well is there any way or some sort of logs where we can see if the msgs are getting rollback.

    Thx

    ReplyDelete
  63. Are you familiar with the following error:

    oracle.jms.AQjmsException: JMS-120: Dequeue failed

    Caused by: java.io.NotSerializableException: oracle.jdbc.aq.AQDequeueOptions

    I created an AQ queue and confugured a WL foreign server as you explained using the latest JDev v. 11.1.1.4.

    And then in my standalone Java client I can lookup the WL context and my queue etc. It breaks when I try to dequeue a message created in the database using an Oracle procedure.

    ReplyDelete
  64. Hi,

    The error explains it all, you must dequeue it on the wls server , in a mdb or SOA suite / OSB

    Not in a remote jvm

    Thanks

    ReplyDelete
  65. A MDB deployed on the same WL server works. I wanted to use a Java client as a test; but Local JNDI Names are not allowed in that case anyway. Thanks
    for your help

    ReplyDelete
  66. Hi,

    Is it possible to use this method to connect to Oracle AQ Topic from Oracle Data Integrator? I've created the JMS Topic XML Technology and pointed it to the Destination that i created using Foreign Server. But there is the error:
    ODI-40202: Cannot find the target in JNDI. Thanks.

    ReplyDelete
    Replies
    1. Hi,

      it will only work when you are running ODI on the same jvm and I don't think you do. ( serialization exception ) but you can deploy a MDB which reads AQ with foreign server and puts the message in a normal JMS topic. This topic can be read by ODI.

      good luck

      Delete
    2. Hi Edwin, Your answer is very helpful! Thanks.

      Delete
  67. Hi Edwin,
    Kindly provide you insights on the performance and reliability of WebLogic JMS ( database persistence) vs WebLogic JMS ( file persistence) vs AQ.

    In a high load, high performance environment which option is the most scalable and in which option can the weblogic server recover faster from failures ( inspite of having thousands of messages in persistence).
    Thanks and regards

    ReplyDelete
    Replies
    1. Hi,

      The WLS JMS with file persistence is the fastest, off course need to put it on mirrored disks. For server migration you need to put it on a shared storage.
      The WLS DB JMS is also fast but maybe you need to put it in a HA DB like ORacle RAC or MySQL Cluster.

      AQ is not so fast and for JMS you need to use Foreign server which adds some overhead. Also AQ in Oracle RAC for HA.

      thanks

      Delete
  68. Hi Edwin,

    Thank you very much for sharing your valuable insights with us. I am currently facing a weird issue. Can you please help me with it.

    My application is running on a weblogic server and it posts a text message to an AQ with payload type as SYS.AQ$_JMS_MESSAGE. My another application, an MDB, running on an OC4J server tries to consume this message but am getting a null value for this message. I am able to see my text message available in the AQ but the thing is that it is present as a CLOB.

    As far as I have unearthed the problem, the weblogic server is using the new jdbc drivers and hence posting my message as a CLOB, whenever the message size is greater than 500. But the maximum allowed size of the VARCHAR2 field of SYS.AQ$_JMS_MESSAGE is 4000. Hence the OC4J application, which is using the older versions of jdbc drivers, is trying to get this text message from the VARCHAR2 field rather than the CLOB. This issue is not occuring when the MDB is running on the weblogic server.

    Can you please help me with this issue and provide any solution for it. Is there any way that I can make the weblogic server not to post the text message as a CLOB unless the message size is greater than 4000?

    Thanks and regards

    ReplyDelete
    Replies
    1. Hi,

      I know the issue of AQ with varchar2 4000 and clob. but can you replace in OC4J the JDBC driver with the latest version of jdk 5 or 6. Maybe there is an Oracle JDBC parameter you can set on WebLogic.

      thanks

      Delete
    2. Hi Edwin,

      Thanks for your quick reply. I can't replace the JDBC driver in the OC4J as am not sure what implications it will have on other applications running on that server.

      I tried setting a couple of parameters on the Weblogic but none seemed to work. One of them was increasing the Stream Chunk Size from 256 to 4000. Also, in the Datasources configuration, there was an option to remove the Weblogic Wrapper on dataobjects like array, clob and blob. After removing this wrapper, I could see that the message size was reduced only slightly and even that was being posted in the CLOB field.

      Also while browsing through the Oracle forums, I found this post in which an issue similar to mine has been reported but no solutions has been discussed.

      https://forums.oracle.com/forums/thread.jspa?messageID=9924662

      Can you please let me know if you know of any Oracle JDBC parameter to set in weblogic?. Any help is greatly appreciated.

      Thanks :)

      Delete
    3. Hi Edwin,

      Was googling for a solution and got a hint but dono if it will work out. Can we set the JMS Message Type as Object inside the JMS Message Header so that the consuming application will also always look for the payload in the clob field? Is this a feasible solution to the problem at hand?

      And also came across another forum post which caught my eyes:

      https://forums.oracle.com/forums/thread.jspa?threadID=710639

      Please let me know your opinion on these.

      Thanks

      Delete
    4. Hi,

      best way is to replace the aqapi.jar and the odjbc jar with the last version of 10.1.3 that would be 10.1.3.5 or add a standalone oc4j container only for this mdb.
      replacing jdbc driver should not be have any impact when you use the right one , ojdbc6 is for jdk 6

      good luck

      Delete
    5. Hi Edwin,

      Thanks for your help. We created a separate application which will post messages in AQ directly from an ejb. We added the oc4j specific ojdbc and aqapi jars in the application classpath. We will then invoke this ejb to post messages in AQ. This workaround is working for us as of now.

      Thanks

      Delete
    6. I have created ForeignServer for AQJMS in weblogic,similar to above setup. And I am invoking from OSB. Endpoint URI is "jms://localhost:7001/jms/RibAqJmsXATopicConnectionFactory/jms/etEXTCurRate"
      When i try to invoke BS(Any Xml with JMS protocol) getting the below error.

      "The invocation resulted in an error: [JMSPool:169818]The JMS connection pool named "ALSB_JMS_SessionPool_-735468633" has a configured connection factory JNDI name of "jms". However, an object that is not a javax.jms.ConnectionFactory is bound to that JNDI name. The object bound to that JNDI name has type "weblogic.jndi.internal.WLEventContextImpl".."

      Same setup is working with java code, but its not working from OSB.
      Is that required any special set up?

      Could you plz help me to fix this issue.

      Delete
    7. Hi,

      can you try this jms://localhost:7001/jms.RibAqJmsXATopicConnectionFactory/jms.etEXTCurRate

      thanks

      Delete
    8. Thank you very much!!

      Delete
  69. Hi,

    I am trying to consume the message from AQJMS Topic,using OSB Proxy service. Its throwing the below error. My PS is Any Xml with JMS protocol. My Endpoint URI is
    jms://localhost:7001/jms.JmsXATopicConnectionFactory/jms.EXAMPHH

    ----------------------


    ----------------------

    I am missing anything or configured wrongly? Could you please help me.

    Thank you.

    ReplyDelete
  70. Below is the error.
    The Message-Driven EJB: RequestEJB-1200812697177882042--44dddb65.13d8966c9e2.-7fce is unable to connect to the JMS destination: jms.EXAMPHH. The Error was:oracle.jms.AQjmsException: ORA-24047: invalid agent name RequestEJB-1200812697177882042, agent name should be of the form NAME
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 6234
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_AQJMS", line 129
    ORA-06512: at line 1

    Nested exception: java.sql.SQLException: ORA-24047: invalid agent name RequestEJB-1200812697177882042, agent name should be of the form NAME
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 6234
    ORA-06512: at line 1
    ORA-06512: at "SYS.DBMS_AQJMS", line 129
    ORA-06512: at line 1

    The message-driven bean RequestEJB-1200812697177882042--44dddb65.13d8966c9e2.-7fce was configured to
    use a JMS Topic, requires container-managed transactions, and uses a foreign JMS provider. Only one thread will be used to receive and process all messages.

    ReplyDelete
    Replies
    1. Hi,

      did you add a jms-client-id to your MDB so it uniquely identifies the jms client session
      see this for more info http://docs.oracle.com/cd/E23943_01/web.1111/e15493/topic_sub_ids.htm

      and did you create an agent in the oracle database with the same name on the AQ Topic.

      Thanks

      Delete
  71. Hi Edwin,
    Thank you very much for sharing your valuable insights with us.
    I am new in Java and JMS either. I have a question about the "First create a Queue and Queue table with SYS.AQ$_JMS_MESSAGE as payload type in your Oracle Database and make sure you enable enqueue /dequeue on this Queue." I created type and queue as below script. I just want to confirm that those steps are correct or not. If not, can you give me the way to create queue, table queue and type which you mentioned above

    CREATE TYPE demo_queue_payload_type AS OBJECT
    (CLUSTER_OWNER VARCHAR2(30),
    DEPENDENCIES VARCHAR2(8),
    COMPRESSION VARCHAR2(8),
    DROPPED VARCHAR2(3),
    OWNER VARCHAR2(30)
    )

    egin
    DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table => 'demo_queue_table_source',
    queue_payload_type => 'demo_queue_payload_type',
    multiple_consumers => TRUE);
    end;

    begin
    DBMS_AQADM.CREATE_QUEUE(queue_name => 'demo_queue_source',
    queue_table => 'demo_queue_table_source');
    end;

    begin
    DBMS_AQADM.START_QUEUE(queue_name => 'demo_queue_source');
    end;

    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi,

      looks great but this is a Oracle object type ( AQ) and not JMS compatible.

      Thanks

      Delete
  72. Hi Edwin,
    I found the way to create Queue and Queue table with SYS.AQ$_JMS_MESSAGE as payload type. However, I am looking for solution for transfering data between 2 tables in 2 databases and using AQ. May you give me the solution for it? If it is possible, can you guide me in detail for each step?

    Thanks for your helps.

    ReplyDelete
    Replies
    1. Hi,

      Do you want to use a service bus , is so you can fire an event and listen on this queue with a jms adapter ( with jms foreign server ) or use an AQ adapter with a oracle object type as payload. then update the other table with a DB adapter.

      Or use a java MDB and EJB / JPA to do the same.

      Or use Oracle Stream this also uses AQ to synchronize and can keep tables in sync. this can be configured in the db console

      Thanks

      Delete
  73. This comment has been removed by the author.

    ReplyDelete
  74. Hi Edwin,
    I want my MDB to listen to Oracle AQ.
    I've created Foreign Server in Weblogic and created MDB as mentioned in
    https://blogs.oracle.com/soaproactive/entry/jms_step_6_how_to
    It is perfectly working but my requirement is not to use SOA suite. JMS adapter is available in Weblogic server deployments only if we install SOA suite.
    Can the same be done without SOA suite/JMS adapter. (Requirement is to continuously listen to AQ in Oracle DB and get messages asynchronously )

    Here is my MDB

    import javax.jms.TextMessage;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.annotation.Resource;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.MessageDriven;
    import javax.ejb.MessageDrivenContext;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.ObjectMessage;
    import javax.sql.DataSource;


    @MessageDriven(
    name = "AQMDBTest",
    mappedName = "queue/USERQUEUE",
    activationConfig = {
    @ActivationConfigProperty(
    propertyName="connectionFactoryJndiName", propertyValue="AqJmsForeignServerConnectionFactory"),
    @ActivationConfigProperty(
    propertyName="destinationType", propertyValue="javax.jms.Queue")

    } )

    public class MessageDrivenEJBBean implements MessageListener {

    private Connection connection;
    private DataSource dataSource;

    public void onMessage(Message message) {
    if (message instanceof TextMessage) {
    try {
    System.out.println("AQMDBTest: text message "+((TextMessage)message).getText()+" " +
    "processed");
    } catch (JMSException e) {
    e.printStackTrace();
    }
    } else {
    System.out.println("AQMDBTest: generic message "+message.toString()+" of type " +
    ""+message.getClass().getName()+" processed");
    }
    }


    }


    I'm getting the following error if i run my MDB

    <The Message-Driven EJB: AQMDBTest is unable to connect to the JMS destination: queue/USERQUEUE. The Error was:
    The destination for the MDB AQMDBTest(Application: j2ee-app, EJBComponent: ModelEJB.jar) could not be resolved at this time. Please ensure the destination is available at the JNDI name queue/USERQUEUE.

    ReplyDelete
    Replies
    1. Hi,

      No need for a JMS adapter , it is basically the same as normal JMS only for AQ you will use foreign server

      can you look at the jndi tree on the weblogic server if it exists and you need to use the local jndi names of the foreign server entries

      Thanks

      Delete
    2. HI Edwin,
      Thank you for the reply.
      My MDB is able to listen to Oracle AQ without the JMS Adapter.
      Can you please tell in brief regarding when JMS Adapter should be used because in the below oracle blog, in step 4: "Create a JMS Adapter Connection Pool in Weblogic Server" it clearly says that we need to configure JMS Adapter for the MDB to work. Where/ when is that configuration used.
      Link: https://blogs.oracle.com/soaproactive/entry/jms_step_6_how_to

      Delete
  75. Mr Edwin,

    I'm trying to listen to AQ messages in Websphere. I created a JMS Provider, Connection Factory, and Queue. We don't have a need to send messages to AQ (An Oracle Trigger inserts records in aq_table). We only want the MDBs to listen to messages. Everything looks right except that I get this error, Do I have to initiate a look up to "oracle.jms.AQjmsInitialContextFactory" to avoid this exception? Please advise. Thank you.

    javax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete. The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both
    at oracle.jms.AQjmsContext.incompleteConfiguration(AQjmsContext.java:87)
    at oracle.jms.AQjmsContext.(AQjmsContext.java:73)
    at oracle.jms.AQjmsInitialContextFactory.getInitialContext(AQjmsInitialContextFactory.java:37)
    at org.apache.aries.jndi.ContextHelper.getInitialContextUsingBuilder(ContextHelper.java:237)
    at org.apache.aries.jndi.ContextHelper.getContextProvider(ContextHelper.java:206)
    at org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:139)
    at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:49)

    ReplyDelete
    Replies
    1. Hi,

      did you also provide the jndi-property for the datasource = jdbc/aqjmsds
      or java.naming.security.principal, credentials and db_url =jdbc:oracle:thin:@{hostname}:{port}:{sid}

      Thanks

      Delete
    2. Hi,
      I am also looking to connect Oracle AQ ( send messages to Oracle AQ) , and read messages from Oracle AQ ( MDB implementation) on Websphere application server.
      This is what I have done.
      1. Created a foreign server on Weblogic with foreign connection factory and foreign destination ( topic).
      2. Created a JMS Provider on Websphere application and provided the initial context as Weblogics initial context and provider url as web logic url.
      3. I have configured the data source on Weblogic end as Non XA.
      4. On webphere side, I have created Connection Factory and Topic and configured them with newly created JMS Provider.
      Caused by: java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
      java.io.InvalidClassException: oracle.jms.AQjmsDestination; local class incompatible: stream classdesc serialVersionUID = 2548231771542142351, local class serialVersionUID = -3840663619446462734
      at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:245)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
      at weblogic.jndi.internal.ServerNamingNode_1036_WLStub.lookup(Unknown Source)
      at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:424)
      ... 75 more
      Caused by: java.io.InvalidClassException: oracle.jms.AQjmsDestination; local class incompatible: stream classdesc serialVersionUID = 2548231771542142351, local class serialVersionUID = -3840663619446462734
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:640)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1617)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1512)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1766)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:364)
      at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
      at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
      at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
      at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
      at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:243)
      ... 79 more

      I am not sure, what I am missing here.
      Also I need to configure MDB's on Websphere Application Server , listening to Foreign Server JMS Destinations on Weblogic. Can it be done ?
      4. When I try to send messages, it fails with exception below.

      Delete
    3. Hi,

      I think this is an easy fix, can you replace the AQ jar on websphere with the one of weblogic.

      It looks like you got 2 different AQ jars.

      Thanks

      Delete
  76. Hi
    what is difference between aq and jms adapter?

    ReplyDelete
    Replies
    1. Hi,

      AQ is the Oracle Queue implementation in the database based on Oracle objects or on JMS. it looks like JMS.

      Thanks

      Delete
  77. Hi,

    my requirement is to produce message using OSB, in these AQ's.i have created ForeignJMS connection factory

    jms://localhost:7001/jms.AqJmsForeignServerConnectionFactory/jms.USERQUEUE

    here is my ENDpoint URI

    it throws below error

    ms.AqJmsForeignServerConnectionFactory failed: javax.naming.NameNotFoundException: Unable to resolve 'jms.AqJmsForeignServerConnectionFactory'. Resolved 'jms'; remaining name 'AqJmsForeignServerConnectionFactory'.

    ReplyDelete
    Replies
    1. Hi,

      is your foreign server targeting ok ? , I think you used target it on the adminserver when using port 7001

      Delete
  78. Hi,

    thanks for the Info...I am facing a weird error though..
    I trying to post an xml to from a camel flow to an Oracle AQ. having success with messages less than 4000 bytes. But with messages more than 4000 bytes, i see "oracle.jms.AQjmsException: ORA-00942: table or view does not exist" error. Seems like Oracleaq jar is not exactly converting the text message to clob as size is more than 4000 bytes, and instead trying to post it to OracleAQ as an varchar...and hence this error.
    Any ideas?

    ReplyDelete
    Replies
    1. Hi,

      Did you grant update,select ,delete and insert on the queue table for this oracle user.

      Thanks

      Delete
    2. Hi Biemond,

      Good Article. Thanks for posting the same.

      we have similar functionality in Oracle Applications Adapter as well when working on E Business Suite.

      what are the limitations to the Oracle AQ Adapter and where exactly i can use these adapters when i have an option of using any of them

      Thanks


      Delete
  79. Hi,
    I am tring to create simple file write service in OSB. I have one PS with Service Type = Any XML,Protocol = JMS and Endpoint URL jms://host:port/XATopicConnectionFactory/Topic
    and Destination Type = Topic,Topic Message Distribution = Compatibility.
    My topic is already there on the remote server with two RIB Messages.
    In the Message Flow tab, proxy service is connected with the business service.

    My BS is of XML type with Transport = file, Protocol = file and endPoint URL is a location for the output file. For example, file:////tmp.

    When I execute this the PS and Empty file is created in the destinationm folder and no error is displayed on the console but why PS is not picking up the message from the topic.

    Please guide me where I am going wrong.
    waiting for a quick help.

    ReplyDelete
  80. Hi Biemond,

    good tutorial and answers you gave.
    I'm running under weblogic 12.1.2 and get an error Got exception code -24033: ORA-24033: no recipients for message when enqueing a message through PL/SQL.

    My MDB is running but seems that it is not registered as subscriber.

    Can you please give any tips / idea about possible wrong configuration ?

    Thanks,

    ReplyDelete
  81. Hello,

    I have a Weblogic client application and i have problems to create the connection to the topic. After 2 minutes trying to connect to the topic appear this message:

    Exception in thread "main" weblogic.jms.common.JMSException

    Can someone please help.

    Thank you very much.

    Ana

    ReplyDelete
  82. Hi Biemond,

    Very nice article.
    I have a requirement of pushing event to WF_BPEL_Q from java embedded code in bpel. I don't have access to "apps" password so cannot connect using db url. I can only use Connection Factory and Datasources configured on weblogic server. I used your code, it compiles fine but at runtime it throws classcast exception at following statement -

    QueueConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(ds);

    Can you suggest me the correct approach to push data from java to WF_BPEL_Q using weblogic JNDI.

    Thanks

    ReplyDelete
  83. Lookup Queue Connection Factory : aqjms/JmsAqForeignConnectionFactory
    JNDI lookup failed: javax.naming.NamingException: Cannot resolve name:aqjms/JmsAqForeignConnectionFactory [Root exception is javax.naming.NamingException: Unrecognized prefix in: aqjms/JmsAqForeignConnectionFactory]

    ReplyDelete
  84. Hi,
    I am getting the following error when trying to test the OSB payload...could you please suggest what is the work around to fix it

    <exception>com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/EnterpriseProjectAccountingServices1.0/Adpaters/AQ/NOVORA/Inbound/Project/NOVORAPAAQProducer [ Enqueue_ptt::Enqueue(XXPA_PROJECT_OBJ) ] - WSIF JCA Execute of operation 'Enqueue' failed due to: JCA Binding Component connection issue.
    JCA Binding Component is unable to create an outbound JCA (CCI) connection.
    servicebus:/WSDL/EnterpriseProjectAccountingServices1.0/Adpaters/AQ/NOVORA/Inbound/Project/NOVORAPAAQProducer [ Enqueue_ptt::Enqueue(XXPA_PROJECT_OBJ) ] - : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: javax.resource.ResourceException: Failed to setup the Resource Adapter Connection for enlistment in the transaction, Pool = 'eis/EFS/NOVORA/PA/AQ/Inbound', java.lang.ClassCastException: weblogic.connector.transaction.outbound.XAWrapper.
    ; nested exception is:
    BINDING.JCA-12511
    JCA Binding Component connection issue.
    JCA Binding Component is unable to create an outbound JCA (CCI) connection.
    servicebus:/WSDL/EnterpriseProjectAccountingServices1.0/Adpaters/AQ/NOVORA/Inbound/Project/NOVORAPAAQProducer [ Enqueue_ptt::Enqueue(XXPA_PROJECT_OBJ) ] - : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: javax.resource.ResourceException: Failed to setup the Resource Adapter Connection for enlistment in the transaction, Pool = 'eis/EFS/NOVORA/PA/AQ/Inbound', java.lang.ClassCastException: weblogic.connector.transaction.outbound.XAWrapper.
    Please make sure that the JCA connection factory and any dependent connection factories have been configured with a sufficient limit for max connections. Please also make sure that the physical connection to the backend EIS is available and the backend itself is accepting connections.

    ReplyDelete
  85. Hai...any one can help... what is the dequeue in jms queue ?

    ReplyDelete
  86. HI Abhishek, did you find the solution for the above problem

    ReplyDelete