When I login in facebook using code as shown in Facesbook API Example in a servlet then get the following exception:
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
com.google.code.facebookapi.FacebookXmlRestClientBase.<clinit>(FacebookXmlRestClientBase.java:26)
FaceBookCrawl.FacebookUserFilter.doFilter(FacebookUserFilter.java:85)
FaceBookCrawl.FacebookUserFilter.doPost(FacebookUserFilter.java:161)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
How can I solve this?
This means that the particular class is missing in the runtime classpath.
To fix this, you just need to put the particular class (or actually, the JAR file with the particular class) in the runtime classpath. As the package name already hints, you can download the JAR file at http://commons.apache.org/logging. Put the JAR file in webapp’s
/WEB-INF/libfolder, it’s part of the webapp’s runtime classpath.