0

Hi all i am developing a web app and deploy that in tomcat 7.0 and when i try to run the same thing in tomcat 5. i get the following exception while deploying itself.

Tomcat version 5.5 only supports J2EE 1.2, 1.3, and 1.4 Web modules

i think these cost the problem but not sure

import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;

@WebServlet(urlPatterns = "/ReadEmployeeAttendance")
@MultipartConfig

how to solve this?

mprabhat
  • 20,107
  • 7
  • 46
  • 63
Joe
  • 4,460
  • 19
  • 60
  • 106
  • 1
    You have to use Tomcat 7.0 if you want to use Servlet 3.0. No other option. But why do you want to use such an old Version? Tomcat 5.5 will be de-supported soon: http://tomcat.apache.org/tomcat-55-eol.html –  May 18 '12 at 10:20
  • Thanks for the reply, ,we have an application which already running on tomcat 5.5, I am adding some new features, once such is uploading a file, for that i found all the examples available are done in annotations only, if you know something which is useful to upload a file which will run on tomcat 5.5 , It will be of great helpful. – Joe May 18 '12 at 10:31
  • Apparently you have working code for Tomcat 7.0. Why insist on using an outdated version then?. Upgrade from 5.5 to 7.0 and you are done. As you already tested your code with 7.0 you don't even risk any problems. –  May 18 '12 at 10:34

2 Answers2

2

You can't do this. You need container with support for Servlet 3.0 spec, and if you want Tomcat that is only Tomcat 7. If you want your app to run in Tomcat 5.5, you cannot use Servlet 3.0 features (e.g. annotations, also your web.xml must have version="2.4" or earlier).

Peter Štibraný
  • 32,463
  • 16
  • 90
  • 116
1

Yes you are correct that Tomcat 5.5 doesn't support Java EE 5 and above, you will have to upgrade to latest tomcat if you want servlet 3.

Every web server or application server implements specification provided by JCP, hence not all version of your server can run every version of specification, though on a general note they are backward compatible, meaning on Tomcat 7 you can run J2EE 1.4 but on tomcat 5.5 you cannot run Java EE5.

mprabhat
  • 20,107
  • 7
  • 46
  • 63
  • my problem is updating a file into server, for that i used these annotations, if there is any other way to upload a file without annotations, please share the link. – Joe May 18 '12 at 10:28
  • If you can use earlier versions of servlet then see this [post](http://stackoverflow.com/questions/2422468/how-to-upload-files-in-jsp-servlet) for file upload using jsp servlet – mprabhat May 18 '12 at 10:33
  • thanks mprabhat, hope this will help me, i will check and revert back, accepting your answer. – Joe May 18 '12 at 10:42