Hi, I have been trying to get a simple DataService prototype
to work. I am using Flex DS 2.6 (the latest) with JBoss 4.0.3sp1
server. I have a very simple MXML application as follow:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:DataService id="fooService" destination="fooAssembler" result="getAllHandler(event)"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import com.gemex.Foo;
[Bindable]
private var foo:Foo;
private function getAllHandler(event:ResultEvent):void {
foo = event.result as Foo;
}
]]>
</mx:Script>
<mx:TextInput id="fooId"/>
<mx:Button label="Retrieve" click="fooService.getItem({id: int(fooId.text)})"/>
<mx:TextInput id="fooName" text="{foo.name}"/>
</mx:Application>
The server side configuration is as follow:
In data-management-config.xml, I have added the following:
<destination id="fooAssembler">
<adapter ref="java-dao"/>
<properties>
<source>fooAssembler</source>
<factory>spring</factory>
<metadata>
<identity property="id"/>
</metadata>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
</destination>
In data-management-config.xml, I have added the following:
<factories>
<factory id="spring" class="com.gemex.arch.flex.factories.SpringFactory"/>
</factories>
When I run the sample, I get the following message in the browser:
[RPC Fault faultString="There was an unhandled failure on the server. null" faultCode="Server.Processing" faultDetail="null"]
at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent()[C:\depot\flex\branches\en terprise_corfu_rc\frameworks\projects\data\src\mx\data\ConcreteDataService.as:2550
at DataListRequestResponder/fault()[C:\depot\flex\branches\enterprise_corfu_rc\frameworks\pr ojects\data\src\mx\data\ConcreteDataService.as:7349]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at NetConnectionMessageResponder/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx \messaging\channels\NetConnectionChannel.as:523]
at mx.messaging::MessageResponder/status()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messa ging\MessageResponder.as:222]
I also got a bunch of output from the JBoss console, but it is too long to list here. Let me know if that would help. I was able to make a similar example work with the LCDS 2.5. I have been banging my head for over 3 days now. Hope someone has some insight as to what I should try next.
Thanks much,
Ben
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:DataService id="fooService" destination="fooAssembler" result="getAllHandler(event)"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import com.gemex.Foo;
[Bindable]
private var foo:Foo;
private function getAllHandler(event:ResultEvent):void {
foo = event.result as Foo;
}
]]>
</mx:Script>
<mx:TextInput id="fooId"/>
<mx:Button label="Retrieve" click="fooService.getItem({id: int(fooId.text)})"/>
<mx:TextInput id="fooName" text="{foo.name}"/>
</mx:Application>
The server side configuration is as follow:
In data-management-config.xml, I have added the following:
<destination id="fooAssembler">
<adapter ref="java-dao"/>
<properties>
<source>fooAssembler</source>
<factory>spring</factory>
<metadata>
<identity property="id"/>
</metadata>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
</destination>
In data-management-config.xml, I have added the following:
<factories>
<factory id="spring" class="com.gemex.arch.flex.factories.SpringFactory"/>
</factories>
When I run the sample, I get the following message in the browser:
[RPC Fault faultString="There was an unhandled failure on the server. null" faultCode="Server.Processing" faultDetail="null"]
at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent()[C:\depot\flex\branches\en terprise_corfu_rc\frameworks\projects\data\src\mx\data\ConcreteDataService.as:2550
at DataListRequestResponder/fault()[C:\depot\flex\branches\enterprise_corfu_rc\frameworks\pr ojects\data\src\mx\data\ConcreteDataService.as:7349]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at NetConnectionMessageResponder/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx \messaging\channels\NetConnectionChannel.as:523]
at mx.messaging::MessageResponder/status()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messa ging\MessageResponder.as:222]
I also got a bunch of output from the JBoss console, but it is too long to list here. Let me know if that would help. I was able to make a similar example work with the LCDS 2.5. I have been banging my head for over 3 days now. Hope someone has some insight as to what I should try next.
Thanks much,
Ben