0 Replies Latest reply on Oct 7, 2010 10:04 AM by Kissan Das

    Getting error when connecting to database using struts...

    Kissan Das Newbie

      Hi all,

       

      I want to connect my database (oracle 10g) from my application which is in eclipse IDE using struts frame work .I am using Tomcat 5.5 server.

      while connecting to database through Data source (in struts-config.xml file) i am getting this error.

       

       

      This is my data source connection..

       

       

      <data-sources>
           <data-source  type="org.apache.commons.dbcp.BasicDataSource" >

            <set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
            <set-property property="url" value="jdbc:oracle:thin:@localhost:1521:mydb"/>
            <set-property property="username" value="sms"/>
            <set-property property="password" value="sms"/>
            </data-source>
          </data-sources>

       

      HTTP Status 500 -

       

      ------------------------------

      --------------------------------------------------

       

      type  Exception report

       

      message

      description The server encountered an internal error () that  prevented it from fulfilling this request.

       

      exception

       

      javax.servlet.ServletException:  Servlet.init() for servlet action threw exception
           org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
           org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
           org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
           org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
           org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
           org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
           org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
           java.lang.Thread.run(Unknown Source)

       


      root cause

       

      java.lang.NoClassDefFoundError:  org/apache/commons/pool/ObjectPool
          java.lang.Class.getDeclaredConstructors0(Native  Method)
          java.lang.Class.privateGetDeclaredConstructors(Unknown  Source)
           java.lang.Class.getConstructor0(Unknown Source)
           java.lang.Class.newInstance0(Unknown Source)
           java.lang.Class.newInstance(Unknown Source)
           org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
           org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1081)
           org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
           javax.servlet.GenericServlet.init(GenericServlet.java:212)
           org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
           org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
           org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
           org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
           org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
           org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
           org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
           java.lang.Thread.run(Unknown Source)

       


      root cause

       

      java.lang.ClassNotFoundException:  org.apache.commons.pool.ObjectPool
           org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
           org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
           java.lang.ClassLoader.loadClassInternal(Unknown Source)
           java.lang.Class.getDeclaredConstructors0(Native Method)
           java.lang.Class.privateGetDeclaredConstructors(Unknown  Source)
          java.lang.Class.getConstructor0(Unknown Source)
           java.lang.Class.newInstance0(Unknown Source)
           java.lang.Class.newInstance(Unknown Source)
           org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
           org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1081)
           org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
           javax.servlet.GenericServlet.init(GenericServlet.java:212)
           org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
           org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
           org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
           org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
           org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
           org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
           org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
           java.lang.Thread.run(Unknown Source)

       


      note The full stack  trace of the root cause is available in the Apache Tomcat/5.5.28 logs.

       


      --------------------------------------------------------------------------------

      Apache Tomcat/5.5.28

       

      Please help me ...

       

      Regards

      Kissan Das.