camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lee hanu <nishant_...@yahoo.com>
Subject RE: WebSphere MQ 5.3 and Camel 1.4.0 issue running the sample
Date Sat, 09 Aug 2008 17:21:22 GMT

Thanks for the quick response Claus.

This the how I am creating the connectionFactory


private static final String CF_CLASS_NAME
="com.ibm.mq.jms.context.WMQInitialContextFactory";
private static final String WMQ_URL = "localhost:1414/SYSTEM.DEF.SVRCONN";
    
private static final String QCF_NAME = "SampleQCF";
private static final String QUEUE_NAME = "SampleQueue";

public static void main(String args[]) throws Exception {
// START SNIPPET: e1
CamelContext context = new DefaultCamelContext();
// END SNIPPET: e1
// Set up the ActiveMQ JMS Components
// START SNIPPET: e2

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, CF_CLASS_NAME);
props.put(Context.PROVIDER_URL, WMQ_URL);
InitialContext initCtx =  new InitialContext(props);

//ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
ConnectionFactory connectionFactory = (MQConnectionFactory)
initCtx.lookup(QCF_NAME);
....
....


The rest of the code is the same.

I have the following jar in my classpath.

jdk1.5
apache-camel-1.4.0.jar
icu4j-4_0.jar
spring.jar
log4j-1.2.14.jar
commons-logging.jar
com.ibm.mq.jar
com.ibm.mq.pcf-6.0.3.jar
com.ibm.mqbind.jar
com.ibm.mqjms.jar
connector.jar
fscontext.jar
jms.jar
jndi.jar
jta.jar
ldap.jar
mqcontext.jar
postcard.jar
providerutil.jar

Thanks


Claus Ibsen wrote:
> 
> Hi Lee
> 
> Could you post some more of you sample how you get the MQ connection etc?
> 
> The problem could be a missing .jar on the classpath. When using MQ you
> need all its special .jar files (its client jars).
> 
> Or it could be because MQ is expecting the old JMS spec:
> Maybe you need to configure the connection factory to use the old JMS spec
> (1.0.x).
> 
> For instance at this page:
> http://activemq.apache.org/camel/jms.html
> there is an option named: useVersion102 
> 
> But check that you got all the correct .jars in the classpath.
> 
> 
> Good luck with WebSphere, I know it's a beast to work with. I wrestle it
> at work every day, though its now v6.0 and v6.1.
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: lee hanu [mailto:nishant_avs@yahoo.com] 
> Sent: 9. august 2008 18:50
> To: camel-user@activemq.apache.org
> Subject: WebSphere MQ 5.3 and Camel 1.4.0 issue running the sample
> 
> 
> Hi all, 
> 
> I am trying to run the camel-example-jms-file sample that comes with the
> Camel distribution. I am trying to get this sample running for WebSphere
> MQ
> 5.3. I basically created a simple Java project in eclipse and I made
> changes
> to the CamelJmsToFileExample class to get the connectionFactory for MQ.
> Now
> I am getting the following exception. Can someone let me know how to get
> Camel sample up and running for WebSphere 5.3.
> 
> Thanks for you time.
> 
> Exception in thread "main" java.lang.NoSuchMethodError:
> javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;
> 	at
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
> 	at
> org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:401)
> 	at
> org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:370)
> 	at
> org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:682)
> 	at
> org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:257)
> 	at
> org.springframework.jms.listener.AbstractJmsListeningContainer.initialize(AbstractJmsListeningContainer.java:172)
> 	at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.initialize(AbstractPollingMessageListenerContainer.java:200)
> 	at
> org.springframework.jms.listener.DefaultMessageListenerContainer.initialize(DefaultMessageListenerContainer.java:461)
> 	at
> org.springframework.jms.listener.AbstractJmsListeningContainer.afterPropertiesSet(AbstractJmsListeningContainer.java:135)
> 	at
> org.apache.camel.component.jms.JmsConsumer.doStart(JmsConsumer.java:59)
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
> 	at
> org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:359)
> 	at
> org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:557)
> 	at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:530)
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
> 	at
> com.my.camel.example.jmstofile.CamelJmsToFileExample.main(CamelJmsToFileExample.java:94)
> -- 
> View this message in context:
> http://www.nabble.com/WebSphere-MQ-5.3-and-Camel-1.4.0-issue-running-the-sample-tp18906427s22882p18906427.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WebSphere-MQ-5.3-and-Camel-1.4.0-issue-running-the-sample-tp18906427s22882p18906702.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message