0 Replies Latest reply on Jan 14, 2014 2:05 PM by Cbradsh1

    Flex AMF Data/Services Error

    Cbradsh1

      After stumbling my way through setting up a BlazeDS service, I was finally able to get the list of services through the Flex Builder Data/Services Wizzard.  However when testing any of the services, I get the Error popup of

       

      "InvocationTargetException:There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.

      Reason: java.io.FileNotFoundException: http://localhost:8080/portlets-0.0.1-SNAPSHOT/messagebroker/amf
      "

       

      I could not find anyone else with a similiar issue, and am unfamiliar with services setup. Below are my configurations.  Any help would be greatly appreciated. 

       

      Thank you.

       

      services-config.xml:

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

      <services-config>

                <services>

                          <service id="remoting-service" class="flex.messaging.services.RemotingService">

                                    <adapters>

                                              <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>

                                    </adapters>

                                    <default-channels>

                                              <channel ref="my-amf"/>

                                    </default-channels>

                          </service>

                </services>

       

       

                <channels>

                          <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">

                                    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>

                                    <properties>

                                              <add-no-cache-headers>false</add-no-cache-headers>

                                              <polling-enabled>false</polling-enabled>

                                    </properties>

                          </channel-definition>

                </channels>

       

       

                <logging>

                          <!-- You may also use flex.messaging.log.ServletLogTarget -->

                          <target class="flex.messaging.log.ConsoleTarget" level="Error">

                                    <properties>

                                              <prefix>[BlazeDS] </prefix>

                                              <includeDate>false</includeDate>

                                              <includeTime>false</includeTime>

                                              <includeLevel>true</includeLevel>

                                              <includeCategory>false</includeCategory>

                                    </properties>

                                    <filters>

                                              <pattern>Endpoint.</pattern>

                                              <pattern>Service.</pattern>

                                              <pattern>Configuration</pattern>

                                    </filters>

                          </target>

                </logging>

       

       

      </services-config>

       

       

      messaging-config.xml:

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

      <service id="message-service" class="flex.messaging.services.MessageService">

       

       

                <adapters>

                          <adapter-definition id="actionscript"

                                    class="flex.messaging.services.messaging.adapters.ActionScriptAdapter"

                                    default="true" />

                </adapters>

       

                <default-channels>

                          <channel ref="my-amf" />

                </default-channels>

       

       

      </service>

      remoting-config.xml:

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

      <service id="remoting-service"

          class="flex.messaging.services.RemotingService">

       

       

          <adapters>

              <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>

          </adapters>

       

       

          <default-channels>

              <channel ref="my-amf"/>

          </default-channels>

       

       

      </service>

       

      flex-spring-application-context.xml:

      <?xml version="1.0"?>

       

       

      <beans xmlns="http://www.springframework.org/schema/beans"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns:context="http://www.springframework.org/schema/context"

      xmlns:tx="http://www.springframework.org/schema/tx"

      xmlns:p="http://www.springframework.org/schema/p"

      xmlns:aop="http://www.springframework.org/schema/aop"

      xmlns:jee="http://www.springframework.org/schema/jee"

      xmlns:flex="http://www.springframework.org/schema/flex"

      xsi:schemaLocation="http://www.springframework.org/schema/jee     

                http://www.springframework.org/schema/jee/spring-jee-3.0.xsd     

                http://www.springframework.org/schema/beans     

                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  

                http://www.springframework.org/schema/context     

                http://www.springframework.org/schema/context/spring-context-3.0.xsd  

                http://www.springframework.org/schema/tx     

                http://www.springframework.org/schema/tx/spring-tx-3.0.xsd       

                http://www.springframework.org/schema/aop      

                http://www.springframework.org/schema/aop/spring-aop-3.0.xsd      

                http://www.springframework.org/schema/flex        

                http://www.springframework.org/schema/flex/spring-flex-1.5.xsd">

       

       

      <context:annotation-config />

      <context:component-scan base-package="org.amc" />

      <flex:message-broker services-config-path="/WEB-INF/flex/services-config.xml"/>   

       

       

      </beans>

       

      Service Class:

      package org.amc;

       

       

      import org.springframework.flex.remoting.RemotingDestination;

      import org.springframework.flex.remoting.RemotingInclude;

      import org.springframework.stereotype.Service;

       

       

      @Service("FlexLifeFacadeAnnotation")

      @RemotingDestination(channels={"my-amf"})

      public class FlexLifeFacade {

       

                @RemotingInclude

                public String echo(String msg) {

                          return "Message received at " + new java.util.Date() + ": " + msg;

                }

      }