Expand my Community achievements bar.

what's MessageAgent's destination

Avatar

Level 1
Hi,

i am trying to make the remoteobject work on my mxml. but i
got this error



[RPC Fault faultString="[MessagingError message='The
MessageAgent's destination must be set to send messages.']"
faultCode="InvokeFailed" faultDetail="Couldn't establish a
connection to ''"]

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::invoke()

at mx.rpc.remoting.mxml::Operation/
http://www.adobe.com/2006/flex/mx/internal::invoke()

at mx.rpc.remoting::Operation/send()

at Function/
http://adobe.com/AS3/2006/builtin::apply()

at mx.rpc.remoting.mxml::Operation/send()

at Function/
http://adobe.com/AS3/2006/builtin::apply()

at mx.rpc::AbstractService/
http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()

at RALogging1/___Button1_click()



this is the part of my mxml and the error pops up when the
button is clicked. i have a javaclass "LogManager" under
WEB-INF\classes\ra\logging. so i think i need to do something on
some config xml. what do i need to do?



ra.logging.LogManager :

<mx:RemoteObject id="logMgr"
source="ra.logging.LogManager"
fault="Alert.show(event.fault.faultString, 'Error');">

<mx:method name="getList"/>

</mx:RemoteObject>



<mx:HBox>

<mx:Button label="Get Log List"
click="logMgr.getList()"/>



</mx:HBox>



1 Reply

Avatar

Level 2
The 'source' attribute is only sufficient when using a
RemoteObject connection to a resource on a ColdFusion server.



Please refer to RemoteObject documention -


http://livedocs.macromedia.com/flex/2/langref/mx/rpc/remoting/mxml/RemoteObject.html



In all other cases, you'll need to define your RemoteObject
destination in the configuration file. The Flex 2 Developer's guide
had information on configuring these files. Examples are also
available at
<fds_install>/resources/config/remoting-config.xml.



In your case, you'll add the following definition to
remoting-config.xml -



<destination id="LogManagerDestination">

<properties>

<source>ra.logging.LogManager</source>

</properties>



The code in your mxml file will look like this -



<mx:RemoteObject id="logMgr"
destination="LogManagerDestination" ... etc>
</mx:RemoteObject>



There will be no 'source' attribute in your RemoteObject
tag.