*
The moose likes IDEs, Version Control and other tools and the fly likes java.lang.NoClassDefFoundError: javax/el/ValueExpression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "java.lang.NoClassDefFoundError: javax/el/ValueExpression" Watch "java.lang.NoClassDefFoundError: javax/el/ValueExpression" New topic
Author

java.lang.NoClassDefFoundError: javax/el/ValueExpression

Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
I am working on spring 3 application.

JSP code in one of my jsp is given below

code in include.jsp is given below


When above given code is getting invoked, I am getting below given error


I have jstl-1.2.jar in the lib directory of my appliction.

need suggestion to resolve this error
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

This has nothing to do with the JSTL. The EL is built right into JSP.

You are using a JSP 2.1 container?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
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 ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

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
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
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: 1016
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 ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Stefan Evans wrote: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.


Quoting again for emphasis. REMOVE those jar files form the WEB-INF/lib and never ever ever put them there. Ever!
mohana krishna
Greenhorn

Joined: Apr 12, 2005
Posts: 8
May i know the reason why these jar files should not be keep inside WEB-INF/lib folder.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Because they are automatically provided by the container (Tomcat, resin, Weblogic, etc).
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
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: 1016
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 ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: javax/el/ValueExpression
 
Similar Threads
Error regarding the JSTL tag application.
Getting Problem in display tag with struts
can property be given as * in jsp:getProperty
using the display:table tag
pagination exception in spring