You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Karts <ka...@gmail.com> on 2015/10/22 03:36:36 UTC
Rest DSL Jetty multiple handlers causes
java.lang.StackOverflowError
Hi,
On 2.16.0, I am getting a StackOverflowError when I have multiple handlers
defined for my restConfiguration jetty component. It works with single
handlers.
<restConfiguration component="jetty" host="localhost" port="8080">
<endpointProperty key="handlers" value="securityHandler,
jettyRequestLog"></endpointProperty>
</restConfiguration>
This causes the following exception on startup:
2015-10-21 21:29:59,543 [main ] WARN AbstractLifeCycle
- FAILED org.eclipse.jetty.server.Server@58035754:
java.lang.StackOverflowError
java.lang.StackOverflowError
at
org.eclipse.jetty.server.handler.AbstractHandlerContainer.expandHandler(AbstractHandlerContainer.java:80)
at
org.eclipse.jetty.server.handler.HandlerWrapper.expandChildren(HandlerWrapper.java:123)
...(loops)
If I just use either securityHandler or jettyRequestLog alone, it works
fine.
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-Jetty-multiple-handlers-causes-java-lang-StackOverflowError-tp5772952.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Rest DSL Jetty multiple handlers causes
java.lang.StackOverflowError
Posted by Karts <ka...@gmail.com>.
FYI as a workaround to this issue, I put the securityHandler in the
restConfiguration and simply added an empty route with the other handler to
my camel context:
<restConfiguration component="jetty" host="localhost" port="8080">
<endpointProperty key="handlers"
value="securityHandler"></endpointProperty>
</restConfiguration>
<route><from uri="jetty:http://localhost:8080?handlers=jettyRequestLog"/><to
uri="mock:test"/></route>
--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-Jetty-multiple-handlers-causes-java-lang-StackOverflowError-tp5772952p5773363.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Rest DSL Jetty multiple handlers causes
java.lang.StackOverflowError
Posted by Karts <ka...@gmail.com>.
This seems similar to https://issues.jboss.org/browse/ENTESB-2619
Also for brevity, below are the two handler beans:
<bean id="constraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="admin,user"/>
<property name="authenticate" value="true"/>
</bean>
<bean id="constraintMapping"
class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="constraint"/>
<property name="pathSpec" value="/*"/>
</bean>
<bean id="securityHandler"
class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<property name="loginService">
<bean class="org.eclipse.jetty.security.HashLoginService"/>
</property>
<property name="authenticator">
<bean
class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
</property>
<property name="constraintMappings">
<list>
<ref bean="constraintMapping"/>
</list>
</property>
</bean>
<bean id="jettyRequestLog"
class="org.eclipse.jetty.server.handler.RequestLogHandler">
<property name="requestLog">
<bean class="org.eclipse.jetty.server.NCSARequestLog">
<property name="extended" value="true"/>
<property name="append" value="true"/>
</bean>
</property>
</bean>
--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-Jetty-multiple-handlers-causes-java-lang-StackOverflowError-tp5772952p5772972.html
Sent from the Camel - Users mailing list archive at Nabble.com.