File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts+Weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts+Weblogic" Watch "Struts+Weblogic" New topic


vikas mishra

Joined: Jan 28, 2004
Posts: 26
I am new to struts , i trying to connect with oracle useing datasource
and i m getting follwoing error.

Error 503--Service Unavailable

javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
at org.apache.struts.action.ActionServlet.initModuleDataSources(Lorg.apache.struts.config.ModuleConfig V(
at org.apache.struts.action.ActionServlet.init()V(
at javax.servlet.GenericServlet.init(Ljavax.servlet.ServletConfig V(
at weblogic.servlet.internal.ServletStubImpl$;(
at; Ljava.lang.Object;(
at;; Ljava.lang.Object;(
at weblogic.servlet.internal.ServletStubImpl.createServlet()Ljavax.servlet.Servlet;(
at weblogic.servlet.internal.ServletStubImpl.createInstances()V(
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(Lweblogic.servlet.internal.RequestCallback V(
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(Ljava.lang.String V(
at weblogic.servlet.internal.WebAppServletContext.preloadServlets()V(
at weblogic.servlet.internal.WebAppServletContext.preloadResources()V(
at weblogic.servlet.internal.WebAppServletContext.setStarted(Z)V(
at weblogic.servlet.internal.WebAppModule.start()V(
at weblogic.j2ee.J2EEApplicationContainer.start([Lweblogic.j2ee.J2EEApplicationContainer$Component V(
at weblogic.j2ee.J2EEApplicationContainer.activate([ V(
at;;ZLjava.lang.StringBuffer Z(
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(Lweblogic.kernel.ExecuteThread V(
at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest V(
at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread V(Unknown Source)

my datasource declaration is ...


<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<set-property property="url" value="jdbc racle:thin:@" />
<set-property property="username" value="sys" />
<set-property property="password" value="sys" />
<set-property property="maxActive" value="10" />
<set-property property="maxWait" value="5000" />
<set-property property="defaultAutoCommit" value="false" />
<set-property property="defaultReadOnly" value="false" />
<set-property property="validationQuery" value="SELECT COUNT(*) FROM testtable" />

candy tang

Joined: May 16, 2005
Posts: 2
Hi,maybe your struts-config.xml is wrong, looe mine:

<data-source key="oracleDB1">
<set-property property="driverClass"
value="oracle.jdbc.driver.OracleDriver" />
<set-property property="url"
value="jdbc racle:thin:@" />
<set-property property="maxCount"
<set-property property="minCount"
<set-property property="user"
<set-property property="password"
<set-property property="autoCommit"

Beyond me if you can!
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

hi even i am using the weblogic with struts 1.2.4 but i had created a data source conn pool in web logic console .
Do u think if u create a data source rather than thin driver ,do we hava any advantage???.
if yes let me know....
Only i will configuring everthing in console rather than config xml file...
-Gowtham G R
[ May 19, 2005: Message edited by: Gowtham Ganamukala ]

Thanks, Ganesh Gowtham
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Take a look at Struts - How to Access a Database, it doesn't look like they recommend using theirs. You should be able to create connection pool and datasource in weblogic and get the datasource using JNDI lookup and get connection from datasource.

NOTE: It is preferred that data connectivity be handled directly by the business classes, usually via JNDI. The Struts DataSource manager should only be used with legacy business classes that don't provide their own connectivity. When possible, we strongly recommend use of the standard DAO pattern, so that the Action classes do not need to know anything about the persitence mechanism. The DataSource manager is being retained in Struts 1.x for backward compatibility but may not be retained in Struts 2.x or later.
I agree. Here's the link:
subject: Struts+Weblogic
It's not a secret anymore!