Bug 50683 - Servlet 3.0 annotations not scanned if unpackWars="false"
Summary: Servlet 3.0 annotations not scanned if unpackWars="false"
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.6
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2011-01-28 18:36 UTC by kristof batizy
Modified: 2011-01-28 19:16 UTC (History)
0 users

minimal test case war with source (2.74 KB, application/octet-stream)
2011-01-28 18:36 UTC, kristof batizy

Note You need to log in before you can comment on or make changes to this bug.
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.