项目是用的flex3+Spring3+hibernate3.6+blazeds,全用注解写的,在同一页面发送两次后台请求,总是报[RPC Fault faultString="java.lang.StackOverflowError : null" faultCode="Server.Processing" faultDetail="null"]错误,代码如下:
[code="java"]<?xml version="1.0" encoding="utf-8"?>
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
allowClose="true" title="部门管理区" allowDrag="true" allowMaximize="true"
allowMinimize="true" resizeEffect="Resize" moveEffect="Move" horizontalScrollPolicy="off"
verticalScrollPolicy="off" [color=red]creationComplete="getAllDepartment()"[/color]>
<mx:AMFChannel id="myamf"
url="http://localhost:8080/MyFlexOA/messagebroker/amf"/>
<mx:ChannelSet id="channelSet"
channels="{[myamf]}"/>
<mx:RemoteObject id="departmentService"
destination="departmentService"
channelSet="{channelSet}"/>
<mx:RemoteObject id="departmentServiceDel"
destination="departmentService"
channelSet="{channelSet}" />
<mx:Script>
<![CDATA[
import mx.rpc.AsyncToken;
import mx.events.ListEvent;
import mx.events.ItemClickEvent;
import cn.edu.hyit.oa.event.DepartmentEvent;
import mx.events.CloseEvent;
import components.AddDepartment;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import cn.edu.hyit.oa.vo.DepartmentVo;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import flash.events.ContextMenuEvent;
[Bindable]
public var departmentList:ArrayCollection;
private var addDepartmentView:AddDepartment;
private function getAllDepartment():void {
var menuItem:ContextMenuItem = new ContextMenuItem("删除");
var menuItem2:ContextMenuItem = new ContextMenuItem("保存更新");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,deleteHandler);
//menuItem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,updateHandler);
var menu:ContextMenu = new ContextMenu();
menu.hideBuiltInItems();
menu.customItems.push(menuItem);
menu.customItems.push(menuItem2);
this.contextMenu = menu;
[color=red]departmentService.addEventListener(ResultEvent.RESULT, resultHandler);
departmentService.loadAllDepartments();[/color]
}
private function deleteHandler(e:ContextMenuEvent):void
{
[color=red]departmentServiceDel.addEventListener(ResultEvent.RESULT, delResultHandler);
var d:DepartmentVo = de.selectedItem as DepartmentVo;
departmentServiceDel.delDep(d);[/color]
}
private function resultHandler(e:ResultEvent):void {
departmentList = e.result as ArrayCollection;
}
private function delResultHandler(e:ResultEvent):void {
departmentList.removeItemAt(de.selectedIndex);
}[/code]