I see an older http://camel.465427.n5.nabble.com/Camel-ActiveMQ-in-Tomcat6-td474122.html thread talk about this but to understand better (and get clarification on another issue mentioned below), I would like to know the opinion of the list on the recommended way of packaging Camel in an webapp. Our Camel context is started using Spring and is used to send and consume messages from an ActiveMQ instance that is running in another server. FWIW, the webapp is deployed in Jetty and we use the ActiveMQ's PooledConnectionFactory to pool connections from Camel.
I started off with the following: In WEB-INF/lib/camel-core, camel-jms, camel-spring, camel-xstream and other webapp jars In $JETTY_HOME/lib/ext/activemq-all, activemq-pool This resulted in the container failing to start with ClassNotFoundException for org.apache.camel.component.jms.JmsComponent. After some trial and error, I ended up with the following setup which starts up the web-app and everything works fine. In WEB-INF/lib/activemq-camel, camel-jms, camel-spring, camel-xstream and other webapp jars (Hibernate, Spring etc.,) In $JETTY_HOME/lib/ext/activemq-core, activemq-pool, camel-core, commons-pool, commons-management, geronimo-j2ee-management, geronimo-jms However, the following is mentioned in the start-up log: org.apache.camel.spring.SpringCamelContext - Cannot find needed classes for JMX lifecycle strategy. Needed class is in spring-context.jar us ing Spring 2.5 or newer (spring-jmx.jar using Spring 2.0.x). NoClassDefFoundError: org/springframework/jmx/export/metadata/JmxAttributeSource [2011-06-27 20:37:00,605] [main] WARN org.apache.camel.spring.SpringCamelContext - Cannot use JMX. Fallback to using DefaultManagementStrategy (non JMX). This class is part of spring-context and is in fact available under WEB-INF/. Now should Spring framework jars also be a 'shared' to get this up and running cleanly? What is the recommended way of packaging Camel in a webapp? It would be nice to have this elaborated upon in the http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html tutorial as well. Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Recommended-way-of-packaging-Camel-in-a-web-app-tp4532417p4532417.html Sent from the Camel - Users mailing list archive at Nabble.com.