EJB中为什么不能通过参数进行回传? 要通过EJB返回的参数必须是可序列化的对象或变量 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢.不过这里是在同一个类中,也有这个要求吗?而且String类型的应该是可以序列化的吧。 if( send(outMessage.toString().getBytes()) != 1 ){ writeLog("发送数据错误"); return -1;} try{ //取得返回的付款请求; String value =new String(); int i; if( (i = receive(sn, value, null)) <= 0){ writeLog("接收回应消息错误,超时或者网络错误"); deleteMessage(serialNo); return i; } if (value == null || value.length() == 0 ){ writeLog("没有收到回应消息,超时或者网络错误); return -3;//在此处返回 } .....在receive中:public int receive(int sn, String value){ ...... value = receiveData(messageLength); if( value == null || value.length() == 0 ){ writeLog("超时未收到消息"); return -21;//此处未返回,说明value中有内容 } return value.length();}返回的是正值,在receive中value有内容。 我想明白了,string类型是不能通过参数回传的,因为每次改动都是创建一个新对象.跟EJB无关,谢谢各位 如何用ajax实现页面无刷新页面更新技术? Cron表达式 关于Jdk环境变量设置 为什么我的分页不能运行?? 求救,解决HTTPS的传输问题?? 高手请帮忙做这些面试题目 struts的一个错误! 关于配置JBOSS的问题 紧急求助!我的网页为什么显示不了java applet效果??? 求助,FTP下载不了文件的问题 我在applet中用到了org.w3c.dom.*来处理xml,在jbuilder中可以,打成jar在IE中不行。 关于报表的问题?
不过这里是在同一个类中,也有这个要求吗?而且String类型的应该是可以序列化的吧。
writeLog("发送数据错误");
return -1;
}
try{
//取得返回的付款请求;
String value =new String();
int i;
if( (i = receive(sn, value, null)) <= 0){
writeLog("接收回应消息错误,超时或者网络错误");
deleteMessage(serialNo);
return i;
}
if (value == null || value.length() == 0 ){
writeLog("没有收到回应消息,超时或者网络错误);
return -3;//在此处返回
}
.....
在receive中:
public int receive(int sn, String value){
......
value = receiveData(messageLength);
if( value == null || value.length() == 0 ){
writeLog("超时未收到消息");
return -21;//此处未返回,说明value中有内容
}
return value.length();
}返回的是正值,在receive中value有内容。