0 Replies Latest reply on Jun 26, 2008 2:01 PM by BSchow

    Loading Data from a RemoteObject

      So, I'm changing some things in my program, and having some trouble getting things working right again now that it's using BlazeDS. Not sure if this should be in the Data Services forum, but oh well.

      I've got a Java program that makes an object of a class called hourChart. The data fields for this object are a bunch of integers with various names. I have another class that makes a list of instances of this object by pulling data from an SQL table, but requires a Date to be passed in (the SQL function is of the 'select from table where date = ' type). So far so good (I've tested this extensively and am 100% positive that things work so far; I made a test driver that displayed the list and everything was kosher).

      However, it's when I try to call it in Flex that things go wrong. I added an appropriate destination in remoting-config.xml (which I also know works...I've been calling it repeatedly for another function and it works fine). So I've got a RemoteObject tag that uses this destination, let's call it 'ro'. I've got a chart that, when clicked on, passes the Date of the point that was clicked to the Java function. The code for this is ro.getHCharts(event.hitData.item.day);

      Now, obviously I want to use this for something, so I decide to convert it to an ArrayCollection. I've done this before with a different method from the very same class. In Flex I call a function that has the following code: hmAC = ro.getHCharts.lastResult as ArrayCollection; and get this error:


      [RPC Fault faultString="java.lang.NullPointerException" faultCode="Server.Processing" faultDetail="null"] at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\project s\rpc\src\mx\rpc\AbstractInvoker.as:216 at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49 ] 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]

      What gives? I'm calling the second function right after the first...is it possible the first hasn't had time to process all the data? I have no idea.