What else do you have in your WEB-INF/lib directory?
You wouldn't have a jsp-api or servlet-api there would you?
Any libraries that declare the base servlet classes included in the WEB-INF directory can seriously mess with your running application.
Those classes are always meant to be provided by the server.
This sort of error occurs when someone puts a newer/upgraded API in their WEB-INF/lib that doesn't match with the rest of the server.
Bear Bibeault
Author and opinionated walrus
Marshal
Stefan Evans wrote:Any libraries that declare the base servlet classes included in the WEB-INF directory can seriously mess with your running application.
Quoted for emphasis.
This can cause no end of weird and hard-to-debug problems.
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
posted
0
Bear Bibeault wrote:This has nothing to do with the JSTL. The EL is built right into JSP.
You are using a JSP 2.1 container?
Yes, I now have jsp-api-2.1.jar file in the lib directory of my application. But still I am facing the same problem.
Thanks for your reply. Please let me know if I am missing something.
Regards,
Brij
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
posted
0
Stefan Evans wrote:What else do you have in your WEB-INF/lib directory?
You wouldn't have a jsp-api or servlet-api there would you?
Any libraries that declare the base servlet classes included in the WEB-INF directory can seriously mess with your running application.
Those classes are always meant to be provided by the server.
This sort of error occurs when someone puts a newer/upgraded API in their WEB-INF/lib that doesn't match with the rest of the server.
Thanks for replying Evans.
I am having servlet-api.jar and jsp-api-2.1.jar files in the lib directory of my application.
Regards,
Brij
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 879
posted
1
Just to make it abundantly clear. Delete those files from your WEB-INF/lib directory.
They do not belong there.
Deleting these files should resolve your problem.
Bear Bibeault
Author and opinionated walrus
Marshal
Because they are automatically provided by the container (Tomcat, resin, Weblogic, etc).
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
posted
0
Hi,
If I remove servlet-api.jar from the lib directory of my appliation, then my controller class is not getting compiled.
Error which I am getting is
I think, this implies that container is not providing this jar file.
Can you please put some light to it.
Regards,
Brij
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 879
posted
0
Where is this message from?
Are you compiling on the command line?
In an IDE? Which?
Running a JSP page to get this error?
If you take a look in your server's lib directory you will see jsp-api and servlet-api there.
These are the libraries you need to include in your classpath when you compile your web application.
If doing it from the command line, you need to add those libraries into your classpath.
If doing it in an IDE, you can
- add the jar file from the server's lib directory to your project dependencies (not your WEB-INF/lib folder)
- most IDEs allows specifying of the server, and automatically import the required libraries.
Bear Bibeault
Author and opinionated walrus
Marshal
The container has nothing at all to do with compiling. I've moved this to the IDEs forum as it's clear this is an IDE setup issue and not a true JSP question.