0
votes

I get the following error:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory

I have added the relevant jars commons-dbcp-1.4.jar and commons-pool-1.4.jar but the error isn't resolved.

Stacktrace:

Stack trace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:579) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:461) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838) org.apache.jsp.ozLogin_jsp._jspService(ozLogin_jsp.java:470) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause

java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory org.apache.jsp.ozLogin_jsp._jspService(ozLogin_jsp.java:189) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause

java.lang.ClassNotFoundException: org.apache.commons.dbcp.ConnectionFactory org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1335) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1163) org.apache.jsp.ozLogin_jsp._jspService(ozLogin_jsp.java:189) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

1
Can you provide more information about your project? I assume it is a web project, are you using maven?Tiago Mussi
Yes it is web project and yes I am using mavenn2g
Can you provide your pom.xml?Tiago Mussi
what exactly you need from pom.xmln2g
How it is declared those depencies... commons-dbcp-1.4 and commons-pool-1.4.Tiago Mussi

1 Answers

0
votes

Adding the jars to the Tomcat lib folder fixed the error for me