15

I am developing an application for FB Login with website using Javascript and JSF. I have posted my code at here. The problem is, when I run my application it does't show the JSF page, it instead throws the following exception:

Nov 28, 2013 7:21:46 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/FacebookLogin] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
    at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344)
    at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    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:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    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)

What is the problem here and how can I solve it?

Community
  • 1
  • 1
Wanna Coffee
  • 2,742
  • 7
  • 40
  • 66

2 Answers2

36

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

As the package name hints, the mentioned class is part of JSTL. The exception is clearly telling that the class definition file of the mentioned class cannot be found in the runtime classpath. I.e. the Config.class file or at least the JAR file containing that class is missing in webapp's runtime classpath.

JSTL is normally already provided out the box by a full fledged Java EE container such as TomEE, JBoss AS/EAP/WildFly, Payara/GlassFish, WebLogic, etc but not by barebones JSP/Servlet containers such as Tomcat and Jetty. For them, you'd need to supply JSTL along with the web application yourself, exactly like as you'd do for JSF (which is also already provided out the box by full fledged Java EE containers).

You're facing this exception because Facelets has for its <c:xxx> tags a dependency on the JSTL implementation JAR file, while you're using Tomcat which doesn't ship with JSTL out the box. JSTL is as a separate library available in flavor of jstl-1.2.jar. Just download and drop it in your webapp's /WEB-INF/lib folder, along with the JSF JAR file(s) which you already placed there, and this exception should disappear. Maven users can achieve that by adding the below dependency (and performing a full rebuild/redeploy):

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

Alternatively, just replace Tomcat by a real Java EE container.

See also:

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Yeah, The exception problem has been solved. But, still the FB_icon does't display in my webpage.!! It displaying table with button perfectly. what could be the problem here? How can i get? I have posted my code in previous question, just follow the link which i providing in my question. For your reference, i pasted here also. please have a look. "http://stackoverflow.com/questions/20263746/warning-this-page-calls-for-xml-namespace-http-www-facebook-com-2008-fbml-dec" – Wanna Coffee Nov 28 '13 at 14:37
  • 1
    You're welcome. Just press "Ask Question" button on the right top in order to ask a new question and be able to get an answer to that. This new problem is completely unrelated to the current problem. Just ask about one problem at a time. You'll eventually get there. It's unhelpful for you, me and future users facing the same problem to mingle completely different problems in a single question. You loses overview and it would make answers so much harder to find, like as you probably already experienced when you wade through a topic of an old fashioned discussion forum in a quest for answers. – BalusC Nov 28 '13 at 14:41
  • The jstl-1.2.jar download link is broken. – Shotgun Ninja Nov 07 '15 at 19:07
  • 2
    @Shotgun: Fixed, thanks. You could also have found it in the page behind the first JSTL link in my answer. – BalusC Nov 07 '15 at 22:08
2

I just want to add my contribute if someone gets this error trying to create a springframework-4.0.7-RELEASE module for jboss-eap-6.4.0.GA. My module.xml now contains:

<dependencies>
    ...
    <!-- Contains javax.servlet.jsp.jstl.core.Config -->
    <module name="javax.servlet.jstl.api"/>
    ...
</dependencies>
vault
  • 3,930
  • 1
  • 35
  • 46
  • A misconfigured Wildfly module system was the culprit for me too - not specific to Spring, just any module you add to Wildfly better have it's dependencies correct! – Ryan Oct 25 '21 at 15:21