Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts+Weblogic  RSS feed

vikas mishra
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
Carol Enderlin
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!