Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Struts db connection issue

Thread view: 
girishmanwani@gmail.com - 23 Jan 2006 16:04 GMT
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 - 23 Jan 2006 21:01 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.