Rickard �berg wrote:

> 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]

Hi

I was hoping that I could just specify something in
the jboss.xml file.  One thing I also don't understand
is that the "java:/cmdDS"  (cmsDS being my data source) is accesable by
the beans but not by an
outside client, so under which namespace to you register the data source
in the JNDI tree so that it is available for any proccesses outside the
container.  There must be a special namespace for doing that.  Tell me
also why it's not good to reference the data source in my initial
context?

You menthioned the ...ctx.bind(....  Where exactly do you do this?
I was hoping that you could also explain the use of the resource-manager
tags and
the role they play.

Regards
Manie Coetzee



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

Reply via email to