File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem with Servlet Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with Servlet Annotation" Watch "Problem with Servlet Annotation" New topic

Problem with Servlet Annotation

Christopher Henry

Joined: Sep 22, 2011
Posts: 2
I am having a problem with Servlet Annotations

Server Setup:
Ubuntu 12.04
Apache Tomcat 7.0.5
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09)

I have 15 users that can deploy web applications to the server. However, I do not give them access to /usr/local/apache-tomcat-7.0.5/webapps/ Instead, I have created folders userXX inside the webaps directory. Users only have write access to one folder. Thus, they cannot alter the contents of the other directories. In order to deploy their web application, they copy their war file to their userXX directory, extract the files, and remove the war file.

Using web.xml, everything is fine. However, I cannot get a web application to work using @WebServlet from within these directories (i.e. I receive a 404). There is no problem if I copy the same war file to /usr/local/apache-tomcat-7.0.5/webapps/ (as the administrator) and let the server create a directory and extract the contents.

Is there a way to use Servlet Annotations with my setup? Do I need to update Tomcat and the VM?

Many thanks
I agree. Here's the link:
subject: Problem with Servlet Annotation
It's not a secret anymore!