java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config [duplicate]
Asked Answered
A

8

53

When I am run my application after entering the URL, this exception is coming.I am using Eclipse and Tomcat7.0.35. I also added Jstl.jar and jstl1.2.jar

My code is

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:91)
    at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:78)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Alevin answered 27/2, 2013 at 13:44 Comment(4)
Can you provide the list of the libraries in you classpath? seems you are missing the jstl.jar in your classpathFalsecard
I added jsf-myfaces,jstl,primefaces libraries in both classpath and buildpathAlevin
@Sagar You need to ensure that the jars are in the WEB-INF/lib directory. See my answer.Cunaxa
find the bug-- For some reason jstl jars are removing every time from my eclipse deployment pathAlevin
U
59

Download the following jars and add it to your WEB-INF/lib directory:

Unworldly answered 27/2, 2013 at 14:0 Comment(3)
In my case, I only needed to add jstl-1.2.jar.Wilton
Added and worked for me.Forgotten
It works!! You can find the jar here: mvnrepository.com/artifact/javax.servlet/jstl/1.2Meetinghouse
C
74

The error is telling you it cannot find the class because it is not available in your application.

If you are using Maven, make sure you have the dependency for jstl artifact:

<dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
</dependency>

If you are not using it, just make sure you include the JAR in your classpath. See this answer for download links.

Caveat answered 27/2, 2013 at 13:50 Comment(3)
@RaulGogo-I am not using MavenAlevin
The last paragraph is for the case in which you don't have Maven. See the answer in the link provided.Caveat
For anyone else who might have the same issue I did, my mistake was using javax.servlet.jsp.jstl as the groupId instead of javax.servletDaisy
U
59

Download the following jars and add it to your WEB-INF/lib directory:

Unworldly answered 27/2, 2013 at 14:0 Comment(3)
In my case, I only needed to add jstl-1.2.jar.Wilton
Added and worked for me.Forgotten
It works!! You can find the jar here: mvnrepository.com/artifact/javax.servlet/jstl/1.2Meetinghouse
H
9

By default, Tomcat container doesn’t contain any jstl library. To fix it, declares jstl.jar in your Maven pom.xml file if you are working in Maven project or add it to your application's classpath

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
  </dependency>
Helve answered 27/2, 2013 at 13:49 Comment(0)
C
3

Probably the jstl libraries are missing from your classpath/not accessible by tomcat.

You need to add at least the following jar files in your WEB-INF/lib directory:

  • jsf-impl.jar
  • jsf-api.jar
  • jstl.jar
Cunaxa answered 27/2, 2013 at 13:47 Comment(2)
... and do not fiddle with project's Build Path setting. Untouch it and undo if necessary any changes you made there. Just dropping the JAR in /WEB-INF/lib is sufficient. See also stackoverflow.com/tags/jstl/info Note that JSTL 1.2 is only one JAR file, not two. So if you have jstl.jar and jstl-1.2.jar, you should remove the first one.Icelandic
@Icelandic Good point. Thanks BalusC.Cunaxa
S
3

Add jstl jar to your application classpath.

Selina answered 27/2, 2013 at 13:47 Comment(0)
S
1

Just a quick comment: sometimes Maven does not copy the jstl-.jar to the WEB-INF folder even if the pom.xml has the entry for it.

I had to manually copy the JSTL jar to /WEB-INF/lib on the file system. That resolved the problem. The issue may be related to Maven war packaging plugin.

Substandard answered 17/2, 2014 at 19:56 Comment(0)
K
1

Add JSTL library as dependency to your project (javax.servlet.jsp.jstl.core.Config is a part of this package). For example, if you were using Gradle, you could write in a build.gradle:

dependencies {
    compile 'javax.servlet:jstl:1.2'
}
Kipkipling answered 11/3, 2015 at 12:43 Comment(0)
B
1

I had the same problem. Go to Project Properties -> Deployment Assemplbly and add jstl jar

Brownlee answered 13/4, 2015 at 23:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.