Here's what I did to get my sample to work.

I put the apache-activemq-4.1.1.jar in front of the Weblogic 8.1 jar and it
seemed to work fine.


For my sample app  I used

http://java.sun.com/products/jms/tutorial/1_3_1-fcs/examples/simple/SimpleQueueSender.java
&
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/examples/simple/SimpleQueueReceiver.java

I had to make the following modification to the code.

1) Set queue name to   "dynamicQueues/SIMPLE.QUEUE"
2) To create the InitialContext using

rather than 
           jndiContext = new InitialContext();

I used the following code.
           Hashtable env = new Hashtable();
           env.put(Context.INITIAL_CONTEXT_FACTORY,
                  
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
           env.put(Context.PROVIDER_URL, "tcp://localhost:61616");
           jndiContext=  new InitialContext(env);

3) To Lookup the ConnectionFactory 

rather than 

queueConnectionFactory = (QueueConnectionFactory)
                jndiContext.lookup("QueueConnectionFactory");

I used the following..
queueConnectionFactory =
(QueueConnectionFactory)jndiContext.lookup("ConnectionFactory");

Thanks!


James.Strachan wrote:
> 
> On 11/03/2008, pjagwani <[EMAIL PROTECTED]> wrote:
>>
>>  Hi.
>>
>>  Current configuration is Weblogic 8.1, JDK 1.4.2, ActiveMQ 5.
>>
>>  Looking for code to connect to Active MQ using JMS 1.02b.
> 
> ActiveMQ supports JMS 1.1 so you'll need to add the jms 1.1 jars to
> the system/boot classpath.
> 
> ActiveMQ 5.x is based on Java 5, though you can install the
> retrotranslator JIT to work nicely on Java 1.4.x JVMs...
> http://retrotranslator.sourceforge.net/#jit
> 
>> I would also be
>>  interested in connecting to ActiveMQ using the ActiveMQ api.
> 
> That'll be JMS :)
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Looking-for-Sample-Code-JMS-1.02b-tp15976698s2354p16012630.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to