Hi Scot!

Per a conversation I had earlier with Aaron, you can go into EJX and add a
resource to the ejb-jar.xml file, such as jdbc/mydatasource, and indicate
that it is indeed a data source.  You can then go into jboss.xml in EJX (EJB
1.1 XML with jBoss XML) and assign a resource manager to the resource.  Add
a new resource manager ( JDBC DataSource ), in the resource name field, give
it the same name as you did in the EJB-JAR.XML ( jdbc/mydatasource ), then
in the JNDI name of the Data Source field, give it the name assigned by
jBoss ( java:/mydatasource ).  Now, you can address you datasource with
java:/comp/env/jdbc/mydatasource.  This is container independant and works
great, less filling :)

Wes

-----Original Message-----
From: Scot Bellamy [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 20, 2000 11:18 AM
To: jBoss
Subject: Re: [jBoss-User] NameNotFoundException looking up datasources


Thanks for the clarification.  I just noticed (and remembered from 
previous disucussions) that going from 2.0 Beta Prod3 to Final that 
java:/ was prepended to the datasource name.  

Thanks again,
Scot.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 11/20/00, 9:08:25 AM, "Rickard Oberg" <[EMAIL PROTECTED]> wrote 
regarding Re: [jBoss-User] NameNotFoundException looking up datasources:


> Hi!

> >I didn't see it in your deployment output, but restart your jBoss server
> >and take a close look at the name being bound to your Datasource.  I
> >found that  java:/ is prepended to the name I specify.
> > If this is the
> >case, in your example the JNDI name that is being bound to your
> >datasource might be java:/jdbc/UnitStockingDB instead of
> >java:comp/env/UnitStockingDB that you have specified in your code.

> This is incorrect. The datasources are only bound to java:/yourname. 
Whether
> or not they are bound to java:comp/env is determined by your deployment
> descriptors.

> >By the way, it seems that other EJB servers, e.g. Suns reference
> >implementation, are adhearing to the standard of java:comp/ instead of
> >java:/, am I correct?


> They are probably like any EJB 1.1 compliant server, so yes. But so does
> JBoss.

> This is the rule: the datasource is initially bound to a "java:/" name 
such
> as "java:/DefaultDS". Then, for each bean that has a datasource mapping 
we
> also add it to the specified names, e.g. "java:comp/env/jdbc/MyDS". Each
> bean has its own namespace for such mappings.

> See docs for more info.

> I'm not sure where you got the idea that JBoss did *not* support
> "java:comp/env"!?

> /Rickard




> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to