You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by MJ <ma...@aol.com> on 2015/12/02 21:08:17 UTC

Handler Chain Issues(?) With Jetty9 Component (Spring Configuration) in Camel 2.16

I am seeing differing and possible errant behaviors when chaining (via URI or
explicit use of org.eclipse.jetty.server.handler.HandlerList) handlers when
using the Jetty9 component in Camel routes.

Following are the pertinent definitions (Spring configuration):

<bean id="http.inbound"
class="org.apache.camel.component.jetty9.JettyHttpComponent9"/>

<bean id="staticResourceHandler"
class="org.eclipse.jetty.server.handler.ResourceHandler">
   <property name="resourceBase" value="." />
</bean>

<bean id="handlerList" class="org.eclipse.jetty.server.handler.HandlerList">
   <property name="handlers">
      <list>
         <ref bean="staticResourceHandler"/>
      </list>
   </property>
</bean>

When the 'staticResourceHandler' bean is referenced directly (and alone),
the following route resolves correctly: 

http://localhost:8080/hello.html

<route id="receiver.http.ui" autoStartup="false">
   <from
uri="http.inbound://http://0.0.0.0:8080/?handlers=staticResourceHandler"/>
   <to uri="stream:out"/>
</route>

However, when a HandlerList is used containing only the single (same)
handler bean, the same route results in 404 error responses (HandlerList
implements Handler):

<route id="receiver.http.ui" autoStartup="false">
   <from uri="https.inbound://http://0.0.0.0:8080/?handlers=handlerList"/>
   <to uri="stream:out"/>
</route>

Multiple beans within the same HandlerList fail as well.

A similar issue occurs when individual handler beans are chained notionally
in the URI path as opposed to explicitly in a HandlerList, a la:

<route id="receiver.http.ui" autoStartup="false">
   <from
uri="http.inbound://http://0.0.0.0:8080/?handlers=staticResourceHandler,loginHandler"/>
   <to uri="stream:out"/>
</route>

In that particular case it seems the first handler is invoked but not the
second.

Following are my Maven dependencies:

<dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.12</version>
   <scope>test</scope>
</dependency>
<dependency>
   <groupId>javax</groupId>
   <artifactId>javaee-api</artifactId>
   <version>7.0</version>
</dependency>
<dependency>
   <groupId>org.bouncycastle</groupId>
   <artifactId>bcprov-jdk15on</artifactId>
   <version>1.53</version>
</dependency>
<dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-core</artifactId>
   <version>2.16.0</version>
</dependency>
<dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-spring</artifactId>
   <version>2.16.0</version>
</dependency>
<dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-jetty9</artifactId>
   <version>2.16.0</version>
</dependency>
<dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-cxf</artifactId>
   <version>2.16.0</version>
</dependency>
<dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-stream</artifactId>
   <version>2.16.0</version>
</dependency>

Thanks for any/all insights.



--
View this message in context: http://camel.465427.n5.nabble.com/Handler-Chain-Issues-With-Jetty9-Component-Spring-Configuration-in-Camel-2-16-tp5774623.html
Sent from the Camel - Users mailing list archive at Nabble.com.