3 Replies Latest reply on Nov 14, 2006 10:29 AM by ciwee_ufrj

    Problems with DataService

      Hi all,
      I tried to make the most simple program I could imagine and didnt work! :(
      I'll describe the steps I took here and you guys try to figure what's wrong OK? thank you!:

      The index.mxml is as follows:

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:DataService id="ds" destination="users"/>
      <mx:ArrayCollection id="usersCollection"/>
      <mx:DataGrid id="dg" dataProvider="{usersCollection}" editable="false">
      <mx:DataGridColumn dataField="name" headerText="User Name"/>
      <mx:Button label="Get Data" click="ds.fill(usersCollection)"/>

      this code should just show a single-column list of users

      Now the server-side configuration:

      The destination:

      <destination id="users">
      <adapter ref="java-dao" />
      <identity property="name"/>
      <paging enabled="true" pageSize="10" />
      <throttle-inbound policy="ERROR" max-frequency="500"/>
      <throttle-outbound policy="REPLACE" max-frequency="500"/>

      I asure that the adapter existis and the rmtp channel is configured

      Now the Java code, Im in doubt of the folder hierarchy... so I'll put the one I used here

      my application is inside flex directory in default server so the classes go here

      I created a package chat as I described in the destination and put 2 files within it

      User.class as follows

      package chat;

      public class User {
      private String name;

      User(String name){
      this.name = name;

      public void setName(String name){
      this.name = name;

      public String getName(){
      return name;

      and UserAssembler as follows

      package chat;

      import java.util.ArrayList;
      import java.util.List;

      public class UsersAssembler {
      public List loadUsers(){
      ArrayList myList = new ArrayList();
      myList.add(new User("Andre"));
      myList.add(new User("Japa"));
      myList.add(new User("Flay"));
      return myList;

      public void syncUsers(){

      I didnt define sync method because I didnt use it in the application

      I wrote this useless simple application just to test, but when I press the button to fill my ArrayCollection no data is retrieved..

      The error I get is:

      [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error null"]
      at mx.data::ConcreteDataService/ http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent()
      at ::DataListRequestResponder/fault()
      at mx.rpc::AsyncRequest/fault()
      at mx.messaging::ChannelSet/::faultPendingSends()
      at mx.messaging::ChannelSet/channelFaultHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
      at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed ()
      at mx.messaging.channels::RTMPChannel/mx.messaging.channels:RTMPChannel::statusHandler()

      The grid shows empty.. anyone knows why???