The problem with TOPLink and maybe jBoss is because when I pass the
string name of the datasource...
java:comp/env/stuDB

onto TOPLink then they construct a CompositeName from the string.
And when they use the InitialContext.lookup(Name) method
they get the InvalidNameException: Not a compound name ERROR.

When I do the following I get the same error...

javax.naming.CompositeName dsName = new 
javax.naming.CompositeName("java:comp/env/stuDB");
DataSource ds2 = (DataSource)context.lookup(dsName);

Error report from jBoss...
[Test] Error loading persistence service. javax.naming.InvalidNameException: Not a 
compound name:
comp/en
v/stuDB


When looking things up in the InitialContext.lookup(Name) method
is it okay to pass in a CompositeName object?


> > Thats what I thought as well.
> > If I pass through java:/comp/env/stuDB or /comp/env/stuDB then
> > it still complains about comp/env/stuDB.
> >
> > I need to get some feedback from TOPLink. I think that they
> > are doing something funny. Ill get back later or early next
> > week with more info. Im only in work for another hour or so.
> >
> > Rickard �berg wrote:
> > >
> > > Hi!
> > >
> > > Stuart Barlow wrote:
> > > > Thanks for the help as I seem to have resolved all the jBoss
> > > > problems. I think that jBoss was working all along.
> > > > As allways. :-)
> > > >
> > > > When I search the java:/comp/env space I can see the following.
> > > > context Name: stuDB className: javax.naming.LinkRef
> > > > Which I think is good. Apart from the fact that the className is
> > > > LinkRef and not DataSource?
> > >
> > > Which is as it should be. The link points to a DataSource.
> > If you were
> > > to lookup this name you would get a DataSource.
> > >
> > > > The problem arises when I inform TOPLink that either
> > > > java:/comp/env/stuDB or /comp/env/stuDB is the JNDI
> > > > bound DataSource to use. TOPLink tells me:
> > > >
> > > > EXCEPTION DESCRIPTION: Cannot acquire DataSource: comp/env/stuDB
> > > > javax.naming.InvalidNameException: Not a compound name:
> > comp/env/stuDB
> > > >
> > > > I have informed TOPLink of this and am awaiting a response?
> > >
> > > Shouldn't the name be java: prefixed?


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

Reply via email to