Bug 50683

Summary: Servlet 3.0 annotations not scanned if unpackWars="false"
Product: Tomcat 7 Reporter: kristof batizy <kristof>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 7.0.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: minimal test case war with source

Description kristof batizy 2011-01-28 18:36:29 UTC
Created attachment 26572 [details]
minimal test case war with source


Given a very simple HelloServlet using @WebServlet annotation, and packed in a war file without a web.xml, the container does not scan for annotations if unpackWars="false" in the <Host> element of server.xml and the servlet is never added to the context.

Steps to Reproduce: 

    1) Set unpackWars="fase"

    2) copy attached war file to webapps

    3) launch Tomcat

    4) navigate to:  http://<servername>/Hello/SayHello

Actual Results: 

  HTTP Status 404 - /Hello/SayHello

  type Status report

  message /Hello/SayHello

  description The requested resource (/Hello/SayHello) is not available.
  Apache Tomcat/7.0.6

Expected Results: 

Comment 1 kristof batizy 2011-01-28 18:37:39 UTC
sorry, typo in step 1, above:

    1) Set unpackWars="false"
Comment 2 Mark Thomas 2011-01-28 19:16:05 UTC
Thanks for the report and the test case.

The issue has been fixed in 7.0.x and will be included in 7.0.7 onwards.