dcsimg
Problem with EJB and JNDI
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   santiago_sambucety
Posted On:   Friday, March 10, 2006 01:39 PM

Hello. My name is Santiago, and i am a student from the University of Valldolid, in Spain. I was wondering that maybe you could help me with a problem that i have with my dear EJB. I am new in the world of EJB, I have done the first EJB from de Sun tutorial (I´m using the Sun Java System Application Server PE 8.2) and now I am trying to improve it in that way: I have the EJB and the client in diferent machines conected. I am trying to understand how to use JNDI, but i have not good results :( I have read about using ldap but i dont know if it is apropiated, or if it is installed automaticaly with the sun aplication, or if i have to download and install it... i am not sure about anything :) This is my client´s code (part of it)    More>>

Hello. My name is Santiago, and i am a student from the University of Valldolid, in Spain. I was wondering that maybe you could help me with a problem that i have with my dear EJB. I am new in the world of EJB, I have done the first EJB from de Sun tutorial (I´m using the Sun Java System Application Server PE 8.2) and now I am trying to improve it in that way: I have the EJB and the client in diferent machines conected.

I am trying to understand how to use JNDI, but i have not good results :( I have read about using ldap but i dont know if it is apropiated, or if it is installed automaticaly with the sun aplication, or if i have to download and install it... i am not sure about anything :)

This is my client´s code (part of it)

Hashtable envirom = new Hashtable();
envirom.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
envirom.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
envirom.put(Context.PROVIDER_URL,"iiop://Santiago:389");
envirom.put(Context.PROVIDER_URL,"ldap://192.168.1.101:389");
envirom.put(Context.SECURITY_AUTHENTICATION,"none");
InitialContext ctx = new InitialContext(envirom);
Object objref = ctx.lookup("java:comp/env/ejb/Multiplica");

When I try to connect in local mode (client and EJB in the same machine) i get something like that:
javax.naming.CommunicationException: 192.168.1.101:389 [Root exception is java.n
et.ConnectException: Connection refused: connect]
at com.sun.jndi.ldap.Connection. (Connection.java:204)
at com.sun.jndi.ldap.LdapClient. (LdapClient.java:118)
at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1578)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2596)
at com.sun.jndi.ldap.LdapCtx. (LdapCtx.java:283)
......

It is even worse when i try it in different machines:
10-mar-2006... com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImp1
ADVERTENCIA: "IOP00410201: Fallo de conexion: Tipo de socket: IIOP_CLEAR_TEXT;
name of host: portatil; puerto: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code:201 completed:No
....

Both SSOO are XP and I have disabled Firewalls.

PLEASE, if you colud help me It would fantastic, because I am in that trouble, i have tryed 1000 solutions but i am not able to understand it.

Hoping you can help me.

Santiago.

PLease, contact me on: ssamvic@hotmail.com

   <<Less

Re: Problem with EJB and JNDI

Posted By:   Anonymous  
Posted On:   Monday, April 17, 2006 06:42 AM

Checkout the reachability of your JNDI server.

Re: Problem with EJB and JNDI

Posted By:   ankush_purwar  
Posted On:   Friday, March 10, 2006 02:57 PM

Have a look on the tutorial provided by "Sun Java System Application Server"
About | Sitemap | Contact