Announcement Announcement Module
Collapse
No announcement yet.
Configuring the flex app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I had configured the Flex-Spring-BlazeDS using the SpringFactory using

    <factories>
    <factory id="spring" class="flex.samples.factories.SpringFactory"/>
    </factories>

    Now i wanted to try the Spring BlazeDS Integration 1.0.0.M1. I changed my configuration similar to how it was suggested in the BlazeDS sample. Initially i got the same error as everybody else.

    ----------------------------------------------------------------------
    No destination 'distributorService' found or channel not defined.
    ----------------------------------------------------------------------

    <bean id="distributorService" class="com.csc.zyxyz.businesslogic.services.Distri butorServiceImpl"/>

    <!-- Expose the distributorService bean for BlazeDS remoting -->
    <bean id="distributor" class="org.springframework.flex.messaging.remoting .FlexRemotingServiceExporter">
    <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
    <property name="service" ref="distributorService"/>
    </bean>

    Insted for passing "distributor" to the RemoteService, i was passing the distributorService

    /**
    * Constructor
    */
    public function DistributorService() {
    super("distributor", "distributor");
    }

    Instead i had misconfigured

    /**
    * Constructor
    */
    public function DistributorService() {
    super("distributorService", "distributorService");
    }

    Once i corrected it, all was fine.

    I am looking forward for the REST implementation and how easy it will be to change from AMF to REST or even JSON if requried.

    Does anybody know of a AMF viewer so i can test the response before consuming it as the flex end?.

    Great job

    Thank you
    Prashanth Sukumaran

    Comment


    • #17
      same probleme

      Hi !


      I'm also newbeez in flex blazeds spring and i have the same problem.

      message='Destination 'testService' either does not exist or the destination has no channels defined


      How can i solve this probleme, i read this topic but i don't understand how to correct this problem

      what do you mean with
      Code:
      Insted for passing "distributor" to the RemoteService, i was passing the distributorService
      ?

      can anybody give me some information ?

      thanks !

      sorry for my bad english ,i'm french

      Comment


      • #18
        Here's a simple recipe. In the BlazeDS, define the appropriate channel. Then in the application, pass in a channel set which points to the specific channel of interest.


        [flex/services-config.xml]

        ...
        <channels>

        <channel-definition id="my-amf"
        class="mx.messaging.channels.AMFChannel">
        <endpoint url="http://example.com:8080/appName/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        <properties>
        <polling-enabled>false</polling-enabled>
        </properties>
        </channel-definition>
        ...

        [BasicApp.mxml]

        <mx:Script><![CDATA[
        import mx.messaging.ChannelSet;
        import mx.messaging.channels.AMFChannel;

        // Define a ChannelSet object.
        private var cs:ChannelSet;

        private function createChannelSet():ChannelSet {
        if (cs == null) {
        cs = new ChannelSet();
        var ac:AMFChannel = new AMFChannel("my-AMF","http://example.com:8080/appName/messagebroker/amf");
        cs.addChannel(ac);
        }
        return cs;
        }
        ]]></mx:Script>

        ....

        <mx:RemoteObject id="ro" destination="specimen" channelSet="{createChannelSet()}"/>

        Comment


        • #19
          Thanks jcarter, it worked like a charm

          I guess that the reason of this error is that the swf file is trying to access the remote service at hostort/context/messagebroker/amf, whereas the actual address should rather be hostort/context/dipatcherServletMapping/messagebroker/amf.

          Still, this solution is not perfect as the host and port are harde coded in the compiled swf file

          Comment


          • #20
            am I missing something?

            Why aren't you guys doing it like the examples that show you doing the configuration in xml? http://forum.springframework.org/showthread.php?t=66542

            BTW, the Spring Factory is NOT the same thing, but I think/hope you realize that.

            Comment


            • #21
              I am having similar problems with my application. Client doesn`t find it`s destination, although it has been configured correctly. I do not create channels programmatically.

              Is this issue a known bug or just a lack of configuration dokumentation in SpringBlazeDS reference? I don`t think it`s some wrong configuration in my code. For some reason, the client just does not find it`s destination.

              Or should I always define programmatically channelsets? Is this the only solution?

              Comment


              • #22
                As far as I know, explicit creation of the ChannelSet is necessary in M1. The comments from bh5k suggest an XML route, but even Christophe Coenraets AIR example follows this approach.

                It looks like one of the issues for M2 could fix this.

                Comment

                Working...
                X