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

daquan198163
04-10-13 1 173 2

我用了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) {

2
banq
2004-10-17 09:53

很奇怪的访问方式,答案是可以的。