You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Gerald Kallas (Jira)" <ji...@apache.org> on 2020/05/04 09:05:00 UTC

[jira] [Commented] (CAMEL-15000) Using a registered ConstraintSecurityHandler in another Blueprint file causes an java.lang.IllegalStateException: STARTED

    [ https://issues.apache.org/jira/browse/CAMEL-15000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17098790#comment-17098790 ] 

Gerald Kallas commented on CAMEL-15000:
---------------------------------------

[~cibsen@e-ma.net] I was digging into the details a bit more. When I'm going to update the first Blueprint file with the securityHandler definition than the embedded Jetty seems to be stopped gracefully und restarted again after updating the securityHandler.
{code:java}
2020-05-04T08:52:18,722 | INFO  | fileinstall-/opt/apache-karaf-4.2.7/deploy | fileinstall                      | 10 - org.apache.felix.fileinstall - 3.6.4 | Updating bundle isp.jettyHttpComponent.xml / 0.0.0
2020-05-04T08:52:18,723 | INFO  | fileinstall-/opt/apache-karaf-4.2.7/deploy | BlueprintExtender                | 84 - org.apache.aries.blueprint.core - 1.10.2 | Destroying container for blueprint bundle isp.jettyHttpComponent.xml/0.0.0
2020-05-04T08:52:19,200 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.webconsole.gogo [178]]
2020-05-04T08:52:19,210 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.felix.inventory [154]]
2020-05-04T08:52:19,249 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.webconsole.console [176]]
2020-05-04T08:52:19,253 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Stopped HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.apache.karaf.webconsole.console [176], contextID=custom]}
2020-05-04T08:52:19,301 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.ops4j.pax.web.pax-web-extender-whiteboard [255]]
2020-05-04T08:52:19,331 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.webconsole.instance [180]]
2020-05-04T08:52:19,332 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.webconsole.features [177]]
2020-05-04T08:52:19,381 | INFO  | paxweb-config-2-thread-3 | AuthenticationFilter             | 63 - io.hawt.hawtio-war - 2.9.1 | Destroying hawtio authentication filter
2020-05-04T08:52:19,417 | INFO  | activator-1-thread-5 | CommandExtension                 | 34 - org.apache.karaf.shell.core - 4.2.7 | Unregistering commands for bundle org.apache.karaf.http.core/4.2.7
2020-05-04T08:52:19,433 | INFO  | activator-1-thread-5 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.webconsole.http [179]]
2020-05-04T08:52:19,516 | INFO  | activator-1-thread-5 | HttpPlugin                       | 179 - org.apache.karaf.webconsole.http - 4.2.7 | Http plugin deactivated
2020-05-04T08:52:19,583 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [io.hawt.hawtio-war [63]]
2020-05-04T08:52:19,596 | INFO  | paxweb-config-2-thread-3 | HawtioContextListener            | 63 - io.hawt.hawtio-war - 2.9.1 | Destroying hawtio services
2020-05-04T08:52:19,597 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Stopped HttpServiceContext{httpContext=WebAppHttpContext{io.hawt.hawtio-war - 63}}
2020-05-04T08:52:19,598 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.felix.webconsole.plugins.ds [156]]
2020-05-04T08:52:19,598 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.felix.webconsole.plugins.memoryusage [158]]
2020-05-04T08:52:19,600 | INFO  | paxweb-config-2-thread-3 | CamelHttpTransportServlet        | 326 - org.apache.camel.camel-servlet - 3.0.0 | Destroyed CamelHttpTransportServlet[CamelServlet]
2020-05-04T08:52:19,600 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [isp.servletHttpComponent.xml [324]]
2020-05-04T08:52:19,615 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Stopped HttpServiceContext{httpContext=DefaultHttpContext [bundle=isp.servletHttpComponent.xml [324], contextID=default]}
2020-05-04T08:52:19,617 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.felix.webconsole.plugins.event [157]]
2020-05-04T08:52:19,617 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Unbinding bundle: [org.apache.karaf.http.core [168]]
2020-05-04T08:52:19,635 | INFO  | paxweb-config-2-thread-3 | AbstractConnector                | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Stopped default@41bdd8b2{HTTP/1.1,[http/1.1]}{0.0.0.0:8181}
2020-05-04T08:52:19,653 | INFO  | paxweb-config-2-thread-3 | AbstractConnector                | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Stopped secureDefault@7b15cda7{SSL,[ssl, http/1.1]}{0.0.0.0:8443}
2020-05-04T08:52:19,655 | INFO  | paxweb-config-2-thread-3 | session                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | node0 Stopped scavenging
2020-05-04T08:52:19,688 | INFO  | paxweb-config-2-thread-3 | Activator                        | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | ServerControllerFactory is gone, HTTP Service is not available now.
2020-05-04T08:52:19,713 | INFO  | fileinstall-/opt/apache-karaf-4.2.7/deploy | BlueprintContainerImpl           | 84 - org.apache.aries.blueprint.core - 1.10.2 | Blueprint bundle isp.jettyHttpComponent.xml/0.0.0 has been started
2020-05-04T08:52:19,728 | INFO  | fileinstall-/opt/apache-karaf-4.2.7/deploy | fileinstall                      | 10 - org.apache.felix.fileinstall - 3.6.4 | Started bundle: blueprint:file:/opt/apache-karaf-4.2.7/deploy/isp.jettyHttpComponent.xml
2020-05-04T08:52:20,002 | INFO  | paxweb-config-2-thread-3 | JettyFactoryImpl                 | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | No ALPN class available
2020-05-04T08:52:20,003 | INFO  | paxweb-config-2-thread-3 | JettyFactoryImpl                 | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | HTTP/2 not available, creating standard ServerConnector for Http
2020-05-04T08:52:20,003 | INFO  | paxweb-config-2-thread-3 | JettyServerImpl                  | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | Pax Web available at [0.0.0.0]:[8181]
2020-05-04T08:52:20,039 | INFO  | paxweb-config-2-thread-3 | JettyFactoryImpl                 | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | No ALPN class available
2020-05-04T08:52:20,040 | INFO  | paxweb-config-2-thread-3 | JettyFactoryImpl                 | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | SPDY not available, creating standard ServerConnector for Https
2020-05-04T08:52:20,042 | INFO  | paxweb-config-2-thread-3 | JettyServerImpl                  | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | Pax Web available at [0.0.0.0]:[8443]
2020-05-04T08:52:20,055 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.webconsole.gogo [178]] to http service
2020-05-04T08:52:20,057 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.felix.inventory [154]] to http service
2020-05-04T08:52:20,058 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.webconsole.console [176]] to http service
2020-05-04T08:52:20,092 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:20,799 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer
2020-05-04T08:52:20,800 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:20,801 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer
2020-05-04T08:52:20,802 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.apache.jasper.servlet.JasperInitializer to ServletContainerInitializers
2020-05-04T08:52:20,802 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | Skipt org.apache.jasper.servlet.JasperInitializer, because specialized handler will be present
2020-05-04T08:52:20,817 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering context DefaultHttpContext [bundle=org.apache.karaf.webconsole.console [176], contextID=custom], with context-name:
2020-05-04T08:52:20,820 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering JasperInitializer
2020-05-04T08:52:20,873 | INFO  | paxweb-config-2-thread-3 | WebSocketServerFactory           | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | No DecoratedObjectFactory provided, using new org.eclipse.jetty.util.DecoratedObjectFactory[decorators=1]
2020-05-04T08:52:20,933 | INFO  | paxweb-config-2-thread-3 | session                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | DefaultSessionIdManager workerName=node0
2020-05-04T08:52:20,934 | INFO  | paxweb-config-2-thread-3 | session                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | No SessionScavenger set, using defaults
2020-05-04T08:52:20,935 | INFO  | paxweb-config-2-thread-3 | session                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | node0 Scavenging every 600000ms
2020-05-04T08:52:20,969 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.apache.karaf.webconsole.console [176], contextID=custom]}
2020-05-04T08:52:20,970 | INFO  | paxweb-config-2-thread-3 | Server                           | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | jetty-9.4.20.v20190813; built: 2019-08-13T21:28:18.144Z; git: 84700530e645e812b336747464d6fbbf370c9a20; jvm 11.0.7+10
2020-05-04T08:52:21,041 | INFO  | paxweb-config-2-thread-3 | AbstractConnector                | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started default@78aba5ca{HTTP/1.1,[http/1.1]}{0.0.0.0:8181}
2020-05-04T08:52:21,113 | INFO  | paxweb-config-2-thread-3 | SslContextFactory                | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | x509=X509@31adf640(casag,h=[],w=[]) for Server@b8fb8cf[provider=null,keyStore=file:///opt/apache-karaf-4.2.7/etc/casag.p12,trustStore=null]
2020-05-04T08:52:21,150 | INFO  | paxweb-config-2-thread-3 | AbstractConnector                | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started secureDefault@50fdffa1{SSL,[ssl, http/1.1]}{0.0.0.0:8443}
2020-05-04T08:52:21,151 | INFO  | paxweb-config-2-thread-3 | Server                           | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started @135585467ms
2020-05-04T08:52:21,154 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.ops4j.pax.web.pax-web-extender-whiteboard [255]] to http service
2020-05-04T08:52:21,157 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.http.core [168]] to http service
2020-05-04T08:52:21,163 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.webconsole.instance [180]] to http service
2020-05-04T08:52:21,164 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.webconsole.features [177]] to http service
2020-05-04T08:52:21,166 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [io.hawt.hawtio-war [63]] to http service
2020-05-04T08:52:21,183 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:21,189 | INFO  | activator-1-thread-6 | CommandExtension                 | 34 - org.apache.karaf.shell.core - 4.2.7 | Registering commands for bundle org.apache.karaf.http.core/4.2.7
2020-05-04T08:52:21,245 | INFO  | activator-1-thread-6 | HttpPlugin                       | 179 - org.apache.karaf.webconsole.http - 4.2.7 | Http plugin activated
2020-05-04T08:52:21,255 | INFO  | activator-1-thread-6 | ServletWebElement                | 255 - org.ops4j.pax.web.pax-web-extender-whiteboard - 7.2.11 | Ignoring servlet [459] without valid alias or url patterns property.
2020-05-04T08:52:21,256 | INFO  | activator-1-thread-6 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.karaf.webconsole.http [179]] to http service
2020-05-04T08:52:28,181 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer
2020-05-04T08:52:28,182 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:28,182 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer
2020-05-04T08:52:28,183 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.apache.jasper.servlet.JasperInitializer to ServletContainerInitializers
2020-05-04T08:52:28,183 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | Skipt org.apache.jasper.servlet.JasperInitializer, because specialized handler will be present
2020-05-04T08:52:28,184 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering context WebAppHttpContext{io.hawt.hawtio-war - 63}, with context-name: hawtio
2020-05-04T08:52:28,234 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering JasperInitializer
2020-05-04T08:52:28,235 | INFO  | paxweb-config-2-thread-3 | WebSocketServerFactory           | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | No DecoratedObjectFactory provided, using new org.eclipse.jetty.util.DecoratedObjectFactory[decorators=1]
2020-05-04T08:52:28,279 | INFO  | paxweb-config-2-thread-3 | HawtioContextListener            | 63 - io.hawt.hawtio-war - 2.9.1 | Initialising hawtio services
2020-05-04T08:52:28,281 | INFO  | paxweb-config-2-thread-3 | ConfigManager                    | 63 - io.hawt.hawtio-war - 2.9.1 | Configuration will be discovered via system properties
2020-05-04T08:52:28,281 | INFO  | paxweb-config-2-thread-3 | default                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Loading Blueprint contexts [bundle://63.0:2/OSGI-INF/blueprint/blueprint.xml]
2020-05-04T08:52:28,399 | INFO  | paxweb-config-2-thread-3 | AuthenticationConfiguration      | 63 - io.hawt.hawtio-war - 2.9.1 | Starting hawtio authentication filter, JAAS realm: "karaf" authorized role(s): "admin,manager,viewer" role principal classes: "org.apache.karaf.jaas.boot.principal.RolePrincipal,org.apache.karaf.jaas.modules.RolePrincipal,org.apache.karaf.jaas.boot.principal.GroupPrincipal"
2020-05-04T08:52:28,401 | INFO  | paxweb-config-2-thread-3 | ProxyWhitelist                   | 63 - io.hawt.hawtio-war - 2.9.1 | Probing local addresses ...
2020-05-04T08:52:28,402 | INFO  | paxweb-config-2-thread-3 | ProxyWhitelist                   | 63 - io.hawt.hawtio-war - 2.9.1 | Initial proxy whitelist: [localhost, 127.0.0.1, 172.20.0.4, dd6d194e18e1]
2020-05-04T08:52:28,403 | INFO  | paxweb-config-2-thread-3 | JolokiaConfiguredAgentServlet    | 63 - io.hawt.hawtio-war - 2.9.1 | Jolokia has not found any overriden configuration property passed at launch time; Default configuration values will be used.
2020-05-04T08:52:28,421 | INFO  | paxweb-config-2-thread-3 | RBACMBeanInvoker                 | 63 - io.hawt.hawtio-war - 2.9.1 | Using MBean [org.apache.karaf:type=security,area=jmx,name=root] for role based access control
2020-05-04T08:52:28,422 | INFO  | paxweb-config-2-thread-3 | default                          | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | jolokia-agent: Using restrictor io.hawt.system.RBACRestrictor
2020-05-04T08:52:28,473 | INFO  | paxweb-config-2-thread-3 | LoginServlet                     | 63 - io.hawt.hawtio-war - 2.9.1 | Hawtio login is using 1800 sec. HttpSession timeout
2020-05-04T08:52:28,474 | INFO  | paxweb-config-2-thread-3 | KeycloakServlet                  | 63 - io.hawt.hawtio-war - 2.9.1 | Keycloak integration is disabled
2020-05-04T08:52:28,477 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started HttpServiceContext{httpContext=WebAppHttpContext{io.hawt.hawtio-war - 63}}
2020-05-04T08:52:28,485 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.felix.webconsole.plugins.ds [156]] to http service
2020-05-04T08:52:28,486 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.felix.webconsole.plugins.memoryusage [158]] to http service
2020-05-04T08:52:28,487 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [isp.servletHttpComponent.xml [324]] to http service
2020-05-04T08:52:28,496 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:28,578 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer
2020-05-04T08:52:28,579 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer to ServletContainerInitializers
2020-05-04T08:52:28,579 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | added ServletContainerInitializer: org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer
2020-05-04T08:52:28,579 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | will add org.apache.jasper.servlet.JasperInitializer to ServletContainerInitializers
2020-05-04T08:52:28,580 | INFO  | paxweb-config-2-thread-3 | ServletContainerInitializerScanner | 251 - org.ops4j.pax.web.pax-web-api - 7.2.11 | Skipt org.apache.jasper.servlet.JasperInitializer, because specialized handler will be present
2020-05-04T08:52:28,580 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering context DefaultHttpContext [bundle=isp.servletHttpComponent.xml [324], contextID=default], with context-name:
2020-05-04T08:52:28,581 | INFO  | paxweb-config-2-thread-3 | HttpServiceContext               | 256 - org.ops4j.pax.web.pax-web-jetty - 7.2.11 | registering JasperInitializer
2020-05-04T08:52:28,665 | INFO  | paxweb-config-2-thread-3 | WebSocketServerFactory           | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | No DecoratedObjectFactory provided, using new org.eclipse.jetty.util.DecoratedObjectFactory[decorators=1]
2020-05-04T08:52:28,684 | INFO  | paxweb-config-2-thread-3 | CamelHttpTransportServlet        | 326 - org.apache.camel.camel-servlet - 3.0.0 | Initialized CamelHttpTransportServlet[name=CamelServlet, contextPath=]
2020-05-04T08:52:28,687 | INFO  | paxweb-config-2-thread-3 | ContextHandler                   | 223 - org.eclipse.jetty.util - 9.4.20.v20190813 | Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=isp.servletHttpComponent.xml [324], contextID=default]}
2020-05-04T08:52:28,699 | INFO  | paxweb-config-2-thread-3 | HttpServiceFactoryImpl           | 258 - org.ops4j.pax.web.pax-web-runtime - 7.2.11 | Binding bundle: [org.apache.felix.webconsole.plugins.event [157]] to http service
{code}
All Jetty service are up and running again.

When updating the 2nd Blueprint file this line
{code:java}
<from uri="jetty:https://0.0.0.0:8444/hello1?sslContextParameters=#sslContextParameters&amp;handlers=securityHandlerIsp" />
{code}
causes finally the error while trying to set the securityHandler on a running Jetty server. (I found this one forĀ [https://stackoverflow.com/questions/53293147/how-to-configure-security-handler-in-embedded-jetty-after-jetty-start]). Seems that the Jetty Server needs to be stopped before setting the securityContext on the Camel consumer endpoint.

Not sure if this should be part of the camel-jetty component but I'm assuming yes?

> Using a registered ConstraintSecurityHandler in another Blueprint file causes an java.lang.IllegalStateException: STARTED
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-15000
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15000
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jetty
>    Affects Versions: 3.0.1
>            Reporter: Gerald Kallas
>            Priority: Minor
>
> I've defined a Blueprint DSL file with a securityHandler configuration for multiple paths as following
> {code:java}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>    <bean id="constraint_TSTISP001" class="org.eclipse.jetty.util.security.Constraint">
>       <property name="name" value="BASIC" />
>       <property name="authenticate" value="true" />
>       <property name="roles">
>          <list>
>             <value>TSTISP001</value>
>          </list>
>       </property>
>    </bean>
>    <bean id="constraintMapping_TSTISP001" class="org.eclipse.jetty.security.ConstraintMapping">
>       <property name="constraint" ref="constraint_TSTISP001" />
>       <property name="pathSpec" value="/hello1" />
>    </bean>
>    <bean id="constraint_TSTISP002" class="org.eclipse.jetty.util.security.Constraint">
>       <property name="name" value="BASIC" />
>       <property name="authenticate" value="true" />
>       <property name="roles">
>          <list>
>             <value>TSTISP002</value>
>          </list>
>       </property>
>    </bean>
>    <bean id="constraintMapping_TSTISP002" class="org.eclipse.jetty.security.ConstraintMapping">
>       <property name="constraint" ref="constraint_TSTISP002" />
>       <property name="pathSpec" value="/hello2" />
>    </bean>
>    <bean id="securityHandlerImpl" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
>       <property name="loginService">
>          <bean class="org.eclipse.jetty.security.HashLoginService">
>             <property name="config" value="/opt/apache-karaf/etc/users.properties" />
>          </bean>
>       </property>
>       <property name="authenticator">
>          <bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />
>       </property>
>       <property name="constraintMappings">
>          <list>
>             <ref component-id="constraintMapping_TSTISP001" />
>             <ref component-id="constraintMapping_TSTISP002" />
>          </list>
>       </property>
>    </bean>
>    <service id="securityHandlerIsp" ref="securityHandlerImpl" interface="org.eclipse.jetty.server.Handler" />
>    <sslContextParameters id="sslContextParameters" xmlns="http://camel.apache.org/schema/blueprint">
>       ...
>    </sslContextParameters>
>    <service ref="sslContextParameters" auto-export="all-classes" />
> </blueprint>
> {code}
> The use in another Blueprint DSL file as attached
> {code:java}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>          xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
>          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>    <!-- set reference to the SSLContextParameters -->
>    <reference id="sslContextParameters" interface="org.apache.camel.support.jsse.SSLContextParameters" ext:proxy-method="classes" />
>    <!-- set reference to the securityHandler -->
>    <reference id="securityHandlerIsp" interface="org.eclipse.jetty.server.Handler" />
>    <camelContext id="isp.context.user.TSTISP001" xmlns="http://camel.apache.org/schema/blueprint" streamCache="true" useBreadcrumb="true">
>       <route id="isp.route.user.TSTISP001">
>          <from uri="jetty:https://0.0.0.0:8444/hello1?sslContextParameters=#sslContextParameters&amp;handlers=securityHandlerIsp" />
>          <setBody><constant>Hello 1</constant></setBody>
>       </route>
>    </camelContext>
> </blueprint>
> {code}
> causes an error
> {code:java}
> 2020-05-02T19:15:46,202 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 92 - org.apache.camel.camel-api - 3.0.0 | Error starting CamelContext (isp.context.user.TSTISP001) due to exception thrown: STARTED
> java.lang.IllegalStateException: STARTED
>         at org.eclipse.jetty.server.handler.AbstractHandlerContainer.setServer(AbstractHandlerContainer.java:131) ~[!/:9.4.20.v20190813]
>         at Proxyb4d61c20_c161_4396_a800_1fa982bbaaea.setServer(Unknown Source) ~[?:?]
>         at org.eclipse.jetty.server.handler.HandlerCollection.updateHandlers(HandlerCollection.java:117) ~[!/:9.4.20.v20190813]
>         at org.eclipse.jetty.server.handler.HandlerCollection.addHandler(HandlerCollection.java:180) ~[!/:9.4.20.v20190813]
>         at org.apache.camel.component.jetty.JettyHttpComponent.addJettyHandlers(JettyHttpComponent.java:1182) ~[!/:3.0.0]
>         at org.apache.camel.component.jetty.JettyHttpComponent.createServletForConnector(JettyHttpComponent.java:1145) ~[!/:3.0.0]
>         at org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:329) ~[!/:3.0.0]
>         at org.apache.camel.http.common.HttpCommonEndpoint.connect(HttpCommonEndpoint.java:177) ~[!/:3.0.0]
>         at org.apache.camel.http.common.HttpConsumer.doStart(HttpConsumer.java:58) ~[!/:3.0.0]
>         at org.apache.camel.component.jetty.JettyHttpConsumer.doStart(JettyHttpConsumer.java:31) ~[!/:3.0.0]
>         at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.startService(AbstractCamelContext.java:2900) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doStartOrResumeRouteConsumers(AbstractCamelContext.java:3227) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doStartRouteConsumers(AbstractCamelContext.java:3161) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.safelyStartRouteServices(AbstractCamelContext.java:3071) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doStartOrResumeRoutes(AbstractCamelContext.java:2836) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2640) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.lambda$doStart$2(AbstractCamelContext.java:2445) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2462) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2443) ~[!/:3.0.0]
>         at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117) ~[!/:3.0.0]
>         at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2352) [!/:3.0.0]
>         at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:244) [!/:3.0.0]
>         at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:286) [!/:3.0.0]
>         at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:183) [!/:3.0.0]
>         at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190) [!/:1.10.2]
>         at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188) [!/:1.10.2]
>         at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
>         at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
>         at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
>         at java.lang.Thread.run(Unknown Source) [?:?]
> {code}
> An approach with the definition of the securityHandler and the route in one single Blueprint DSL file is working.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)