0

I'm learning JSF and trying to create simple login page. But when I deploy my application i get:

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
    com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:345)
    com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

In my pom.xml I have

<dependencies>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.7</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.el</groupId>
        <artifactId>el-api</artifactId>
        <version>2.2</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

I also tried to add jars to WEB-INF/lib but it didn't work (and also i don't like this approach due to poor design). Any ideas?

DB5
  • 13,553
  • 7
  • 66
  • 71
StackNRG
  • 79
  • 1
  • 1
  • 6

1 Answers1

0

Try removing the line <scope>provided</scope> for jstl dependency. "provided" scope means the library will be available from the container, so Maven will not package it.

Amila
  • 5,195
  • 1
  • 27
  • 46
  • Tried, but got java.lang.StackOverflowError com.sun.faces.application.ViewHandlerResponseWrapper.setStatus(ViewHandlerResponseWrapper.java:88) javax.servlet.http.HttpServletResponseWrapper.setStatus(HttpServletResponseWrapper.java:201) – StackNRG Jan 04 '14 at 11:58