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)
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Ssv
  • 1,059
  • 4
  • 14
  • 25
  • Can you provide the list of the libraries in you classpath? seems you are missing the `jstl.jar` in your classpath – araknoid Feb 27 '13 at 13:47
  • I added jsf-myfaces,jstl,primefaces libraries in both classpath and buildpath – Ssv Feb 27 '13 at 13:52
  • @Sagar You need to ensure that the jars are in the `WEB-INF/lib` directory. See my answer. – dan Feb 27 '13 at 13:53
  • 1
    find the bug-- For some reason jstl jars are removing every time from my eclipse deployment path – Ssv Feb 27 '13 at 14:04

8 Answers8

73

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.

Community
  • 1
  • 1
Raul Rene
  • 10,014
  • 9
  • 53
  • 75
58

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

Thierry
  • 5,270
  • 33
  • 39
Sudhakar
  • 4,823
  • 2
  • 35
  • 42
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>
1218985
  • 7,531
  • 2
  • 25
  • 31
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
dan
  • 13,132
  • 3
  • 38
  • 49
  • 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 http://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. – BalusC Feb 27 '13 at 14:11
  • @BalusC Good point. Thanks BalusC. – dan Feb 27 '13 at 14:13
3

Add jstl jar to your application classpath.

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.

George
  • 1,077
  • 1
  • 7
  • 2
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'
}
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
1

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