JNDI Lookup Problem

  • Thread starter Subramanian.ganesh
  • Start date
S

Subramanian.ganesh

Hi,

I searched the entire web, Still couldn't solve the problem. Seems many
are facing the same problem.

The following are the sample codes from sun's site. I'm using J2ee
server in WinXp.

Context jndiContext = null;
Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://hydws0060:8080");

try {
jndiContext = new InitialContext(env);
} catch (NamingException e) {
System.out.println("Could not create JNDI API context: " +
e.toString());
System.exit(1);
}

ConnectionFactory connectionFactory = null;
Destination dest = null;

try {
connectionFactory =
(ConnectionFactory)
jndiContext.lookup("jms/ConnectionFactory");
dest = (Destination) jndiContext.lookup(destName);
} catch (Exception e) {
System.out.println("JNDI API lookup failed: " +
e.toString());
e.printStackTrace();
System.exit(1);
}

While executing this program, I'm receiving an exception
"Could not create JNDI API context:
javax.naming.CommunicationException: Request: 1 cancelled"

I followed all the steps as given in the tutorial.

Thanks in Advance,
Ganesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top