能否从WebLogic上部署的WebApp里访问JBOSS中的EJB!!!!!!

04-10-13 daquan198163
我用了jnp协议查找jboss中ejb的远程home的jndi,WebLogic说不认得jnp协议

// 在此输入java代码
Properties properties = null;
    try {
      properties = new Properties();
      properties.setProperty("java.naming.factory.initial",
                             "org.jnp.interfaces.NamingContextFactory");
      properties.setProperty("java.naming.provider.url",
                             "jnp://" +engineHostLocation + ":1099");
      System.out.println("RSMessageSenderBean========queueHostLocation:"
                         + engineHostLocation);
      properties.setProperty("java.naming.factory.url.pkgs",
                             "org.jnp.interfaces.NamingContextFactory");
      InitialContext ctx = new InitialContext(properties);

      Object obj = ctx.lookup(rsMessageSenderJNDI);
      rsmsHome = (RSMessageSenderHome)PortableRemoteObject.narrow(obj,
                                            RSMessageSenderHome.class);

      obj = ctx.lookup(driverManagerJNDI);
      dmHome = (DriverManagerHome) PortableRemoteObject.narrow(obj,
                                            DriverManagerHome.class);

      obj = ctx.lookup(authenticateCenterJNDI);
      acHome = (AuthenticateCenterHome)PortableRemoteObject.narrow(obj,
                                            AuthenticateCenterHome.class);
    }catch (Exception e) {
<p>

2
banq
2004-10-17 09:53
很奇怪的访问方式,答案是可以的。

猜你喜欢