1 Reply Latest reply on Mar 9, 2008 10:53 PM by SujitG

    Destination does not exist (help please)

    GNice99
      Background:
      - Using Flex Builder 3 plugin for Eclipse
      - Downloaded latest BlazeDS release build
      - Running Tomcat 6.0.16
      =======
      First I want to note the samples that come with BlazeDS run absolutely fine.

      So I created a new project in Flex Builder 3. I'm just trying to get something simple working at first so my one mxml file is as follows (I stripped out everything except the code in question):

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:RemoteObject id="ro" destination="enrollmentService"/>

      <mx:DataGrid dataProvider="{ro.getEnrollmentList.lastResult}" width="100%" height="100%"/>

      <mx:Button label="Get Data" click="ro.getEnrollmentList()"/>
      </mx:Application>
      =====
      I created and EnrollmentService class and I'm sure it's getting compiled to WEB-INF/class...I see .class file there.

      I added the flex folder to the WEB-INF folder. My remoting-config.xml is as follows (because of problems I specified a default and repeated it to be sure):
      <?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>

      <destination id="enrollmentService">
      <properties>
      <source>test.service.EnrollmentService</source>
      </properties>

      <channels>
      <channel ref="my-amf"/>
      </channels>
      </destination>

      </service>

      My services-config has the following channel defined:

      <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>
      <polling-enabled>false</polling-enabled>
      </properties>
      </channel-definition>

      My web.xml is a follows:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
      <display-name>RemoteTest</display-name>


      <context-param>
      <param-name>flex.class.path</param-name>
      <param-value>/WEB-INF/flex/hotfixes</param-value>
      </context-param>

      <!-- Http Flex Session attribute and binding listener support -->
      <listener>
      <listener-class>flex.messaging.HttpFlexSession</listener-class>
      </listener>

      <!-- 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>

      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      </welcome-file-list>

      </web-app>
      ====

      So I start Tomcat from Eclipse and run the app by clicking the Run button in Eclipse. The app comes up fine, but when I press the "Get Data" button. I get the error message below. For the life of me I don't understand why. I clearly have a default channel AND I have specified a channel. This is so frustrating...any help would be greatly appreciate.

      ====
      [RPC Fault faultString="[MessagingError message='Destination 'enrollmentService' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'enrollmentService'"]
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\AbstractInvoker.as:257
      at mx.rpc.remoting.mxml::Operation/ http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\remoting\mxml\Operation.as:197
      at mx.rpc.remoting::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\remotin g\Operation.as:113]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.rpc.remoting.mxml::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\re moting\mxml\Operation.as:170]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.rpc::AbstractService/ http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[E:\dev\3.0.x\frameworks \projects\rpc\src\mx\rpc\AbstractService.as:285
      at FlexJ2EE_test/___FlexJ2EE_test_Button1_click()[C:\Prj\workspace\RemoteTest\flex_src\Remot eTest.mxml:36]
        • 1. Re: Destination does not exist (help please)
          SujitG Level 2
          While creating a Flex project using Flex builder, did you select the server type for your project? If you did not select a server type for your flex project, did you configure your compiler to include your services-config.xml using the -services argument?
          In your project's compiler settings, add -services "configurationfiles/services-config.xml" argument to the compiler arguments. The path should point to your services-config.xml.
          If the above mentioned steps were completed and still your facing problem, can you please try running "clean" on your project.
          Hope this helps.