posted 14 years ago
I have issues with my JNDI lookup . I got my context.xml outside of my webapplication . I have pasted the code below . But it was throwing NameNotFoundException .
javax.naming.NameNotFoundException: jms/Test at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400
Hashtable hashtableEnvironment = new Hashtable();
hashtableEnvironment.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
hashtableEnvironment.put(Context.PROVIDER_URL, "file:///C:/sample");
Context context = new InitialContext(hashtableEnvironment);
NamingEnumeration namingenumeration = context.listBindings("");
while (namingenumeration.hasMore()) {
Binding binding = (Binding)namingenumeration.next();
System.out.println(
binding.getName() + " is bound to " +
binding.getObject()
);
}
Destination dest = (Destination) context.lookup("jms/test");
any help is appreciated.