Hi!

Manie Coetzee wrote:
> I currently have a problem getting a handle to a
> data source from outside the container.  I am using
> junit with each of my beans (BMP), and one of the
> tests involves cleaning out the database for each
> test run.  I don't have a problem seeing the data source
> in the beans ("java:/xxx") but cannot find out how
> to register the data source in the JNDI intitial context namespace.
> It seems to me that the place to do this is in the jboss.xml
> file where you use the resource manager tags.

If JUnit is run in the same JVM, then you can simply lookup the
datasource using the java:/xxx name. If you really want to bind it to
the initial context namespace (don't understand why, but that's your
problem) then simple bind a LinkRef in the initial context namespace
(ctx.bind("foo", new LinkRef("java:/xxx")).

> I also read alot about the ../ejb.., ../jdbc.. and ..comp/env..
> namespaces.  Can anybody tell me in which namespace the
> initial context exists?

If you do "new InitialContext()" you have the initial context, or
default namespace as I prefer to call it. The ones you mention live in
java:comp/env namespace as defined by the J2EE specs.

regards,
  Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]


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

Reply via email to