客户端远程调用ejb3问题

wzw_19850911 2009-09-16 10:36:36
我写了一个远程无状态的bean 用websphere部署 但是在客户端调用的时候出错了
以下是客户端调用程序
package com.chncloud.steven.test;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.chncloud.steven.bean.HelloWorldBeanRemote;

public class TestRemote {
public static InitialContext TestCall() {
InitialContext ic = null;
try {
Properties props = new Properties();

props.put(Context.PROVIDER_URL, "iiop://localhost:2809/");
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
props.put(Context.SECURITY_PRINCIPAL, "admin");
props.put(Context.SECURITY_CREDENTIALS, "admin");

ic = new InitialContext(props);
System.out.println("ko2");
} catch (Exception e) {
e.printStackTrace();
}

return ic;

}
public static void main(String[] args)
{
InitialContext cxt = TestCall();
System.out.println("ko1");
try {
HelloWorldBeanRemote bean = (HelloWorldBeanRemote)cxt.lookup("HelloWorldBean");
System.out.println(bean.sayHelloWorld());
} catch (NamingException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
}
但是每次调用都出现如下错误
ko2
ko1
javax.naming.NamingException: Error getting WsnNameService properties [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No]
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1439)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:946)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:865)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:545)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:123)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:798)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.chncloud.steven.test.TestRemote.main(TestRemote.java:41)
Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No
at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1250)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1321)
at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1146)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1287)
at com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1853)
at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1243)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:458)
at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1436)
... 9 more
请大家帮帮忙 看看是什么问题
...全文
188 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wzw_19850911 2009-09-16
  • 打赏
  • 举报
回复
好心人帮一下啊 我都不知道在websphere下面怎么部署一个ejb 还有如何在客户端远程调用这个ejb
wzw_19850911 2009-09-16
  • 打赏
  • 举报
回复
HelloWorldBeanRemote是HelloWorldBean的接口 客服端的HelloWorldBeanRemote和服务端的HelloWorldBeanRemote是同一份代码 是不是还需要什么配置文件?
jxwnhj0717 2009-09-16
  • 打赏
  • 举报
回复
HelloWorldBeanRemote是不是HelloWorldBean的接口,客服端的HelloWorldBeanRemote和服务端的HelloWorldBeanRemote是不是同一份代码
wzw_19850911 2009-09-16
  • 打赏
  • 举报
回复
ding a 有人帮忙不?????????????????????!!!!!!!!!!!!!!!!

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧