Hi!

Stuart Barlow wrote:
> 
> When I make the following calls in my classes that the EJB call on.
> I only get one name mentioned...
> env
> 
> Context context = new InitialContext();
> NamingEnumeration ne = context.list("java:comp");
> if ( ne == null ) {
>    System.out.println("ERROR: cannot get the naming enumeration");
> }
> 
> while ( ne.hasMore() ) {
>    NameClassPair np = (NameClassPair)ne.next();
>    System.out.println("context Name: " + np.getName() + " className: " + 
>np.getClassName());
> }
> 
> Am I looking in the wrong name space?

Sounds perfectly correct. The references are in java:comp/env, so if you
enumerate java:comp you will only get "env". Try enumerating
java:comp/env for a different story altogether...

> When I make the following call...
> 
> DataSource ds = (DataSource)context.lookup("stuDB");
> 
> I do get the following exception...
> javax.naming.NameNotFoundException: stuDB not bound

You're not being very stringent here, buddy. Above you look in the
java:comp namespace, but here you try the default namespace. Which is it
gonna be? ;-)

The correct name is (as described in the EJB spec): java:comp/env/stuDB

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


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

Reply via email to