• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am new to JSF. I am reading the Core JavaServer Faces 2nd edition book. I was trying the tutorial example from chapter 8 (book-viewer-tiles) project. When I tried to run the application I get the below mentioned exception. Would anyone please help me to resolve this. I am using
Apache Tomcat 6.0.18
JDK 1.6.0.11
JSF 1.2
eclipse 3.4

The files in lib folder under tomcat
annotations-api.jar
catalina.jar
catalina-ant.jar
catalina-ha.jar
catalina-tribes.jar
el-api.jar
jasper.jar
jasper-el.jar
jasper-jdt.jar
jsp-api.jar
jstl-1.2.jar
server-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

Thanks for the help
Suraj
 
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your missing one of the following file ( not all together )

commons-logging.jar, commons-logging-api.jar or log4-1.2.11.jar

Try getting it from here Apache commons logging home



Daniel.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the classname already hints, it's commons-logging. Get it from http://commons.apache.org/logging
 
Suraj Shekar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response. I added the following jar files
commons-logging-1.1.1
commons-logging-adapters-1.1.1
commons-logging-api-1.1.1

Now I see the following exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Can't get definitions factory from context.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


Thanks for the help
Suraj
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have crossposted this question at the Sun forum.
Please read this: http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
 
Suraj Shekar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bauke,
Sorry about the cross posting. As I was not able to get my error resolved, I thought I might get some more feedback from a different(sun) java forum.

Suraj
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I got the same exception, from the same book code,


Hi I am new to JSF. I am reading the Core JavaServer Faces 2nd edition book. I was trying the tutorial example from chapter 8 (book-viewer-tiles) project. When I tried to run the application I get the below mentioned exception. Would anyone please help me to resolve this. I am using
Apache Tomcat 6.0.18




Can anyone help us please
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently this comes from Tiles, based on what I see in Google. Tiles and I never did get along. These days I use Facelets to do my tiling.

From what I could deduce, there may be a problem in your tiles definition file, possible malformed XML. One reporter said the problem went away when he changed "Fun & games" to "Fun Games", and that one would certainly be bad XML - you need to code it as "Fun & Games" using the XML entity escape.

I would really have expected to see more stack trace info, though.
 
Ashraf Abu-Aisheh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The stack trace is:


and the tiles.xml is:

and the book.jsp is:

and the headerMenuContentLayout.jsp is:
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not exactly going out of their way to help you, are they?

Take a look at your tiles:insert tags. As near as I can tell, one of them's trying to insert a resource that it can't find.
reply
    Bookmark Topic Watch Topic
  • New Topic