LoginService is cleared when second rest dsl service is added

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LoginService is cleared when second rest dsl service is added

adie
Hello,
  I have a strange behavior with Camel 2.17 and camel-jetty9 (2.17.0 referencing jetty 9.2.15.v20160210). I am currently having following service:

  restConfiguration()
                .component("{{rest.component}}")
                .host("{{restService.host}}")
                .port("{{rest.port}}")
                .bindingMode(RestBindingMode.json)
                //Enable the basic auth.
                .endpointProperty("handlers", "#securityHandler")
                .endpointProperty("matchOnUriPrefix", "true")
                .enableCORS(true)
                .dataFormatProperty("prettyPrint", "true");

        rest("{{rest.BasePath}}")
                .consumes("{{rest.Consumes}}")
                .produces("{{rest.Produces}}")
                .post("{{rest.ResourceName}}")
                .type(SomeRequest.class)
                .outType(SomeResponse.class)
                .route()
...

We have a basic auth and everything works as designed.
Problem starts when we add second service, because we are getting " No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator... in org.eclipse.jetty.security.ConstraintSecurityHandler..."

This is happening because as soon as we get second .get/.post rest dsl will stop and restart the security handler again while initializing second service. There, on stop security handler will clear it's login service as it is not a managed bean (at least in scope of Jetty, it is a Spring bean).

Best Regards,
  Marcin
Reply | Threaded
Open this post in threaded view
|

Re: LoginService is cleared when second rest dsl service is added

Claus Ibsen-2
Can you try with a newer Camel release, and the upcoming 2.17.7 release

On Tue, May 16, 2017 at 5:59 PM, adie <[hidden email]> wrote:

> Hello,
>   I have a strange behavior with Camel 2.17 and camel-jetty9 (2.17.0
> referencing jetty 9.2.15.v20160210). I am currently having following
> service:
>
>
>
> We have a basic auth and everything works as designed.
> Problem starts when we add second service, because we are getting " No
> LoginService for
> org.eclipse.jetty.security.authentication.BasicAuthenticator... in
> org.eclipse.jetty.security.ConstraintSecurityHandler..."
>
> This is happening because as soon as we get second .get/.post rest dsl will
> stop and restart the security handler again while initializing second
> service. There, on stop security handler will clear it's login service as it
> is not a managed bean (at least in scope of Jetty, it is a Spring bean).
>
> Best Regards,
>   Marcin
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LoginService-is-cleared-when-second-rest-dsl-service-is-added-tp5799654.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: LoginService is cleared when second rest dsl service is added

adie
Hi Claus,
  Many thanks for the response. For 2.17.6 the behavior is the same. For 2.18 I need to fix some dependency errors, so I will try a bit later. Just if you are interested, below is a full stack trace:
(Camel 2.17.0)
Related cause: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'camelContext': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
	at my.package.placeholder.application.GetPaymentDetailsApp.main(GetPaymentDetailsApp.java:338)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext' defined in my.package.placeholder.application.GetPaymentDetailsApp: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@4519f676 in org.eclipse.jetty.security.ConstraintSecurityHandler@78ec89a6
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:534)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:523)
	at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1162)
	at org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:73)
	at org.apache.camel.spring.CamelBeanPostProcessor$1$1.getCamelContext(CamelBeanPostProcessor.java:106)
	at org.apache.camel.impl.CamelPostProcessorHelper.doGetEndpointInjection(CamelPostProcessorHelper.java:157)
	at org.apache.camel.impl.CamelPostProcessorHelper.getEndpointInjection(CamelPostProcessorHelper.java:152)
	at org.apache.camel.impl.CamelPostProcessorHelper.createInjectionProducerTemplate(CamelPostProcessorHelper.java:289)
	at org.apache.camel.impl.CamelPostProcessorHelper.getInjectionValue(CamelPostProcessorHelper.java:205)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:195)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor$1.doWith(DefaultCamelBeanPostProcessor.java:182)
	at org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:73)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:168)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:82)
	at org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:150)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	... 10 more
Caused by: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@4519f676 in org.eclipse.jetty.security.ConstraintSecurityHandler@78ec89a6
	at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:76)
	at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:384)
	at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:449)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
	at org.eclipse.jetty.server.Server.start(Server.java:387)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
	at org.eclipse.jetty.server.Server.doStart(Server.java:354)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:338)
	at org.apache.camel.http.common.HttpCommonEndpoint.connect(HttpCommonEndpoint.java:126)
	at org.apache.camel.http.common.HttpConsumer.doStart(HttpConsumer.java:54)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
	at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3275)
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:3569)
	at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3505)
	at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3435)
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3203)
	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3059)
	at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2854)
	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2850)
	at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2873)
	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2850)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2819)
	at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:275)
	at org.apache.camel.spring.SpringCamelContext.afterPropertiesSet(SpringCamelContext.java:122)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
	... 34 more
Related cause:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'camelContext': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:347)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:534)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:523)
	at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1162)
	at org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:73)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:87)
	at org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:150)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:342)
	at org.apache.camel.spring.spi.SpringInjector.newInstance(SpringInjector.java:39)
	at org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:87)
	at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:399)
	at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:386)
	at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:419)
	at my.package.placeholder.application.GetPaymentDetailsApp.setupCamelContext(GetPaymentDetailsApp.java:172)
	at org.apache.camel.spring.javaconfig.CamelConfiguration.camelContext(CamelConfiguration.java:161)
	at my.package.placeholder.application.GetPaymentDetailsApp$$EnhancerBySpringCGLIB$$e0e65f78.CGLIB$camelContext$11(<generated>)
	at my.package.placeholder.application.GetPaymentDetailsApp$$EnhancerBySpringCGLIB$$e0e65f78$$FastClassBySpringCGLIB$$68ef99fd.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)
	at my.package.placeholder.application.GetPaymentDetailsApp$$EnhancerBySpringCGLIB$$e0e65f78.camelContext(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:534)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:523)
	at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1162)
	at org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:73)
	at org.apache.camel.spring.CamelBeanPostProcessor$1$1.getCamelContext(CamelBeanPostProcessor.java:106)
	at org.apache.camel.impl.CamelPostProcessorHelper.doGetEndpointInjection(CamelPostProcessorHelper.java:157)
	at org.apache.camel.impl.CamelPostProcessorHelper.getEndpointInjection(CamelPostProcessorHelper.java:152)
	at org.apache.camel.impl.CamelPostProcessorHelper.createInjectionProducerTemplate(CamelPostProcessorHelper.java:289)
	at org.apache.camel.impl.CamelPostProcessorHelper.getInjectionValue(CamelPostProcessorHelper.java:205)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:195)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor$1.doWith(DefaultCamelBeanPostProcessor.java:182)
	at org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:73)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:168)
	at org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:82)
	at org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:150)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
	at my.package.placeholder.application.GetPaymentDetailsApp.main(GetPaymentDetailsApp.java:338)
Reply | Threaded
Open this post in threaded view
|

Re: LoginService is cleared when second rest dsl service is added

adie
For Camel 2.19 and Jetty 9.3.14.v20161028 stack trace is bit different but error is the same (I will try to prepare an example later):
Exception in thread "main" org.apache.camel.spring.javaconfig.CamelSpringJavaconfigInitializationException: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@69796bd0 in org.eclipse.jetty.security.ConstraintSecurityHandler@40df6090
	at org.apache.camel.spring.javaconfig.RoutesCollector.onApplicationEvent(RoutesCollector.java:88)
	at org.apache.camel.spring.javaconfig.RoutesCollector.onApplicationEvent(RoutesCollector.java:33)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
	at my.custom.package.application.GetPaymentDetailsApp.main(GetPaymentDetailsApp.java:338)
Caused by: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@69796bd0 in org.eclipse.jetty.security.ConstraintSecurityHandler@40df6090
	at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:76)
	at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:354)
	at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:448)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.server.Server.start(Server.java:422)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
	at org.eclipse.jetty.server.Server.doStart(Server.java:389)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:354)
	at org.apache.camel.http.common.HttpCommonEndpoint.connect(HttpCommonEndpoint.java:174)
	at org.apache.camel.http.common.HttpConsumer.doStart(HttpConsumer.java:54)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
	at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3471)
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:3788)
	at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3724)
	at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3644)
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3408)
	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3262)
	at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:201)
	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3046)
	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3042)
	at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3065)
	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3042)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2980)
	at org.apache.camel.spring.javaconfig.RoutesCollector.onApplicationEvent(RoutesCollector.java:84)
	... 9 more
Reply | Threaded
Open this post in threaded view
|

Re: LoginService is cleared when second rest dsl service is added

adie
Ok,
quick fix for that was to use HashLoginService instead of custom class implementing LoginService. As HashLoginService extends AbstractLifeCycle it is not being sanitized on stop of security handler (when second service is added).

adie
Reply | Threaded
Open this post in threaded view
|

Re: LoginService is cleared when second rest dsl service is added

Claus Ibsen-2
Hi

Can you tell more about how that quick-fix works and what you have
done to make it? Maybe there is something we can do in the camel-jetty
source code, and if so you are welcome to look at providing a fix as a
.patch or github PR

On Mon, May 29, 2017 at 6:05 PM, adie <[hidden email]> wrote:

> Ok,
> quick fix for that was to use HashLoginService instead of custom class
> implementing LoginService. As HashLoginService extends AbstractLifeCycle it
> is not being sanitized on stop of security handler (when second service is
> added).
>
> adie
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LoginService-is-cleared-when-second-rest-dsl-service-is-added-tp5799654p5801309.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2