Highlighted

Unable to get simple DataService to work

benwgemex

29-07-2008

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\enterprise_c...

at
DataListRequestResponder/fault()[C:\depot\flex\branches\enterprise_corfu_rc\frameworks\projects\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\messaging\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



Replies

Highlighted

benwgemex

29-07-2008

In case the JBoss console output is useful, here is the
output from the LCDS classes:



17:44:47,898 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' starting a write.

17:44:47,898 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' finished a write. 33 bytes were

written.

17:44:47,898 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] received
message TCMessage [ Type: MsgCmd, Stream ID:

0]

17:44:48,149 INFO [STDOUT] [LCDS] Deserializing AMF/RTMP
request

Version: 0 "connect"

1.0



(Command method=connect (2) trxId=1.0)

(Object #0)

app = ""

flashVer = "WIN 9,0,124,0"

swfUrl = "
http://localhost:8080/template/FooDataServiceTest-debug/FooDataServiceTest2.swf"

tcUrl = "rtmp://localhost:2038"

fpad = false

capabilities = 15.0

audioCodecs = 1639.0

videoCodecs = 252.0

videoFunction = 1.0

pageUrl = "
http://localhost:8080/template/FooDataServiceTest-debug/FooDataServiceTest2.html"

objectEncoding = 3.0

false

"nil"

""

(Typed Object #1 'flex.messaging.messages.CommandMessage')

operation = 5.0

correlationId = ""

body = (Object #2)

messageId = "3ACAC242-854B-7040-EEFB-70FEB89ED9F9"

clientId = null

destination = ""

timeToLive = 0.0

headers = (Object #3)

DSMessagingVersion = 1.0

DSId = "my-rtmp"

timestamp = 0.0

17:44:48,149 INFO [STDOUT] [LCDS] Received command: TCCommand
[ Cmd: 2, MethodName: connect, TrxID: 1.0]

17:44:48,209 INFO [STDOUT] [LCDS] Serializing AMF/RTMP
response

Version: 0

(Command method=_result (0) trxId=1)

(Object #0)

id = "FEDDF1EB-990B-626C-FBA1-24DBDF9563FC"

objectEncoding = 3.0

level = "status"

details = null

description = "Connection succeeded."

DSMessagingVersion = 1.0

code = "NetConnection.Connect.Success"

17:44:48,209 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] registering
write interest for Connection '20633739'.



17:44:48,209 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1,5,jboss] unregistering write
interest for Connection '20633739'.

17:44:48,209 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' starting a write.

17:44:48,209 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' finished a write. 235 bytes wer

e written.

17:44:48,209 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] registering
read interest for Connection '20633739'.

17:44:48,219 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] Connection
'20633739' finished a read. 2226 bytes wer

e read.

17:44:48,229 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1,5,jboss] unregistering read
interest for Connection '20633739'.

17:44:48,229 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] Connection
'20633739' starting a read.

17:44:48,229 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] received
message TCMessage [ Type: MsgCmdEx, Stream I

😧 0]

17:44:48,239 INFO [STDOUT] [LCDS] Deserializing AMF/RTMP
request

Version: 3 null

2.0



(Command method=null (0) trxId=2.0)

null

(Typed Object #0 'flex.messaging.messages.CommandMessage')

operation = 5

correlationId = ""

body = (Object #1)

messageId = "E4D9CF52-2AD1-6A5F-E895-70FEBFDBE7B2"

clientId = null

destination = "fooAssembler"

timeToLive = 0

headers = (Object #2)

DSEndpoint = "my-rtmp"

DSId = "FEDDF1EB-990B-626C-FBA1-24DBDF9563FC"

timestamp = 0

17:44:48,239 INFO [STDOUT] [LCDS] Received command: TCCommand
[ Cmd: 0, MethodName: null, TrxID: 2.0]

17:44:48,249 INFO [STDOUT] [LCDS] Serializing AMF/RTMP
response

Version: 3

(Command method=_result (0) trxId=2.0)

(Externalizable Object #0 'DSK')

true

(Object #1)

DSMessagingVersion = 1.0

DSId = "FEDDF1EB-990B-626C-FBA1-24DBDF9563FC"

1.217371488239E12

(Byte Array #2, Length 16)

(Byte Array #3, Length 16)

(Byte Array #4, Length 16)

17:44:48,249 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] registering
write interest for Connection '20633739'.



17:44:48,249 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1,5,jboss] unregistering write
interest for Connection '20633739'.

17:44:48,249 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] received
message TCMessage [ Type: MsgCmdEx, Stream I

😧 0]

17:44:48,249 INFO [STDOUT] [LCDS] Deserializing AMF/RTMP
request

Version: 3 null

3.0



(Command method=null (0) trxId=3.0)

null

(Externalizable Object #0
'flex.data.messages.DataMessageExt')

"fooAssembler"

(Object #1)

DSEndpoint = "my-rtmp"

DSId = "FEDDF1EB-990B-626C-FBA1-24DBDF9563FC"

(Byte Array #2, Length 16)

(Byte Array #3, Length 16)

""

(Object #4)

id = 2

2

17:44:48,279 INFO [STDOUT] [LCDS] Received command: TCCommand
[ Cmd: 0, MethodName: null, TrxID: 3.0]

17:44:48,249 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' starting a write.

17:44:48,279 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-Reactor1Writer,5,jboss] Connection
'20633739' finished a write. 183 bytes wer

e written.

17:44:48,389 INFO [STDOUT] [LCDS] Committed transaction

17:44:48,409 INFO [STDOUT] [LCDS] Serializing AMF/RTMP
response

Version: 3

(Command method=_error (0) trxId=3.0)

(Typed Object #0 'flex.messaging.messages.ErrorMessage')

headers = (Object #1)

rootCause = null

body = null

correlationId = "2074DF18-D2EA-03D2-6E54-70FEB8948E49"

faultDetail = null

faultString = "There was an unhandled failure on the server.
null"

clientId = "F0223A68-BD80-ED4B-1390-70FEB1B1128E"

timeToLive = 0.0

destination = "fooAssembler"

timestamp = 1.217371488399E12

extendedData = null

faultCode = "Server.Processing"

messageId = "FEDDF41D-1F0A-A0D7-9DED-D7D7AB39AF51"

17:44:48,409 INFO [STDOUT] [LCDS]
Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] registering
write interest for Connection '20633739'.