Hi all,

I am working on a small application. I am using struts 1.1, tomcat 4.1.8, 
mysql. I have made added foll in my server.xml file in tomcat-home/conf 
directory
<Resource name="jdbc/intranet" auth="Container" 
type="javax.sql.DataSource"/>

                    <ResourceParams name="jdbc/intranet">
                        <parameter>
                              <name>factory</name>
                              
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                            </parameter>

                        <parameter>
                            <name>maxActive</name>
                            <value>100</value>
                        </parameter>
                        <parameter>
                            <name>maxIdle</name>
                            <value>30000</value>
                        </parameter>
                        <parameter>
                            <name>maxWait</name>
                            <value>100</value>
                        </parameter>
                        <parameter>
                            <name>username</name>
                            <value>kiran</value>
                        </parameter>
                        <parameter>
                            <name>password</name>
                            <value>kiran</value>
                        </parameter>

                        <parameter>
                            <name>driverClassName</name>
                            <value>org.gjt.mm.mysql.Driver</value>
                        </parameter>

                        <parameter>
                            <name>url</name>
                            
<value>jdbc:mysql://localhost/intranet?autoReconnect=true</value>
                        </parameter>
                    </ResourceParams>
                </Context>

Added this bit in web.xml of my application in WEB_INF directory
<resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/intranet</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

In my program I have this bit:

        Context ctx= new InitialContext();
        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/intranet");
        if(ds!=null){
                   con = ds.getConnection();
            }

I get this exception when I start up tomcat. I am missing anything ??????
I am using jdbc driver for mysql & this is in tomcat-home\common\lib.

Please correct me if i am wrong or missing anything. Please..........
Thanks in advance.

java.sql.SQLException: Cannot load JDBC driver class 'null'
        at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
        at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
        at 
com.intranet.IntranetStartup.connectionToDataBase(IntranetStartup.java:78)
        at com.intranet.IntranetStartup.execute(IntranetStartup.java:36)
        at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)

        at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
        at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
        at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2350)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
        at java.lang.Thread.run(Thread.java:536)


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.netbean.net/mailman/listinfo/mvc-programmers

Reply via email to