Hi,

Can you show me the camel-config.xml?
A simple demo help me debug the issue.

Willem

janylj wrote:

willem.jiang wrote:

If you create the servlet component, you need to specify the servlet which the component will attach to.
<bean id="servlet"
class="org.apache.camel.component.servlet.ServletComponent">
        <property name="camelContext" ref="camel" />
         <property name="servletName" value="CamelServlet" />
</bean>



doesn't work, because Tomcat starts error said,

Caused by: org.springframework.beans.InvalidPropertyException: Invalid
property 'servletName' of bean class
[org.apache.camel.component.servlet.ServletComponent]: No property
'servletName' found


willem.jiang wrote:

You don't need to specify the servlet component in spring, if there is only one camel servlet created in the web context.



doesn't work, because Tomcat starts error said,

Caused by: java.lang.IllegalArgumentException: Can't find the deployied
servlet, please set the ServletComponent with it or delopy a
CamelHttpTransportServlet int the web container

What I am missing? Please note that I am using Spring ContextLoaderListener.
Thanks a lot.

my web.xml,

        <!-- location of spring xml files -->
        <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>classpath:camel-config.xml</param-value>
        </context-param>

        <!-- the listener that kick-starts Spring -->
        <listener>
        
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        
        <servlet>
                <servlet-name>CamelServlet</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>
                <load-on-startup>1</load-on-startup>
        </servlet>
        
        <servlet-mapping>
                <servlet-name>CamelServlet</servlet-name>
                <url-pattern>/services/*</url-pattern>
        </servlet-mapping>




Reply via email to