Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 8.0.0.M1
-
Fix Version/s: 8.0.0.M2
-
Component/s: None
-
Labels:None
-
Environment:OS: Windows XP SP3
JDK: Sun JDK 1.6.0_18
-
Number of attachments :
Description
ServletContainerInitializer cannot work in jetty 8.0M1.
In my test case, I use ServletContainerInitializer to find an load all the Servlet class and register one servlet:AddedServletOnStartup with its url-pattern: /add. But the container doesn't recognize it.
#
comment
Hi Wang, For the normal jetty eclipse release, you need to enable the jetty-plus features to get this to work. However, I've just checked the etc/jetty-plus.xml file and its a bit out of date for that release. I'll fix it in trunk, but you need to edit your etc/jetty.xml file and add the following: <Call name="setAttribute"> <Arg>org.eclipse.jetty.webapp.configuration</Arg> <Arg> <Array type="java.lang.String"> <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item> <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item> <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item> <Item>org.eclipse.jetty.plus.webapp.Configuration</Item> <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item> <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item> <Item>org.eclipse.jetty.annotations.ContainerInitializerConfiguration</Item> </Array> </Arg> </Call>
Then also ensure you have the plus and annotations OPTION enabled on the start line. Alternatively, download jetty-hightide where this is enabled by default.
cheers Jan