Hello,

I encounter a probleme in one of my EJB when this one tries to get a
reference on another EJB which may
be (or may not be) located on another host/server. I use the following code
where a_Context is long a String
of kind IOR:... refering to a root CosNaming provided by JBoss (JacORB in
fact)

    try {
      java.util.Properties p = new java.util.Properties();
      p.put(Context.PROVIDER_URL, a_Context);
      ic = new InitialContext(p);

      Object o = ic.lookup( "EJBCTIProxy");
      EJBCTIProxyHome home = (EJBCTIProxyHome)PortableRemoteObject.narrow(
o, EJBCTIProxyHome.class);
      ic.close();
      // EJB creation
      EJBCTIProxy delegate = home.create();
      return delegate;
    } catch (Exception ne) {
      throw new CreateException(ne.getMessage());
    } finally {
      if (ic != null)
      try { ic.close(); } catch (Exception e) {}
    }

 the lookup fails with the exception printed below.
I understand that should have added the line to solve the problem:

p.put(Context.INITIAL_CONTEXT_FACTORY, "some.class.from.jacorb");

But I would like to avoid this solution as it is not portable from one
server to another. The class name is different
in BEA WebLogic for example. So, Is there another soulution ?


17:30:19,206 WARN  [NamingContext] Failed to connect to IOR:1099
javax.naming.CommunicationException: Failed to connect to server IOR:1099.
Root
 exception is
javax.naming.ServiceUnavailableException: Failed to connect to server
IOR:1099.
 Root exception is
java.net.UnknownHostException: IOR
        at java.net.InetAddress.getAllByName0(InetAddress.java:920)
        at java.net.InetAddress.getAllByName0(InetAddress.java:890)
        at java.net.InetAddress.getAllByName(InetAddress.java:884)
        at java.net.InetAddress.getByName(InetAddress.java:814)
        at
org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
.java:61)
        at
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:159)
        at
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1029)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:450)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at
com.ftrd.cti.ejb.EJBCTIClientProxyBean.createServer(EJBCTIClientProxy
Bean.java:192)

Gerard BUNEL

--
[EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/
Technopole Brest Iroise BP 80802 - 29608 Brest cedex - France -
Tel. : +33 (0)2 98 05 43 21 - Fax. : +33 (0)2 98 05 20 34 - e-mail:
[EMAIL PROTECTED]
Centre Affaires Oberthur - 74D, rue de Paris -  35700 Rennes - France
Tel. : +33 (0)2 99 84 15 84 - Fax : +33 (0)2 99 84 15 85 - e-mail:
[EMAIL PROTECTED]




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to