Following sutuation, if i add my default handler it gets picked up until the alias of an other context takes over. Then the default handler of Jetty takes over again e.g. https://somehost/nonexistingcontext returns my default handler and https://somehost/api/rest/existingcontext/nonexistingcontext returns the Jetty default handler (https://somehost/api/rest/existingcontext hits my app). Where does this default handler come from? My bundle fragment Jetty XML:
<?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> <!-- ========================================================== --> <!-- Set connectors --> <!-- ========================================================== --> <!-- One of each type! --> <!-- ========================================================== --> <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> <Set name="secureScheme">https</Set> <Set name="securePort"> <Property name="jetty.secure.port" default="8443"/> </Set> <Set name="securePort"> <Property name="jetty.secure.port" default="8444"/> </Set> <Set name="outputBufferSize">32768</Set> <Set name="requestHeaderSize">8192</Set> <Set name="responseHeaderSize">8192</Set> <Set name="sendServerVersion">true</Set> <Set name="sendDateHeader">false</Set> <Set name="headerCacheSize">512</Set> </New> <!-- ========================================================== --> <!-- Configure Authentication Realms --> <!-- Realms may be configured for the entire server here, or --> <!-- they can be configured for a specific web app in a context --> <!-- configuration (see $(jetty.home)/contexts/test.xml for an --> <!-- example). --> <!-- ========================================================== --> <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.jaas.JAASLoginService"> <Set name="name">karaf</Set> <Set name="loginModuleName">karaf</Set> <Set name="roleClassNames"> <Array type="java.lang.String"> <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal </Item> </Array> </Set> </New> </Arg> </Call> <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.jaas.JAASLoginService"> <Set name="name">default</Set> <Set name="loginModuleName">karaf</Set> <Set name="roleClassNames"> <Array type="java.lang.String"> <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal </Item> </Array> </Set> </New> </Arg> </Call> <!--<Call name="addBean">--> <!--<Arg>--> <!--<New class="eu.abeel.platform.http.paxweb.ErrorHandler"/>--> <!--</Arg>--> <!--</Call>--> <Get name="handler"> <Call name="addHandler"> <Arg> <New class="eu.abeel.platform.http.paxweb.DefaultHandler"> <Arg> <Ref refid="Server"/> </Arg> </New> </Arg> </Call> </Get> <New id="lansslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> <Arg> <Ref refid="httpConfig"/> </Arg> <Call name="addCustomizer"> <Arg> <New class="org.eclipse.jetty.server.SecureRequestCustomizer"/> </Arg> </Call> </New> <New id="wansslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> <Arg> <Ref refid="httpConfig"/> </Arg> <Call name="addCustomizer"> <Arg> <New class="org.eclipse.jetty.server.SecureRequestCustomizer"/> </Arg> </Call> </New> <New id="lansslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory"> <Set name="KeyStorePath"> <SystemProperty name="karaf.home"/>/etc/somekeystore.jks </Set> <Set name="KeyStorePassword">xxx</Set> <Set name="KeyManagerPassword">xxx</Set> <Set name="EndpointIdentificationAlgorithm"></Set> <Set name="NeedClientAuth"> <Property name="jetty.ssl.needClientAuth" default="false"/> </Set> <Set name="WantClientAuth"> <Property name="jetty.ssl.wantClientAuth" default="false"/> </Set> <!-- Disable SSLv3 to protect against POODLE bug --> <Set name="ExcludeProtocols"> <Array type="java.lang.String"> <Item>SSLv3</Item> </Array> </Set> </New> <New id="wansslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory"> <Set name="KeyStorePath"> <SystemProperty name="karaf.home"/>/etc/secondkeystore.jks </Set> <Set name="KeyStorePassword">xxx</Set> <Set name="KeyManagerPassword">xxx</Set> <Set name="EndpointIdentificationAlgorithm"></Set> <Set name="NeedClientAuth"> <Property name="jetty.ssl.needClientAuth" default="false"/> </Set> <Set name="WantClientAuth"> <Property name="jetty.ssl.wantClientAuth" default="false"/> </Set> <!-- Disable SSLv3 to protect against POODLE bug --> <Set name="ExcludeProtocols"> <Array type="java.lang.String"> <Item>SSLv3</Item> </Array> </Set> <Set name="ExcludeCipherSuites"> <Array type="String"> <Item>SSL_RSA_WITH_DES_CBC_SHA</Item> <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item> <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item> <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item> <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item> <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item> <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item> </Array> </Set> </New> <Call id="lanhttpsConnector" name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.ServerConnector"> <Arg name="server"> <Ref refid="Server"/> </Arg> <Arg name="acceptors" type="int"> <Property name="ssl.acceptors" default="-1"/> </Arg> <Arg name="selectors" type="int"> <Property name="ssl.selectors" default="-1"/> </Arg> <Arg name="factories"> <Array type="org.eclipse.jetty.server.ConnectionFactory"> <Item> <New class="org.eclipse.jetty.server.SslConnectionFactory"> <Arg name="next">http/1.1</Arg> <Arg name="sslContextFactory"> <Ref refid="lansslContextFactory"/> </Arg> </New> </Item> <Item> <New class="org.eclipse.jetty.server.HttpConnectionFactory"> <Arg name="config"> <Ref refid="lansslHttpConfig"/> </Arg> </New> </Item> </Array> </Arg> <Set name="name">127.0.0.1:8443</Set> <Set name="host"> <Property name="jetty.host" default="127.0.0.1"/> </Set> <Set name="port"> <Property name="https.port" default="8443"/> </Set> <Set name="idleTimeout"> <Property name="https.timeout" default="30000"/> </Set> <Set name="soLingerTime"> <Property name="https.soLingerTime" default="-1"/> </Set> <Set name="acceptorPriorityDelta"> <Property name="ssl.acceptorPriorityDelta" default="0"/> </Set> <Set name="selectorPriorityDelta"> <Property name="ssl.selectorPriorityDelta" default="0"/> </Set> <Set name="acceptQueueSize"> <Property name="https.acceptQueueSize" default="0"/> </Set> </New> </Arg> </Call> <Call id="wanhttpsConnector" name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.ServerConnector"> <Arg name="server"> <Ref refid="Server"/> </Arg> <Arg name="acceptors" type="int"> <Property name="ssl.acceptors" default="-1"/> </Arg> <Arg name="selectors" type="int"> <Property name="ssl.selectors" default="-1"/> </Arg> <Arg name="factories"> <Array type="org.eclipse.jetty.server.ConnectionFactory"> <Item> <New class="org.eclipse.jetty.server.SslConnectionFactory"> <Arg name="next">http/1.1</Arg> <Arg name="sslContextFactory"> <Ref refid="wansslContextFactory"/> </Arg> </New> </Item> <Item> <New class="org.eclipse.jetty.server.HttpConnectionFactory"> <Arg name="config"> <Ref refid="wansslHttpConfig"/> </Arg> </New> </Item> </Array> </Arg> <Set name="name">127.0.0.1:8444</Set> <Set name="host"> <Property name="jetty.host" default="127.0.0.1"/> </Set> <Set name="port"> <Property name="https.port" default="8444"/> </Set> <Set name="idleTimeout"> <Property name="https.timeout" default="30000"/> </Set> <Set name="soLingerTime"> <Property name="https.soLingerTime" default="-1"/> </Set> <Set name="acceptorPriorityDelta"> <Property name="ssl.acceptorPriorityDelta" default="0"/> </Set> <Set name="selectorPriorityDelta"> <Property name="ssl.selectorPriorityDelta" default="0"/> </Set> <Set name="acceptQueueSize"> <Property name="https.acceptQueueSize" default="0"/> </Set> </New> </Arg> </Call> </Configure> If i replace the handler collection i break pax web and cannot register further handlers: <Set name="handler"> <New class="org.eclipse.jetty.server.handler.HandlerCollection"> <Set name="handlers"> <Array type="org.eclipse.jetty.server.Handler"> <Item> <New class="eu.abeel.platform.http.paxweb.DefaultHandler" /> </Item> </Array> </Set> </New> </Set> -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
