ok thanks, I was not very clear about the role of each file.
I've configured the context.xml file in the maven jetty plugin and it works
now.

Thanks


2013/8/15 Jesse McConnell <[email protected]>

> I want to chime in that it _is_ supported and works in all cases where
> ServletContextInitializers are not in play...that is the aspect of the
> servlet-api that may force the scanning.
>
> as for your issue, you have one jetty.xml file that handles the https
> bits, and the other which configures WebAppContext is actually a
> context.xml file so your development setup simply needs to have that
> processed, if it is a distribution then it is put in the directory
> alongside the war file in jetty 9 or in the contexts directory in Jetty 8
>
> cheers,
> jesse
>
> --
> jesse mcconnell
> [email protected]
>
>
> On Thu, Aug 15, 2013 at 12:08 PM, Hugo Lassiège <[email protected]>wrote:
>
>> Because this attribute is not supported in Jetty
>>
>> (I've posted on the bugtracker of jetty last year and this workaround was
>> proposed by them)
>>
>>
>> 2013/8/15 Joakim Erdfelt <[email protected]>
>>
>>> If you are using Servlet 3.0, why not just set your web.xml's
>>> metadata-complete="true" instead?
>>> That should disable annotation scanning as well.
>>>
>>>
>>>
>>> --
>>> Joakim Erdfelt <[email protected]>
>>> webtide.com <http://www.webtide.com/> - intalio.com/jetty
>>> Expert advice, services and support from from the Jetty & CometD experts
>>> eclipse.org/jetty - cometd.org
>>>
>>>
>>> On Thu, Aug 15, 2013 at 9:55 AM, Hugo Lassiège <[email protected]>wrote:
>>>
>>>> Hi,
>>>>
>>>> I currently have two jetty.xml file, one for prod, one for dev.
>>>>
>>>> The jetty.xml file for prod is quite simple. It configure a
>>>> WebAppContext like this :
>>>>
>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "
>>>> http://www.eclipse.org/jetty/configure.dtd";>
>>>>
>>>> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
>>>> <Set name="contextPath">/</Set>
>>>> <Set name="war"><SystemProperty name="jetty.home"
>>>> default="."/>/workable-web/target/workable.war</Set>
>>>>     <Call name="setAttribute">
>>>>
>>>> <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
>>>>         <Arg>.*/.*langur[^/]*\.jar$</Arg>
>>>>     </Call>
>>>> </Configure>
>>>>
>>>> This configuration allows to avoid scanning the whole classpath for JEE
>>>> annotations.
>>>>
>>>> In dev, I have a basic configuration file to enable https but I am
>>>> unable to backport the previous configuration. So I scan the whole
>>>> classpath and startup is very time consuming.
>>>>
>>>> The dev file :
>>>>
>>>> <?xml version="1.0"?>
>>>> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "
>>>> http://www.eclipse.org/jetty/configure_9_0.dtd";>
>>>>
>>>> <Configure id="jetty" class="org.eclipse.jetty.server.Server">
>>>>     <New id="httpsConfig"
>>>> class="org.eclipse.jetty.server.HttpConfiguration">
>>>>         <Set name="secureScheme">https</Set>
>>>>         <Set name="securePort">8443</Set>
>>>>         <Set name="outputBufferSize">32768</Set>
>>>>         <Call name="addCustomizer">
>>>>             <Arg><New
>>>> class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
>>>>         </Call>
>>>>     </New>
>>>>
>>>>     <New id="httpConfig"
>>>> class="org.eclipse.jetty.server.HttpConfiguration">
>>>>         <Set name="secureScheme">https</Set>
>>>>         <Set name="securePort">8443</Set>
>>>>         <Set name="outputBufferSize">32768</Set>
>>>>         <!-- Uncomment to enable handling of X-Forwarded- style
>>>> headers-->
>>>>           <Call name="addCustomizer">
>>>>             <Arg><New
>>>> class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
>>>>           </Call>
>>>>
>>>>     </New>
>>>>
>>>>     <New id="sslContextFactory"
>>>> class="org.eclipse.jetty.util.ssl.SslContextFactory">
>>>>         <Set name="KeyStorePath">./workable-web/ssl/keystore</Set>
>>>>         <Set name="KeyStorePassword">hopwork1234</Set>
>>>>         <Set name="KeyManagerPassword">hopwork1234</Set>
>>>>     </New>
>>>>
>>>>     <New id="sslConnector"
>>>> class="org.eclipse.jetty.server.ServerConnector">
>>>>         <Arg name="server"><Ref refid="jetty" /></Arg>
>>>>         <Arg name="factories">
>>>>             <Array type="org.eclipse.jetty.server.ConnectionFactory">
>>>>                 <Item><New
>>>> class="org.eclipse.jetty.server.SslConnectionFactory">
>>>>                     <Arg name="sslContextFactory"><Ref
>>>> refid="sslContextFactory" /></Arg>
>>>>                     <Arg name="next">http/1.1</Arg>
>>>>                 </New></Item>
>>>>                 <Item>
>>>>                     <New
>>>> class="org.eclipse.jetty.server.HttpConnectionFactory">
>>>>                         <Arg name="config"><Ref refid="httpsConfig"
>>>> /></Arg>
>>>>                     </New>
>>>>                 </Item>
>>>>             </Array>
>>>>         </Arg>
>>>>         <Set name="port">8443</Set>
>>>>         <Set name="idleTimeout">30000</Set>
>>>>     </New>
>>>>
>>>>     <Call name="addConnector">
>>>>         <Arg><Ref refid="sslConnector" /></Arg>
>>>>     </Call>
>>>>
>>>>     <Call name="addConnector">
>>>>         <Arg>
>>>>             <New class="org.eclipse.jetty.server.ServerConnector">
>>>>                 <Arg name="server"><Ref refid="jetty" /></Arg>
>>>>                 <Arg name="factories">
>>>>                     <Array
>>>> type="org.eclipse.jetty.server.ConnectionFactory">
>>>>                         <Item>
>>>>                             <New
>>>> class="org.eclipse.jetty.server.HttpConnectionFactory">
>>>>                                 <Arg name="config"><Ref
>>>> refid="httpConfig" /></Arg>
>>>>                             </New>
>>>>                         </Item>
>>>>                     </Array>
>>>>                 </Arg>
>>>>                 <Set name="port"><Property name="jetty.port"
>>>> default="8088" /></Set>
>>>>                 <Set name="idleTimeout"><Property name="http.timeout"
>>>> default="30000"/></Set>
>>>>             </New>
>>>>         </Arg>
>>>>     </Call>
>>>>
>>>> </Configure>
>>>>
>>>>
>>>> I don't understand in the documentation how to combine the
>>>> configuration of a webapp context and the configuration of a server
>>>>
>>>> Any idea ?
>>>>
>>>> _______________________________________________
>>>> jetty-users mailing list
>>>> [email protected]
>>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> jetty-users mailing list
>>> [email protected]
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>
>>>
>>
>> _______________________________________________
>> jetty-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to