Expand my Community achievements bar.

Flex 2 Java Remote Object

Avatar

Level 1
Hi,



I'm new to flex 2 and try to use java remote object. I used
the simpleService given in the default flex app and have a app as
following:



<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"

creationComplete="myRemoteObject.outMethod()">

<mx:RemoteObject id="myRemoteObject"
destination="simpleService" showBusyCursor="true"/>

</mx:Application>



It raised the following exception when running it:

[RPC Fault faultString="[MessagingError message='Unknown
destination 'simpleService'.']" faultCode="InvokeFailed"
faultDetail="Couldn't establish a connection to 'simpleService'"]

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 roRPCJava/___Application1_creationComplete()

at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.core::UIComponent/set initialized()

at mx.managers::LayoutManager/::doPhasedInstantiation()

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

at mx.core::UIComponent/::callLaterDispatcher2()

at mx.core::UIComponent/::callLaterDispatcher()



I checked the remoting-config.xml, it has the proper
destination configured and also saw the data server displays the
SimpleService was passed upon startup.



Any clue what could be missing?



Thanks in advance for any help.
3 Replies

Avatar

Level 3
Hi



Can you check your services-config.xml have this if your
destination is included in remoting-config.xml



<service-include
file-path="remoting-config.xml"></service-include>



Thanks.



William Chan

Avatar

Level 1
Yes, I have this line in the service-config.xml file. By the
way, I was trying to run the code in Flex 2 Builder and have the
settings done for the default server. Is it the correct way to test
newly developed code?



Thanks,

Yuxin

Avatar

Level 3
HI



I use the server to compile the mxml to make sure services
and the mxml in sync.



William