File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Exception at client side EJB program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception at client side EJB program" Watch "Exception at client side EJB program" New topic

Exception at client side EJB program

Deepa Raghuraman

Joined: Nov 26, 2001
Posts: 13
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(
at com.sun.jndi.ldap.Connection.readReply(
at com.sun.jndi.ldap.LdapClient.ldapBind(
at com.sun.jndi.ldap.LdapClient.authenticate(
at com.sun.jndi.ldap.LdapCtx.connect(
at com.sun.jndi.ldap.LdapCtx.<init>(
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(
at javax.naming.spi.NamingManager.getInitialContext(
at javax.naming.InitialContext.getDefaultInitCtx(
at javax.naming.InitialContext.init(
at javax.naming.InitialContext.<init>(
at HelloClient.main(

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 ort as follows :

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

* Set the inital context factory

* Set the provider url
* Form an initial context
Context ctx = new InitialContext(props);

Can anyone help me it is urgent

Deepa Raghuraman
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
What version of the JRE are you running on the
Have you loaded directory information into the
client's LDAP service?
[ June 04, 2002: Message edited by: Rufus Bugleweed ]
Deepa Raghuraman

Joined: Nov 26, 2001
Posts: 13
I got the solution. Iam using jdk1.4 and j2ee1.3.1. I changed the initial context factory to com.sun.jndi.cosnaming.CNCtxFactory and protocol to iiop. It works for Session bean.
But I have one more problem. Now i am trying out Entity bean for which database is needed. I am using the existing one(Cloudscape) in J2ee.
Now i need to use Entity bean in client, do i need to connect to database and then do lookup.
and what does "java:comp/env/jdbc/Cloudscape" means?
Please help me. I need it urgently
Deepa Raghuraman
I agree. Here's the link:
subject: Exception at client side EJB program
It's not a secret anymore!