dcsimg
Exception in JNDI while executing client program (EJB)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Deepa_Raghuraman
Posted On:   Monday, June 3, 2002 03:58 AM

Hi, I am new to JNDI. I am working on EJB stateless session. I am using J2EE as EJB Server. When i try to run the client side program in different machime it gives me the following exception : javax.naming.CommunicationException: Request: 1 cancelled at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:47) at com.sun.jndi.ldap.Connection.readReply(Connection.java:396) at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:315) at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:146) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2516) at com.sun.jndi.ldap.LdapCtx. (LdapCtx.java:263) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtx   More>>
			Hi,
			

I am new to JNDI. I am working on EJB stateless session.
I am using J2EE as EJB Server. When i try to run the client side program in different machime
it gives me the following exception :

javax.naming.CommunicationException: Request: 1 cancelled
at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:47)
at com.sun.jndi.ldap.Connection.readReply(Connection.java:396)
at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:315)
at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:146)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2516)
at com.sun.jndi.ldap.LdapCtx. (LdapCtx.java:263)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:76)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:24)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext. (InitialContext.java:195)
at HelloClient.main(HelloClient.java:40)


But if i run it in same machine where the J2EE server is, it works fine.
This exception is raise when i create an instance of Context class.

I am setting the initial context factory to com.sun.jndi.ldap.LdapCtxFactory and
provide url to ldap://mymachinename:port as follows :

/*
* Get System properties for ?JNDI initialisation
*/
Properties props = System.getProperties();


/*
* Set the inital context factory
*/
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");


/*
* Set the provider url
*/
props.put(Context.PROVIDER_URL,"ldap://itws2:1050");

/*
* Form an initial context
*/
Context ctx = new InitialContext(props);


Can anyone help me it is urgent


regards,
Deepa Raghuraman
   <<Less

Re: Exception in JNDI while executing client program (EJB)

Posted By:   Bozidar_Dangubic  
Posted On:   Monday, June 3, 2002 05:54 AM

deepa, this is directly from the API

This exception is thrown when the client is unable to communicate with the directory or naming service. The inability to communicate with the service might be a result of many factors, such as network partitioning, hardware or interface problems, failures on either the client or server side. This exception is meant to be used to capture such communication problems.

Another thing is that you are not supplying the credentials in you Properties which you will need to connect to J2EE on another server. I would also try to locate it using IP and not "ldap://itws2:1050" Lastly, make sure that JNDI server is up and running on itws2 and that 1050 is open because depending on your network infrastructure you may have network issues.
About | Sitemap | Contact