-
1. Re: JBuilder7/8 & JBossOpenTool2.5 problems with Naming/Dire
lumin Jan 14, 2003 9:34 AM (in response to mnachev)Hi,
from my point of vies your probem doesn't depend on Jbuilder or the the voyager plugin. JBoss provides an implementation JNDI. Hopefully the following code snippet helps.
betst regards ,
lumin
Hashtable entries = new Hashtable();
Vector keys = new Vector();
try {
Hashtable htenv = new Hashtable();
//Look at the Jboss Quick Start Manual, to find this
htenv.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
InitialContext context = new InitialContext(htenv);
NamingEnumeration ne = context.listBindings("");
if (!ne.hasMoreElements())
out.println("I'm sorry, but there are no elemnts available");
while (ne.hasMoreElements()){
Binding binding = (Binding)ne.next();
out.println("Binding-Name: "+binding.getName()+" Object: "+binding.getObject().toString()+"");
}