File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes IllegalAccessError in JstlCoreTLV Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "IllegalAccessError in JstlCoreTLV" Watch "IllegalAccessError in JstlCoreTLV" New topic
Author

IllegalAccessError in JstlCoreTLV

pinky suresh
Greenhorn

Joined: Jul 21, 2008
Posts: 22
Hi,
I am trying to use c:forEach tag in a JSP to simply iterate through a list and display the items in jsp page but I am getting the following error

java.lang.IllegalAccessError
org.apache.taglibs.standard.tlv.JstlCoreTLV.getHandler(Unknown Source)
org.apache.taglibs.standard.tlv.JstlBaseTLV.validate(Unknown Source)
org.apache.taglibs.standard.tlv.JstlCoreTLV.validate(Unknown Source)
org.apache.jasper.compiler.TagLibraryInfoImpl.validate(TagLibraryInfoImpl.java:759)
org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1522)
org.apache.jasper.compiler.Validator.validate(Validator.java:1490)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Jstl.jar and standard.jar files are included in lib. Is the compiler not able to find these jar files??Can you please let me know why am I getting this problem.
Please reply...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

This can sometimes be caused if you copy the servlet or JSP API jars into WEB-INF/lib. Have you done so?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pinky suresh
Greenhorn

Joined: Jul 21, 2008
Posts: 22
I have jsp-api.jar and servlet-api.jar file copied into WEB_INF/lib..
Are you referring to these jars only?
Should these jar files be removed?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
They ought already to be included in the Java EE application server where you're going to run the webapplication on. So yes, you need to remove it and never ever copy them into other places.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

pinky suresh wrote:Should these jar files be removed?

Yes.
pinky suresh
Greenhorn

Joined: Jul 21, 2008
Posts: 22
Hey,
Thanks a lot for replying...

I removed those jars,but still getting the same error.Now what could be the reason for getting the same error?

jar files will be added in Tomcat's lib right...so there is no need to explicitly add these jars in WEB-INF/lib.Am I right?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

That is correct. What else is in your WEB-INF/lib? It should only contain the jars that are specific to your web application and should not repeat any jars that are already supplied by the container.
pinky suresh
Greenhorn

Joined: Jul 21, 2008
Posts: 22
I have the following jar files in WEB-INF/lib

ant,commons-logging,common-el,jsp-api,log4j,servlet-api,jasper-compiler.jar files and a few other jasper jar files.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

Remove the servlet and jsp api jars as already advised.
pinky suresh
Greenhorn

Joined: Jul 21, 2008
Posts: 22
Hi,

I tried removing servlet-api,jsp-api.jar files.

On removing them,i am getting NoClassDefFoundError for HttpServletRequest and JSPFactory.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalAccessError in JstlCoreTLV