Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Struts db connection issue

1 view
Skip to first unread message

girish...@gmail.com

unread,
Jan 23, 2006, 11:04:44 AM1/23/06
to
Hi ,
I am trying to connect to Sybase from Struts by configuring the
struts-config.
But when i try to load application page that connects to database I get
the following error

[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.java: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(StrictServletInstance.java:82)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
at
com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
at
com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
at
com.ibm.ws.webcontainer.webapp.WebAppServletManager.getServletReference(WebAppServletManager.java:455)
at
com.ibm.ws.webcontainer.webapp.WebApp.getServletReference(WebApp.java:652)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.calculateInfo(WebAppRequestDispatcherInfo.java:172)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.<init>(WebAppRequestDispatcherInfo.java:59)
at
com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1462)
at
com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1421)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:268)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)


My struts-confic looks like this

<data-sources>

<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName"
value="com.sybase.jdbc.SybDriver"/>
<set-property property="url"
value="jdbc:sybase:Tds:databaseservername:port/databasename"/>
<set-property property="username" value="uname"/>
<set-property property="password" value="pword"/>
</data-source>

</data-sources>

What do you guys think could be the problem.
Pl. help.

Larry

unread,
Jan 23, 2006, 4:01:00 PM1/23/06
to
Sounds like one or more of your data-source attributes may be
incorrect. Try writing a short test class to test your DB connection
using DriverManager.getConnection. At the very least, you'll probably
get moire meaningful error messages that would help you troubleshoot
the problem.

0 new messages