struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Dahlin" <sdah...@cableone.net>
Subject Re: datasource problem
Date Thu, 02 Jan 2003 07:34:03 GMT
I am a little unclear what you mean by using modules?

Steve

----- Original Message -----
From: "David M. Karr" <dmkarr@earthlink.net>
To: <struts-user@jakarta.apache.org>
Sent: Wednesday, January 01, 2003 3:45 PM
Subject: Re: datasource problem


> >>>>> "Steven" == Steven Dahlin <sdahlin@cableone.net> writes:
>
>     Steven> When I try to get a datasource which has been defined in the
struts-config.xml no matter what I do the datasource returns back null.  My
struts-config.xml for data-sources is:
>     Steven>     <data-sources>
>
>     Steven>         <data-source key    = "conPool">
>
>     Steven>             <set-property  property  = "autoCommit"
>     Steven>                            value     = "false"/>
>     Steven>             <set-property  property  = "description"
>     Steven>                            value     = "database source"/>
>     Steven>             <set-property  property  = "driverClass"
>     Steven>                            value     =
"oracle.jdbc.driver.OracleDriver"/>
>     Steven>             <set-property  property  = "user"
>     Steven>                            value     = "theuser"/>
>     Steven>             <set-property  property  = "password"
>     Steven>                            value     = "thepassword"/>
>     Steven>             <set-property  property  = "url"
>     Steven>                            value     =
"jdbc:oracle:thin:@192.192.192.192:1675:inst"/>
>     Steven>          </data-source>
>
>     Steven>       </data-sources>
>
>     Steven> In the section of code used for initialization of the
datasource there is the following:
>
>     Steven>             ServletContext context =
actSrv.getServletContext();
>     Steven>             dsSrc    = ( DataSource ) context.getAttribute(
"ConPool" );
>
>     Steven> The context is captured but the datasource remains null.
>
> Are you using modules?  The data-source is put into the ServletContext
with a
> key that is constructed by appending the module prefix to the given key.
>
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net   ; SCJP
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message