users@glassfish.java.net

Cannot lookup queue name in JNDI - only after doing JNDI browse on console

From: <glassfish_at_javadesktop.org>
Date: Thu, 04 Jun 2009 05:52:33 PDT

Hi,

I have several queues bound in JNDI which all have a name starting with 'queue/foo'. E.g. 'queue/foo/process1', 'queue/foo/process2' and so on.

When I wanted to get all the queue names I tried the following:

final NamingEnumeration <NameClassPair> list = namingContext.list( "queue/foo" );
while ( list.hasMore() ) {
     // and so on
}

This did not work at once. However, _after_ I started the JNDI Browser from the Admin console (which showed me the queue/foo queues as well), I was also able to retrieve the names with the above statement. After a restart of GlassFish I was again not able to retrieve the names with my app.

Is this some sort of lazy initialization? The quick startup option of GlassFish is disabled.
How can I trigger the complete initialization in my app just as the JNDI Browser does?

Any help is much appreciated.
Thanks,
Chris.
[Message sent by forum member 'chrjohn' (chrjohn)]

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