Hi!
pranab wrote:
> I tried as per the suggestion to see if java:comp/env works .
> Here is what I did
>
> Properties p = new Properties();
>
> p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
> p.put(Context.PROVIDER_URL,"localhost:1099");
> p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
> Context ctx = (Context) new
> InitialContext(p).lookup("java:comp/env");
> javax.naming.NamingEnumeration enum1 = ctx.list("");
> while(enum1.hasMore())
> {
> System.out.println("Object 1:"+enum1.next());
> }
> Here is what I got
> javax.naming.NameNotFoundException: comp not bound
This doesn't work since you're not doing it from a component that is
required to have the java: namespace. Do the same thing from within an
EJB and you will get a different result...
/Rickard
--
Rickard �berg
@home: +46 13 177937
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]