aspose file tools*
The moose likes Tomcat and the fly likes Servlet with annotations on tomcat 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet with annotations on tomcat 7" Watch "Servlet with annotations on tomcat 7" New topic
Author

Servlet with annotations on tomcat 7

Rob Symth
Ranch Hand

Joined: Apr 29, 2011
Posts: 32
Hey Folks,
I am at my wits end here trying to deploy a servlet with annotations.
I have managed to successfully deploy it without annotations i.e via the web.xml & everything is fine but I get a status 404 when trying to deploy with annotations.
I am running tomcat

Server version: Apache Tomcat/7.0.12
Server built: Apr 1 2011 06:13:02
Server number: 7.0.12.0
OS Name: Linux
OS Version: 2.6.35-28-generic
Architecture: i386
JVM Version: 1.6.0_20-b02
JVM Vendor: Sun Microsystems Inc.


I followed the spec so I am sure I am doing everything right from a coding point of view, there is no mention of this servlet what so ever in the apps web.xml



This file is located in the following directory
~/tomcat/apache-tomcat-7.0.12/webapps/onjava/WEB-INF/classes/moreservlets


The application onjava is mapped in the server.xml


This application has both annotated servlets which don't work & regular servlets with web.xml which do work, can I mix both for onjava above?


Any help greatly appreciated
Thanks
Rob


Rob Symth
Ranch Hand

Joined: Apr 29, 2011
Posts: 32
Anybody got any ideas or suggestions to try out?
Rob Symth
Ranch Hand

Joined: Apr 29, 2011
Posts: 32
Hey Folks,
I resolved the issue, the issue was an incorrect Servlet version specified in the XML, I changed it to below for version 3.0 & everything worked fine



Regards
/Rob
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet with annotations on tomcat 7