我的ejb怎么不好用啊?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了我的ejb怎么不好用啊?相关的知识,希望对你有一定的参考价值。
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<String> balanceChanging(BalanceChangeDTO dto)
List<String> retList = new ArrayList<String>();
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"); 在这里出错
以上是关于我的ejb怎么不好用啊?的主要内容,如果未能解决你的问题,请参考以下文章