Hai to all,
I have developed an application using hibernate,springs,flex in flex
builder for eclipse plug-in.
And my code in the main application is as given below.....
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml" >
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.utils.ObjectUtil;
import mx.messaging.channels.AMFChannel;
import mx.messaging.ChannelSet;
import mx.rpc.events.FaultEvent;
import mx.rpc.remoting.RemoteObject;
private function handleResult(e:ResultEvent):void {
monthlyPayment.text = e.result as String;
}
// Handle a message fault.
private function handleFault(event:FaultEvent):void {
Alert.show(ObjectUtil.toString(event.fault));
}
]]>
</mx:Script>
<mx:ChannelSet id="cset">
<mx:channels>
<mx:AMFChannel id="myamf" uri="
http://localhost:8080/WebContent/
messagebroker/amf"/>
</mx:channels>
</mx:ChannelSet>
<mx:RemoteObject id="ro" destination="mortgageService"
channelSet="{cset}" result="handleResult(event)" fault="handleFault
(event)"/>
<mx:TextInput id="amount"/>
<mx:Button label="Calculate" click="ro.calculate(Number
(amount.text))"/>
<mx:TextInput id="monthlyPayment" text="{ro.calculate.lastResult}"/>
</mx:Application>
And in applicationcontext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
default-lazy-init="true">
<bean id="rateFinderBean"
class="flex.samples.spring.mortgage.SimpleRateFinder"/>
<bean id="mortgageBean"
class="flex.samples.spring.mortgage.Mortgage">
<property name="rateFinder" ref="rateFinderBean"/>
</bean>
</beans>
So when i run the application and when i click the button it is giving
the following exception
(mx.rpc::Fault)#0
content = (Object)#1
errorID = 0
faultCode = "Client.Error.MessageSend"
faultDetail = "Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 404: url: '
http://localhost:
8080/WebContent/messagebroker/amf'"
faultString = "Send failed"
message = "faultCode:Client.Error.MessageSend faultString:'Send
failed' faultDetail:'Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 404: url: '
http://localhost:
8080/WebContent/messagebroker/amf''"
name = "Error"
rootCause = (mx.messaging.events::ChannelFaultEvent)#2
bubbles = false
cancelable = false
channel = (mx.messaging.channels::AMFChannel)#3
authenticated = false
channelSets = (Array)#4
[0] (mx.messaging::ChannelSet)#5
authenticated = false
channelIds = (Array)#6
[0] "my-amf"
channels = (Array)#7
[0] (mx.messaging.channels::AMFChannel)#3
clustered = false
connected = false
currentChannel = (mx.messaging.channels::AMFChannel)#3
initialDestinationId = (null)
messageAgents = (Array)#8
[0] (mx.rpc::AsyncReq
........
I am unable solve this problem .
Please help me in this.
Thanking you ,