错误是这样的
Flex中的代码:
<?xml version="1.0" encoding="UTF-8"?>
<mx:TitleWindow creationComplete="getAllClass()" showCloseButton="true" title="班级管理" close="PopUpManager.removePopUp(this)" layout="absolute" width="700" height="500" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.remoting.RemoteObject;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
//当期选中班级的id
private var curid:String = "0";
[Bindable]
private var dispalyArray:ArrayCollection = new ArrayCollection();
private function getAllClass():void{
var classService:RemoteObject = new RemoteObject("classService");
classService.getAll();//返回一个泛型List
classService.addEventListener(FaultEvent.FAULT,getAllClassFault);
classService.addEventListener(ResultEvent.RESULT,getAllClassResult);
}
/**
* 获取所有班级信息失败
*/
private function getAllClassFault(event:FaultEvent):void{
Alert.show(event.fault.toString(),"获取班级信息失败");
} /**
* 获取所有班级信息成功
*/
private function getAllClassResult(event:ResultEvent):void{
dispalyArray = ArrayCollection(event.result);
class_dg.dataProvider = dispalyArray;
// Alert.show(event.result.toString(),"获取班级信息OK");
}
]]>
</mx:Script>
<mx:Label text="根据班级名称查找:" height="20" width="91" y="19" x="119"/>
<mx:TextInput width="110" y="17" x="218" height="20"/>
<mx:Button label="查找" width="68" y="18" x="353" height="19"/><mx:DataGrid id="class_dg" dataProvider="{dispalyArray}" width="459" y="47" x="119" height="201">
<mx:columns><mx:DataGridColumn headerText="班级名称" width="100" dataField="className"/>
<mx:DataGridColumn headerText="班级说明" width="100" dataField="Re"/>
<mx:DataGridColumn visible="false" headerText="id" width="100" dataField="id"/>
</mx:columns>
</mx:DataGrid><mx:Label text="班级名称:" height="21" width="55" y="276" x="119"/>
<mx:Label text="班级说明:" height="20" width="70" y="318" x="119"/>
<mx:TextInput id="name_txt" width="226" y="272" x="195" height="30"/>
<mx:TextInput id="re_txt" width="226" y="316" x="195" height="30"/>
<mx:Button label="修改" width="60" y="361" x="195" height="30"/>
<mx:Button label="删除" width="60" y="361" x="280" height="30"/>
<mx:Button label="添加" width="60" y="361" x="366" height="30"/>
</mx:TitleWindow>用到的Java中的方法,
/**
* 获取全部对象
*
* @see HibernateGenericDao#getAll(Class)
*/
public List<T> getAll() {
return getAll(getEntityClass());
}
配置的Java类
<destination id="classService">
<properties>
<source>com.RayiDream.Service.ClassService</source>
<scope>application</scope>
</properties>
</destination>
新手,求解答 感谢了!!
Flex中的代码:
<?xml version="1.0" encoding="UTF-8"?>
<mx:TitleWindow creationComplete="getAllClass()" showCloseButton="true" title="班级管理" close="PopUpManager.removePopUp(this)" layout="absolute" width="700" height="500" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.remoting.RemoteObject;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
//当期选中班级的id
private var curid:String = "0";
[Bindable]
private var dispalyArray:ArrayCollection = new ArrayCollection();
private function getAllClass():void{
var classService:RemoteObject = new RemoteObject("classService");
classService.getAll();//返回一个泛型List
classService.addEventListener(FaultEvent.FAULT,getAllClassFault);
classService.addEventListener(ResultEvent.RESULT,getAllClassResult);
}
/**
* 获取所有班级信息失败
*/
private function getAllClassFault(event:FaultEvent):void{
Alert.show(event.fault.toString(),"获取班级信息失败");
} /**
* 获取所有班级信息成功
*/
private function getAllClassResult(event:ResultEvent):void{
dispalyArray = ArrayCollection(event.result);
class_dg.dataProvider = dispalyArray;
// Alert.show(event.result.toString(),"获取班级信息OK");
}
]]>
</mx:Script>
<mx:Label text="根据班级名称查找:" height="20" width="91" y="19" x="119"/>
<mx:TextInput width="110" y="17" x="218" height="20"/>
<mx:Button label="查找" width="68" y="18" x="353" height="19"/><mx:DataGrid id="class_dg" dataProvider="{dispalyArray}" width="459" y="47" x="119" height="201">
<mx:columns><mx:DataGridColumn headerText="班级名称" width="100" dataField="className"/>
<mx:DataGridColumn headerText="班级说明" width="100" dataField="Re"/>
<mx:DataGridColumn visible="false" headerText="id" width="100" dataField="id"/>
</mx:columns>
</mx:DataGrid><mx:Label text="班级名称:" height="21" width="55" y="276" x="119"/>
<mx:Label text="班级说明:" height="20" width="70" y="318" x="119"/>
<mx:TextInput id="name_txt" width="226" y="272" x="195" height="30"/>
<mx:TextInput id="re_txt" width="226" y="316" x="195" height="30"/>
<mx:Button label="修改" width="60" y="361" x="195" height="30"/>
<mx:Button label="删除" width="60" y="361" x="280" height="30"/>
<mx:Button label="添加" width="60" y="361" x="366" height="30"/>
</mx:TitleWindow>用到的Java中的方法,
/**
* 获取全部对象
*
* @see HibernateGenericDao#getAll(Class)
*/
public List<T> getAll() {
return getAll(getEntityClass());
}
配置的Java类
<destination id="classService">
<properties>
<source>com.RayiDream.Service.ClassService</source>
<scope>application</scope>
</properties>
</destination>
新手,求解答 感谢了!!
解决方案 »
- java的Swing程序myeclipse中可以运行,导出成可运行jar无法正常运行
- 服务器端webservice更新后,客户端报java.lang.NoClassDefFoundError
- struts2中的<s:tabele></s:table>标签如何使用
- 怎么将记事本中的内容复制到sqlplus中执行!
- 今天接到四方精创公司面试通知,公司部室很熟悉,有去过面试的吗?能不能通告下有什么题目?
- js 计算时间差的问题 费解中~~~
- 有没有webservice高手,碰到一个困扰了我很久的问题,始终解决不掉
- mybatis高效率批量update
- 我的网站建成了大家看看怎么样..给个评价
- 请教高手class$()是什么函数呀?
- java好用的编辑器
- java开发 用svn 服务器端
[RPC Fault faultString="java.lang.NullPointerException : null" faultCode="Server.Processing" faultDetail="null"]
如果调用一个不请求数据库的方法比如返回一个“aaa”字符串就可以,凡是关联到数据库的方法就会出现这个错误。在Action里面调用请求数据库的方法就可以,有数据返回的。极度痛苦不知道为什么 配置错误?晕
sessionFactory配置了没?
getter setter方法名写对了没?好好检查一下
public class 实体类{}
也许这里可以帮到你http://phenom.javaeye.com/blogs/605601
帮你顶。不知道,你能不能给我一个flex 和Java 连接的例子
可以的话 给我 留个话。。共同学习