Monday, June 20, 2011

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config

Problem :

When I open a jsp page in the browser, I have the following error :

20:16:32,243 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/getting-spring].[integration]] "Servlet.service()" pour la servlet integration a généré une exception: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config from BaseClassLoader@74c252{vfs:///opt/jboss/jboss-6.0.0.Final/server/dr_jbossweb-standalone/deploy/getting-spring.war}
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]


I looked in my pom.xml and I have correct Maven dependencies:



    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <scope>provided</scope>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <scope>provided</scope>
      <version>1.1.2</version>
    </dependency>



So it's Ok.Moreover I checked in my war and there are these dependencies but there is always the error.


Solution


I add jstl-1.1.2.jar in the directory lib (in JBoss 6 for example you can add in  jbossweb-standalone/lib)


Note : You can find this jar on Maven repositories : here

1 comment:

  1. You could also remove the provided scope since the jar is not provided :)


    provided

    ReplyDelete