camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfaath <jfa...@apache.org>
Subject Re: Deploying as web app with jetty endpoint
Date Fri, 09 Apr 2010 14:39:38 GMT

Yea, I tried that based on thread I saw yesterday.  I still get the same
error.  I'm wondering if it has something to do with the way the camel web
console works.  Do I need to put anything in the beans file
(applicationContext.xml)?  Here is my web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
  <description>
    Apache Camel Web Console
  </description>

  <display-name>Camel Console</display-name>
 
  <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>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext.xml</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>

  <listener>
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

  <filter>
    <filter-name>sitemesh</filter-name>
   
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter>
    <filter-name>Jersey Filter</filter-name>
   
<filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class>
    <init-param>
     
<param-name>com.sun.jersey.config.property.resourceConfigClass</param-name>
     
<param-value>org.apache.camel.web.util.CamelResourceConfig</param-value>
    </init-param>
    <init-param>
      <param-name>com.sun.jersey.config.feature.Redirect</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
     
<param-name>com.sun.jersey.config.feature.ImplicitViewables</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>org.apache.camel.web</param-value>
    </init-param>
    <init-param>
     
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
      <param-value>/(images|css|js)/.*</param-value>
    </init-param>
    <init-param>
     
<param-name>com.sun.jersey.config.property.WadlResourceUri</param-name>
      <param-value>/api</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>Jersey Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <include-prelude>/WEB-INF/jspf/header.jspf</include-prelude>
    </jsp-property-group>
  </jsp-config>
</web-app>








willem.jiang wrote:
> 
> You need make sure the CamelHttpTransportServle is deployed first, than 
> load the camel context.
> You can take a look at this example first[1].
> 
> [1] 
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/test/resources/org/apache/camel/component/servlet/web-spring.xml
> jfaath wrote:
>> This is exactly like what I was looking for.  However, I tried out the
>> simple
>> example defined in the link you provided and I keep getting this error:
>> 
>> SEVERE: Exception sending context initialized event to listener instance
>> of
>> class org.springframework.web.context.ContextLoaderListener
>> org.apache.camel.RuntimeCamelException:
>> java.lang.IllegalArgumentException:
>> Cannot find the deployed servlet, please configure the ServletComponent
>> or
>> configure a org.apache.camel.component.servlet.CamelHttpTransportServlet
>> servlet in web.xml 
>> 
>> which appears to happen when the route is being read.  Any ideas?
>> 
>> 
>> 
>> willem.jiang wrote:
>>> Hi,
>>>
>>> If you don't want start the jetty engine, you can try to use the 
>>> camel-servlet[1] component.
>>>
>>> [1]http://camel.apache.org/servlet.html
>>>
>>>
>>> Willem
>>>
>>> jfaath wrote:
>>>> I've deployed my camel app as a web application in tomcat.  Works
>>>> great. 
>>>> The
>>>> main starting point for my route is an http server endpoint using
>>>> camel-jetty.  So, it seems weird to me that tomcat starts and then
>>>> starts
>>>> a
>>>> jetty instance.  Is there any way to use the actual tomcat instance for
>>>> this
>>>> endpoint?  Does this make any sense?
>>>>
>>>> Regards,
>>>>
>>>> JF
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Deploying-as-web-app-with-jetty-endpoint-tp28171746p28191050.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message