我的ejb怎么不好用啊?

[复制链接]
查看11 | 回复1 | 2013-6-17 17:07:48 | 显示全部楼层 |阅读模式
javax.naming.CommunicationException: Failed to retrieve stub from server localhost/127.0.0.1:8080 [Root exception is java.io.EOFException]
@Stateless
@RemoteBinding(jndiBinding="BalanceBean/remote")
public class BalanceChangeBean implements BalanceChangeBeanLocal,BalanceChangeBeanRemote {
public List balanceChanging(BalanceChangeDTO dto) {
List retList = new ArrayList();
boolean isValid = validation(dto);
if(isValid){
System.out.println("here in the valid section");
}else{
retList.add("0000000");
retList.add("1:validation failed");
return retList;
}
return retList;
}
测试代码:
public class TestBean extends TestCase {
public static InitialContext ctx;
public static BalanceChangeDTO dto ;
public static Properties props;
BalanceChangeBeanRemote bean =null;
protected void setUp() throws Exception {
props = new Properties();
props.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:8080");
//props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
ctx = new InitialContext(props);
bean = (BalanceChangeBeanRemote) ctx.lookup("BalanceBean/remote");
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void testBalanceChanging() {

System.out.println(bean.balanceChanging(getDto()));
System.out.println("***********8");
}
bean = (BalanceChangeBeanRemote) ctx.lookup("BalanceBean/remote"); 在这里出错

回复

使用道具 举报

千问 | 2013-6-17 17:07:48 | 显示全部楼层
貌似端口错了吧,JBOSS的JNDI默认端口是1099
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行