I've never looked at the specs for this, but with ejbs you end up looking
up something like java:/comp/env/GenericDS when you have entries like that.

david jencks


On 2002.08.21 19:37:26 -0400 David Brady wrote:
> 
> Don't let my far-to-general words mislead you. :)  The example is
> actually very literal.  I have very specific names for these items, but
> wanted to avoid sharing them with the world.  So, I'll make up some
> better words here...
> 
> If it helps (and I hope it does), just substitute 'BankAccountDS' for
> 'generic', and 'WellsFargoBankAccountDS' for 'specific'.
> 
> And then the problem reads more along the lines: I want my servlet to
> reference BankAccountDS - and have that reference mapped to
> WellsFargoBankAccountDS via (I think) jboss-web.xml.  This, of course,
> sets the stage for me to use the same servlet with
> 'WashingtonMutualBankAccountDS' without changing code - only changing
> jboss-web.xml
> 
> Other points: Jboss 2.4.8
> 
> Here's the previous message with the words changed:
> 
> Code:
> 
> InitialContext initialCtx = new InitialContext();
> DataSource ds = (DataSource) initialCtx.lookup("BankAccountDS"); // or
> many other permutations
> 
> web.xml:
>     
>     <resource-ref>
>         <description>BankAccount DS</description>
>         <res-ref-name>BankAccountDS</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
> 
> jboss-web.xml: 
> 
>    <resource-ref>
>      <res-ref-name>BankAccountDS</res-ref-name>
>      <res-type>javax.sql.DataSource</res-type>
>      <jndi-name>java:/jdbc/WellsFargoDS</jndi-name>
>    </resource-ref>
> 
> Jboss.jcml
> 
>    <mbean code="org.jboss.jdbc.XADataSourceLoader"
> name="DefaultDomain:service=XADataSource,name=jdbc/WellsFargoDS">
>       <attribute name="PoolName">jdbc/WellsFargoDS</attribute>
>       ...
> 
> STARTUP: I see the following in the log:
> 
> INFO  jdbc/WellsFargoDS jdbc/WellsFargoDS - XA Connection pool
> jdbc/WellsFargoDS bound to java:/jdbc/WellsFargoDS
> ...
> DEBUG EmbeddedCatalinaServiceSX  - Linking 'BankAccountDS' to JNDI name:
> java:/jdbc/WellsFargoDS
> 
> RUNTIME:
> 
> initialCtx.lookup("BankAccountDS") fails with -
> javax.naming.NameNotFoundException: BankAccountDS not bound
> 
> Other variations - just for fun:
> 
> Failure  java:jdbc/BankAccountDS (BankAccountDS not bound)
> Failure  java:/jdbc/BankAccountDS (BankAccountDSnot bound)
> Failure  java:BankAccountDS (BankAccountDS not bound)
> Failure  java:/BankAccountDS (BankAccountDS not bound)
> Failure  BankAccountDS (BankAccountDS not bound)
> Failure  /BankAccountDS (BankAccountDS not bound)
> Failure  jdbc/BankAccountDS (jdbc not bound)
> Failure  /jdbc/BankAccountDS (jdbc not bound)
> Failure  java:WellsFargoDS (WellsFargoDS not bound)
> Failure  java:/WellsFargoDS (WellsFargoDS not bound)
> Failure  WellsFargoDS (WellsFargoDS not bound)
> Failure  /WellsFargoDS (WellsFargoDS not bound)
> 
> These, of course, work:
> 
> Success  java:jdbc/WellsFargoDS
> Success  java:/jdbc/WellsFargoDS
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of Greg Turner
> Sent: Wednesday, August 21, 2002 3:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Mapping datasource with jboss-web.xml - what
> am I missing here?
> 
> 
> I think the answer may lie in better saying what you mean by "map a
> generic datasource  to a specific datasource"  I don't know what this
> means. 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to