Quantcast

LoginService is cleared when second rest dsl service is added

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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
|  
Report Content as Inappropriate

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
Loading...