I'm using Synapse 1.2.
I've placed all the jars in the lib folder.

Connecting from Java has been tested with the following code:

package jmstest;

import java.util.Hashtable;
import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory; import javax.jms.QueueReceiver; import 
javax.jms.QueueSender; import javax.jms.QueueSession; import javax.jms.Session; 
import javax.jms.TextMessage; import javax.naming.Context; import 
javax.naming.InitialContext; import javax.naming.NamingException;

public class Caller {
    public Caller() {
    }


    /**
     * @webmethod
     */
    public static void main(String[] args) throws Exception {
        try {
            System.out.println("begin");

            // Get the Initial Context
            InitialContext jndiContext;
            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY,
                    "com.evermind.server.rmi.RMIInitialContextFactory");
            env.put(Context.SECURITY_PRINCIPAL, "jazn.com/dhub");
            env.put(Context.SECURITY_CREDENTIALS, "pwd");
            env.put(Context.PROVIDER_URL,
                    "ormi://192.168.82.16:3204/WAMDataHub");

            // LookUp the QueueTable and create the QueueConnectionFactory
            jndiContext = new InitialContext(env);

            System.out.println("connfactory");

            QueueConnectionFactory queueCF =
                
(QueueConnectionFactory)jndiContext.lookup("java:comp/resource/WAMJMS/QueueConnectionFactories/myQCF");

            System.out.println("get queue");

            // Lookup the Queue and create its object
            Queue queue =
                
(Queue)jndiContext.lookup("java:comp/resource/WAMJMS/Queues/TEST2Q");

            System.out.println("connection");

            // Create a Connection to the QueueTable
            QueueConnection queueConnection = queueCF.createQueueConnection();

            System.out.println("start");

            // Start the Connection
            queueConnection.start();

            System.out.println("session");

            // Create a Session to the queue
            QueueSession queueSession =
                queueConnection.createQueueSession(true,
                                                   Session.AUTO_ACKNOWLEDGE);
            System.out.println("receiver");

            if (queueSession == null)
                System.out.println("QS IS NULL");

            if (queue == null)
                System.out.println("queue IS NULL");
            QueueReceiver rec;
            rec = queueSession.createReceiver(queue);
            System.out.println("receive");

            if (rec == null)
                System.out.println("REC IS NULL");
            Object object = rec.receive();
            TextMessage msg = null;
            if (object != null) {
                System.out.println("not null");

                // Create a Text Messleage to be enqueued
                msg = (TextMessage)object;

            } else
                System.out.println("null");

            System.out.println("done");

            rec.close();
            queueSession.close();
            queueSession = null;
            queueConnection.close();
            queueConnection = null;


        } catch (NamingException e) {
            System.out.println(e.toString());
            throw e;
        } catch (JMSException ej) {
            System.out.println(ej.getLocalizedMessage());
            throw ej;
        } catch (NullPointerException ejj) {
            System.out.println(ejj.getLocalizedMessage());
            throw ejj;
        }

    }

}

Thanks,

Dan

-----Original Message-----
From: Asankha Perera [mailto:[email protected]] On Behalf Of Asankha C. 
Perera
Sent: Thursday, January 15, 2009 12:12 PM
To: [email protected]
Subject: Re: Connecting to OracleAQ JMS

Hi Daniel
> I'm trying to connect to OracleAQ JMS but when I start up the log stops at 
> the following and initialization never completes (it never gets to the "Ready 
> for processing" message):
>
Are you using Synapse 1.2 or the code from the trunk?
> Here are the connection details I'm using in axis2.xml:
>
>     <transportReceiver name="jms" 
> class="org.apache.axis2.transport.jms.JMSListener">
>         <parameter name="default" locked="false">
>                 <parameter name="java.naming.factory.initial" 
> locked="false">com.evermind.server.rmi.RMIInitialContextFactory</parameter>
>                 <parameter name="java.naming.provider.url" 
> locked="false">ormi://192.168.82.16:3204/WamDataHub</parameter>
>                 <parameter name="transport.jms.ConnectionFactoryJNDIName" 
> locked="false">java:comp/resource/WAMJMS/QueueConnectionFactories/myQCF</parameter>
>                 <parameter name="java.naming.security.principal" 
> locked="false">jazn.com/dhub</parameter>
>                 <parameter name="java.naming.security.credentials" 
> locked="false">pwd</parameter>
>         </parameter>
>     </transportReceiver>
>
>     <transportSender name="jms" 
> class="org.apache.axis2.transport.jms.JMSSender"/>
>
> Any ideas?
>
Have you placed the com.evermind.server.rmi.RMIInitialContextFactory
class and all of its dependencies (+ any native libs) in the lib
directory etc?

Also, can you connect to your JMS provider with a simple plain old JMS
client using the above configuration elements?

cheers
asankha

--
Asankha C. Perera
http://adroitlogic.org

http://esbmagic.blogspot.com


The information in this message is confidential and may be legally privileged. 
It is intended solely for the addressee. Access to this message by anyone else 
is unauthorised. If you are not the intended recipient, any disclosure, 
copying, or distribution of the message, or any action or omission taken by you 
in reliance on it, is prohibited and may be unlawful. Please immediately 
contact the sender if you have received this message in error.

The views and opinions expressed in this email may not reflect the views and 
opinions of any member of Lagan Technologies Limited, or any of its 
subsidiaries.

Lagan Technologies Limited is a company registered in Northern Ireland with 
registration number NI 28773. The registered office of Lagan Technologies 
Limited is 209 Airport Road West, Belfast, Co. Antrim, BT3 9EZ.

Reply via email to