Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalAccessError in JstlCoreTLV

 
pinky suresh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can sometimes be caused if you copy the servlet or JSP API jars into WEB-INF/lib. Have you done so?
 
pinky suresh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pinky suresh wrote:Should these jar files be removed?

Yes.
 
pinky suresh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the servlet and jsp api jars as already advised.
 
pinky suresh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic