Hello,
i tried your suggestion but i continue getting the same error.

javax.servlet.UnavailableException: Initializing application data source
org.apache.struts.action.DATA_SOURCE
 at
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j
ava:1091)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)

we are porting a legacy application to struts and i am using now the same
connection URL.

    <data-source>
        <set-property property="driverClassName"
value="oracle.jdbc.driver.OracleDriver" />
        <set-property property="url" value="jdbc:oracle:oci8:@ora9i" />
        <set-property property="username" value="******" />
        <set-property property="password" value="*****" />
        <set-property property="autoCommit" value="true" />
        <set-property property="maxCount" value="4" />
        <set-property property="minCount" value="2" />
        <set-property property="validationQuery" value="SELECT 1+1 from
dual" />
    </data-source>

any futher suggestions o clues? pls help this is urgent.
regards
rajat


----- Original Message -----
From: "McCormack, Chris" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 4:58 PM
Subject: RE: db error


It doesnt appear to be a case of missing classes etc

This exception seems pretty descriptive :
UnavailableException: Initializing application data source
org.apache.struts.action.DATA_SOURCE

It looks like struts cannot physically get a connection to the specified
source, so
a. it doesnt exist
b. it does exist but your application cannot get to the source (routing
issue?)
c. there is a typo in the connection details.
d. the connection details are setup incorrectly.

there are other factors etc but I would say this is an initial check list.

                <data-source key="dev.sitea" >
                        <set-property property="autoCommit"     value="true"
/>
                        <set-property property="description"    value="JDBC
data source"/>
                        <set-property property="driverClass"
value="oracle.jdbc.driver.OracleDriver"/>
                        <set-property property="maxCount"       value="50"/>
                        <set-property property="minCount"       value="2"/>
                        <set-property property="password"       value="**"/>
                        <set-property property="user"           value="**"/>
                        <set-property property="url"
value="jdbc:oracle:thin:@box:1521:db"/>
                </data-source>

A minor difference I have noticed is the use of the '@' symbol to reference
your box in the url parameter.
I have included one that I know works for one of my systems oracle
connection.

Chris McCormack

-----Original Message-----
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: 25 March 2004 11:11
To: Struts Users Mailing List
Subject: Re: db error


Thanks chris,
so this is not because of any missing classes or jar files? is this a
connectivity issue? the database server isup and my other applications
sqlplusw can access it.
any pointers?
sorry about read reciept thing in my previous mail.
rajat
----- Original Message -----
From: "McCormack, Chris" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 25, 2004 4:46 PM
Subject: RE: db error


Check your database is up before trying to connect to it. If it is and you
can ping the database from your application server box, then check your
spelling in the data source definition.

Chris McCormack

-----Original Message-----
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: 25 March 2004 11:01
To: Struts Users Mailing List
Subject: db error


Hello All,
i am trying to connect a oracle database, and i get this stack trace, can
someone please tell me what is wrong with it.
<!-- stack trace -->
javax.servlet.UnavailableException: Initializing application data source
org.apache.struts.action.DATA_SOURCE
 at
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j
ava:1091)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
4)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3420)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
 at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:257)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
 at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:569
)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:166)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


<!-- end of stack trace -->


<--- data sources -->

<data-sources>

    <!-- <data-source type="org.apache.commons.dbcp.BasicDataSource"> -->
    <data-source>
        <set-property property="driverClassName"
value="oracle.jdbc.driver.OracleDriver" />
        <set-property property="url"
value="jdbc:oracle:thin:oci8:1521:ora9i" />
        <set-property property="username" value="*******" />
        <set-property property="password" value="*******" />
        <set-property property="autoCommit" value="true" />
        <set-property property="maxCount" value="4" />
        <set-property property="minCount" value="2" />
        <set-property property="validationQuery" value="SELECT 1+1 from
dual" />
    </data-source>

</data-sources>


<-- code -->
        ServletContext context = servlet.getServletContext();
        DataSource ds = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);
        //DataSource ds = getDataSource(req);

        try {
            conn = ds.getConnection();
            stmt = conn.createStatement();
            rs = stmt.executeQuery("Select tname, tabtype from tab");

            if (!rs.wasNull()) {
                /**
                 * some records where returned
                 */
                System.err.println("==================");
                while (rs.next()) {
                    System.err.println("Table Name: " + rs.getString(1));
                    System.err.println("TabType: " + rs.getString(2));
                    System.err.println("--");
                }
                System.err.println("==================");
            }


        } catch (SQLException e) {
            System.err.println("==> Error in getting the connection: " +
e.getMessage());



<---end of code -->






--
Rajat Pandit  | [EMAIL PROTECTED]
System Analyst

Manchitra Services Pvt. Ltd (www.manchitra.com)
Tel: 011-26232696 / 26232798
Cellphone: 9818247126
B231 / C GK I
New Delhi


***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please
notify the sender immediately and delete this
e-mail from your system.
You must take no action based on this, nor must
you copy or disclose it or any part of its contents
to any person or organisation.
Statements and opinions contained in this email may
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.
************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please
notify the sender immediately and delete this
e-mail from your system.
You must take no action based on this, nor must
you copy or disclose it or any part of its contents
to any person or organisation.
Statements and opinions contained in this email may
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.
************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to