1 Reply Latest reply on May 5, 2009 5:14 AM by Ghe1982

    [Beginner Question] Problem configuring channels

    Ghe1982

      Hi,

      I am completely new to AdobeFlex3 and I am trying some simple test invoking java classes.

       

      I started from the BlazeDSTurnkey and Flex3 Builder, and I ran succesfully some of the examples.

       

      To make my own tests, I created a new project called "ematest", configured in the folder "C:\BlazeDS\tomcat\webapps\ematest" with FlexBuilder.

       

      I created a simple button that invokes my java class on click and I encounter this problem:

      when I click the button, I get this error:

       

      [CODE]

       

      [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://127.0.0.1:8400/ematest/messagebroker/amf'"]

      at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\p rojects\rpc\src\mx\rpc\AbstractInvoker.as:220]

      at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder .as:53]

      at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:103]

      at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\messaging\ChannelSet.as:1482]

      at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc \src\mx\messaging\ChannelSet.as:975]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\m essaging\Channel.as:997]

      at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3.2.0\frameworks\proje cts\rpc\src\mx\messaging\channels\PollingChannel.as:354]

      at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.2.0\frameworks\projects\ rpc\src\mx\messaging\channels\AMFChannel.as:390]

      [/CODE]

       

      In fact I think it is something related to the channel configuration, but I just copied the "Test Drive Sample 3" configuration files (changing only the "remote-config.xml" to point my java class), so the channel configurations aren't changed.

       

      Can someone help me ?

       

      Thanks.

        • 1. Re: [Beginner Question] Problem configuring channels
          Ghe1982 Level 1

          Ok,

          I solved the problem and I am posting here the solution.

           

          I missed the configuration of the "messagebroker servlet" in the web.xml file.

           

          Adding this:

           

              <!-- MessageBroker Servlet -->

              <servlet>

                  <servlet-name>MessageBrokerServlet</servlet-name>

                  <display-name>MessageBrokerServlet</display-name>

                  <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>

                  <init-param>

                      <param-name>services.configuration.file</param-name>

                      <param-value>/WEB-INF/flex/services-config.xml</param-value>

                  </init-param>

                  <load-on-startup>1</load-on-startup>

              </servlet>

              <servlet-mapping>

                  <servlet-name>MessageBrokerServlet</servlet-name>

                  <url-pattern>/messagebroker/*</url-pattern>

              </servlet-mapping>

          To the web.xml file will solve the problem.