users@glassfish.java.net

List the JNDI of all running Beans

From: <glassfish_at_javadesktop.org>
Date: Tue, 10 Mar 2009 00:52:01 PDT

Hi all,

is there any possibility to list all the running Beans?
Of course it's possible to list it at the Glassfish Admin Console, but it doesn't list it all. I would suggest the remote Beans are listed only.
For example: I want to login at my application. Therefore my AuthenticatorBean is called correct, but I don't see it in the listing.
The second possibility throws a NameNotFoundException:
InitialContext ctx = new InitialContext();
System.out.println("Listing:"+ctx.list("java:/comp/env"));
No object bound to name "java:/comp/env".

At the Deployment of the application the JNDI of one Bean is listed e.g.:
java:comp/env/my.package.MyBean/entityManager

But if I want to lookup this Bean to test the right JNDI lookup the same exception occured:
InitialContext ctx = new InitialContext();
MyBean b = (MyBean) ctx.lookup("java:comp/env/my.package.MyBean/entityManager
");

Does anybody know a correct way to list all the JNDI names and the correct call of the Beans?
[Message sent by forum member 'fenixx' (fenixx)]

http://forums.java.net/jive/thread.jspa?messageID=335982