Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2007, 02:43 AM
Registered User
 
Join Date: Feb 2007
Location: New Delhi, Delhi, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting MS Access using Struts

Hi all!
I have congifured my struts-config.xml as following:

<data-sources>
<data-source key="A" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="sun.jdbc.odbc.JdbcOdbcDriver" />
<set-property property="url" value="jdbc:odbc:sample" />
<set-property property="username" value="trace" />
<set-property property="password" value="trace" />
<set-property property="initialSize" value="10" />
<set-property property="defaultAutoCommit" value="false" />
</data-source>
</data-sources>
<form-beans >

But while deploying the war file I get following exceptions.......................

org.apache.commons.dbcp.SQLNestedException: Error preloading the connection pool
at org.apache.commons.dbcp.BasicDataSource.createData Source(BasicDataSource.java:868)
at org.apache.commons.dbcp.BasicDataSource.setLogWrit er(BasicDataSource.java:598)
at org.apache.struts.action.ActionServlet.initModuleD ataSources(ActionServlet.java:1087)
at org.apache.struts.action.ActionServlet.init(Action Servlet.java:472)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:258)
at weblogic.servlet.internal.ServletStubImpl$ServletI nitAction.run(ServletStubImpl.java:1070)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:97)
at weblogic.servlet.internal.ServletStubImpl.createSe rvlet(ServletStubImpl.java:893)
at weblogic.servlet.internal.ServletStubImpl.createIn stances(ServletStubImpl.java:842)
at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:782)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppServletContext.java:3191)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3148)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3134)
at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:3109)
at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServletContext.java:5559)
at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:853)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2012)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2053)
at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.activateContainer(SlaveDeployer .java:2558)
at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(SlaveDeployer.java:2483)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeployer.java:2308)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(SlaveDeployer.java:2390)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDeployer.java:2302)
at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(SlaveDeployer.java:2455)
at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(SlaveDeployer.java:829)
at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDeployer.java:538)
at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDeployer.java:496)
at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:151)
Caused by: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)'; file already in use.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7036)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.j ava:3028)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOd bcConnection.java:323)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDrive r.java:174)
at org.apache.commons.dbcp.DriverConnectionFactory.cr eateConnection(DriverConnectionFactory.java:37)
at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:290)
at org.apache.commons.pool.impl.GenericObjectPool.add Object(GenericObjectPool.java:1059)
at org.apache.commons.dbcp.BasicDataSource.createData Source(BasicDataSource.java:865)
... 30 more
<Feb 18, 2007 12:40:09 AM IST> <Error> <HTTP> <BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "paper".
javax.servlet.UnavailableException: Initializing application data source A
at org.apache.struts.action.ActionServlet.initModuleD ataSources(ActionServlet.java:1091)
at org.apache.struts.action.ActionServlet.init(Action Servlet.java:472)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:258)
at weblogic.servlet.internal.ServletStubImpl$ServletI nitAction.run(ServletStubImpl.java:1070)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:97)
at weblogic.servlet.internal.ServletStubImpl.createSe rvlet(ServletStubImpl.java:893)
at weblogic.servlet.internal.ServletStubImpl.createIn stances(ServletStubImpl.java:842)
at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:782)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppServletContext.java:3191)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3148)
at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebAppServletContext.java:3134)
at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:3109)
at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServletContext.java:5559)
at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:853)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2012)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2053)
at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.activateContainer(SlaveDeployer .java:2558)
at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(SlaveDeployer.java:2483)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeployer.java:2308)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(SlaveDeployer.java:2390)
at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDeployer.java:2302)
at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(SlaveDeployer.java:2455)
at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(SlaveDeployer.java:829)
at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDeployer.java:538)
at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDeployer.java:496)
at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:151)
>

I have also checked that there is no other war file deployed in the weblogic 8.1 server using the same dsn but problem remains the same. The IDE I am using is Myeclipse. Please help..................
Sincerely
Roopesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access connecting to Oracle Problem Corey Oracle 2 March 21st, 2007 02:52 AM
MS Access - Connecting to dartcoach VB.NET 2002/2003 Basics 2 February 27th, 2007 12:05 PM
connecting PHP to MS Access pb7 Beginning PHP 5 September 24th, 2004 05:04 PM
connecting PHP to an MS Access database pb7 PHP Databases 1 September 18th, 2003 04:28 PM
Problem: JSP connecting to MS Access amcp2002 JSP Basics 3 August 12th, 2003 12:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.