I use data-source defintion below and no problem with it <data-source type="org.apache.commons.dbcp.BasicDataSource"> <set-property property="driverClassName" value="org.gjt.mm.mysql.Driver"/> <set-property property="url" value="jdbc:mysql://localhost/telkomsel"/> <set-property property="maxCount" value="5"/> <set-property property="minCount" value="1"/> <set-property property="username" value="root"/> <set-property property="password" value="blahblah"/> </data-source>
----- Original Message ----- From: "Pacheco, Brent" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Saturday, November 15, 2003 12:31 AM Subject: MySql BasicDataSource Connection > Howdy! > > I'm using Struts 1.1 in WebSphere and I'm attempting to replace the > GenericDataSource connection pool in my struts-config.xml file with a > BasicDataSource connection pool to hit a mySQL database, but I keep getting > an error. The data-source defintion in my struts-config.xml file is as > follows: > > <data-sources> > <data-source type="org.apache.commons.dbcp.BasicDataSource"> > <set-property property="autoCommit" value="false"/> > <set-property property="key" value="1" /> > <set-property property="description" value="1" /> > <set-property property="driverClass" > value="org.gjt.mm.mysql.Driver" /> > <set-property property="maxWait" value="10" /> > <set-property property="maxCount" value="10" /> > <set-property property="minCount" value="2" /> > <set-property property="url" > value="jdbc:mysql://localhost:3306/NOL" /> > <set-property property="user" value="******" /> > <set-property property="password" value="******" /> > </data-source> > </data-sources> > > I have placed the commons-dbcp.jar and commons-pool.jar in my classpath, as > well as the native mySql driver. There's no problem when using the > GenericDataSource, but as soon as I change to the BasicDataSource, I get the > following error when starting up the server: > > [11/14/03 11:30:04:702 CST] 66ad7043 ActionServlet E > org.apache.struts.action.ActionServlet TRAS0014I: The following exception > was logged org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC > driver of class '' for connect URL 'jdbc:mysql://localhost:3306/NOL', cause: > > java.sql.SQLException: No suitable driver > at java.sql.DriverManager.getDriver(DriverManager.java:266) > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav > a:743) > at > org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:57 > 6) > at > org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j > ava:1087) > at > org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn > stance.java:82) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle > Servlet.java:147) > at > com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy > cleServlet.java:270) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS > ervlet.java:113) > at > com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 > 5) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet > Manager.java:761) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle > tManager.java:257) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web > AppServletManager.java:453) > at > com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) > at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) > at > com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) > at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) > at > com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950 > ) > at > com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java: > 133) > at > com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:36 > 0) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:401) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart > (DeployedApplicationImpl.java:743) > at > com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav > a:337) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati > onImpl.java:531) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application > MgrImpl.java:254) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:232) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerIm > pl.java:117) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182) > at com.ibm.ws.runtime.WsServer.start(WsServer.java:135) > at com.ibm.ws.runtime.WsServer.main(WsServer.java:232) > at java.lang.reflect.Method.invoke(Native Method) > at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94) > at > com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV > 5.java:97) > . > org.apache.commons.dbcp.SQLNestedException: > Cannot create JDBC driver of class '' for connect URL > 'jdbc:mysql://localhost:3306/NOL', cause: > java.sql.SQLException: No suitable driver > at java.sql.DriverManager.getDriver(DriverManager.java:266) > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav > a:743) > at > org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:57 > 6) > at > org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j > ava:1087) > at > org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn > stance.java:82) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle > Servlet.java:147) > at > com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy > cleServlet.java:270) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS > ervlet.java:113) > at > com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 > 5) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet > Manager.java:761) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle > tManager.java:257) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web > AppServletManager.java:453) > at > com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) > at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) > at > com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) > at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) > at > com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950 > ) > at > com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java: > 133) > at > com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:36 > 0) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:401) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart > (DeployedApplicationImpl.java:743) > at > com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav > a:337) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati > onImpl.java:531) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application > MgrImpl.java:254) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:232) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerIm > pl.java:117) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182) > at com.ibm.ws.runtime.WsServer.start(WsServer.java:135) > at com.ibm.ws.runtime.WsServer.main(WsServer.java:232) > at java.lang.reflect.Method.invoke(Native Method) > at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94) > at > com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV > 5.java:97) > > [11/14/03 11:30:04:903 CST] 66ad7043 ServletInstan E SRVE0100E: Did not > realize init() exception thrown by servlet action: > javax.servlet.UnavailableException: Initializing application data source > org.apache.struts.action.DATA_SOURCE > at > org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j > ava:1091) > at > org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn > stance.java:82) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle > Servlet.java:147) > at > com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy > cleServlet.java:270) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS > ervlet.java:113) > at > com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 > 5) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet > Manager.java:761) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle > tManager.java:257) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web > AppServletManager.java:453) > at > com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) > at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) > at > com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) > at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) > at > com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950 > ) > at > com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java: > 133) > at > com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:36 > 0) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:401) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart > (DeployedApplicationImpl.java:743) > at > com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav > a:337) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati > onImpl.java:531) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application > MgrImpl.java:254) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:232) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerIm > pl.java:117) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182) > at com.ibm.ws.runtime.WsServer.start(WsServer.java:135) > at com.ibm.ws.runtime.WsServer.main(WsServer.java:232) > at java.lang.reflect.Method.invoke(Native Method) > at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94) > at > com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV > 5.java:97) > > [11/14/03 11:30:04:963 CST] 66ad7043 WebGroup E SRVE0020E: [Servlet > Error]-[action]: Failed to load servlet: javax.servlet.UnavailableException: > Initializing application data source org.apache.struts.action.DATA_SOURCE > at > org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j > ava:1091) > at > org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn > stance.java:82) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle > Servlet.java:147) > at > com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy > cleServlet.java:270) > at > com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS > ervlet.java:113) > at > com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 > 5) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet > Manager.java:761) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle > tManager.java:257) > at > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web > AppServletManager.java:453) > at > com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) > at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) > at > com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) > at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) > at > com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950 > ) > at > com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java: > 133) > at > com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:36 > 0) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:401) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart > (DeployedApplicationImpl.java:743) > at > com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav > a:337) > at > com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati > onImpl.java:531) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application > MgrImpl.java:254) > at > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav > a:232) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerIm > pl.java:117) > at > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.jav > a:343) > at > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) > at > com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182) > at com.ibm.ws.runtime.WsServer.start(WsServer.java:135) > at com.ibm.ws.runtime.WsServer.main(WsServer.java:232) > at java.lang.reflect.Method.invoke(Native Method) > at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94) > at > com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV > 5.java:97) > > Is there something I am missing? Has anyone else had this experience? > > Thanks in advance, > > Brent > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]