I am using version 2.10.2 so shouldn't have to camel-jboss jar(which I can't
find easily either) and I don't have any special converter which I need to
list. 

All I am trying is modifying the camel-example-jms-file to use my MQ queue
and put contents on queue which will be forwarded to a file in my mbean.


.
.
.
public class PayrollNotificationPublisher2 extends ServiceMBeanSupport
                implements PayrollNotificationPublisher2MBean {
        
        private static final Logger log =
Logger.getLogger(PayrollNotificationPublisher2.class.getCanonicalName());       
        private CamelContext context = null;
        private ProducerTemplate template = null;
        private String outboundQueueName ="/jms/mqseries/MyQ";
        private String queueFactoryName ="/jms/mqseries/MQConnectionFactory";
        
        public PayrollNotificationPublisher2(){}
        
        @Override
        public void startService(){
                setCamelContext();
        }
        
        @Override
        public void stopService(){
        try {
                        context.stop();
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        log.error(e.getMessage());
                }
        }       
        
        public void setCamelContext() {
                // TODO Auto-generated method stub
        // START SNIPPET: e1
        context = new DefaultCamelContext();
        // END SNIPPET: e1
        // Set up the ActiveMQ JMS Components
        // START SNIPPET: e2
        
                JNDIUtil jndiUtil = new JNDIUtil();
                log.debug("Looking up outbound queue connection factory: " +
queueFactoryName);
                QueueConnectionFactory  connectionFactory =
jndiUtil.getQueueConnectionFactory("vm:"+queueFactoryName);
       
        
        // Note we can explicit name the component
        context.addComponent("jms-mq",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        // END SNIPPET: e2
        // Add some configuration by hand ...
        // START SNIPPET: e3
        try {
                        context.addRoutes(new RouteBuilder() {
                            public void configure() {
                               // 
from("jms-mq:queue:/jms/mqseries/MyQ").to("file://test");
                                 from("vm:/jms/mqseries/MyQ").to("file://test");
                            }
                        });
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        log.error(e.getMessage());
                }
        
        // Camel template - a handy class for kicking off exchanges
        // START SNIPPET: e4
        template = context.createProducerTemplate();
        // END SNIPPET: e4
        // Now everything is set up - lets start the context
        try {
                        context.start();
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        log.error(e.getMessage());
                }        
        }

        public void sendMessage(String putOnQ) throws JMSException {

        // Now send some test text to a component - for this case a JMS
Queue
        // The text get converted to JMS messages - and sent to the Queue
        // test.queue
        // The file component is listening for messages from the Queue
        // test.queue, consumes
        // them and stores them to disk. The content of each file will be
the
        // test we sent here.
        // The listener on the file component gets notified when new files
are
        // found ... that's it!
        // START SNIPPET: e5
        for (int i = 0; i < 5; i++) {
            //template.sendBody("test-jms:queue:test.queue", putOnQ +" "+
i);
                template.sendBody("/jms/mqseries/MyQ", putOnQ +" "+ i);
        }
        // END SNIPPET: e5


        }
        
}


I am still getting the same error while creating the default camel context?





--
View this message in context: 
http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724863.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to