Which version of Camel are you using? If you are using the version last then camel 2.7, you make change the web.xml like this[1] to let spring load the configuration file for you.
[1] https://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/test/resources/org/apache/camel/component/servlet/web-spring.xml -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Tuesday, August 28, 2012 at 10:44 AM, maye100 wrote: > i am created a project with camel + spring > but it is canot used,i don't know how to configure the xml files. > i see the camel doc with http://camel.apache.org/spring.html > http://camel.apache.org/spring.html > but .... > > who can help me ? thank you! > > my code: > *web.xml (http://web.xml)* > <servlet> > <servlet-name>myServlet</servlet-name> > <servlet-class> > > org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> > <init-param> > <param-name>matchOnUriPrefix</param-name> > <param-value>true</param-value> > </init-param> > <init-param> > <param-name>contextConfigLocation</param-name> > <param-value>/META-INF/spring/camel-config.xml</param-value> > </init-param> > <load-on-startup>1</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>myServlet</servlet-name> > <url-pattern>/services/*</url-pattern> > </servlet-mapping> > > > *camel-config.xml* > <bean id="fileConverter" class="com.skcc.camel.FileConvertProcessor"/> > <camelContext xmlns="http://camel.apache.org/schema/spring" id="c1"> > <route> > <from uri="servlet:/nmp?servletName=NmpServlet" /> > <to uri="direct:main" /> > </route> > > <route id="cr"> > <from uri="direct:main" /> > <process ref="fileConverter"/> > </route> > </camelContext> > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-configure-the-camel-with-spring-tp5718161.html > Sent from the Camel Development mailing list archive at Nabble.com > (http://Nabble.com).
