5 Replies Latest reply on Apr 10, 2009 6:05 AM by Valdhor1

    Error in Getting Response From Server

    chaudharyamardeep

      hi all

      i am getting an error when i called a remote method of java class using flex blazeds the error is as---

      Fault Received[FaultEvent fault=[RPC Fault faultString="[MessagingError message='Destination 'loginService' 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 'loginService'"] messageId="19CAC60C-F8A8-E6D5-7C4E-7DEE518934ED" type="fault" bubbles=false cancelable=true eventPhase=2]

       

       

       

      Below i am pasting my source files as----

       

      public class SecureLoginBD extends BaseDelegate {
         
          public SecureLoginBD() throws Exception {
              super();
             
          }

       

          public boolean checkLogin(String userName,String password ) throws ALMSServiceProviderException {
              boolean result = false;
              System.out.println("Inside The BD @@@@@@@@@@@@@@");
              ALMSServiceProvider testLocator = getServiceLocator();        
              UserRemote userRemote = (UserRemote)testLocator.getProxyRemote("UserRemoteImplementation/remote",UserRemote.class );
              result =  userRemote.isAuthenticationPassed(userName, password);
                     
              return result;
          }}

       

      Remote -congig file is as--

      <?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="loginService">
      <properties>
      <source>org.techsystems.alms.ejb.businessdeligate.common.SecureLoginBD</source>
      </properties>
      </destination>

       

      </service>

        • 1. Re: Error in Getting Response From Server

          A couple of things...

           

          1.  What does your services-config.xml file look like?

           

          2. Do your Flex compiler arguments point to services-config.xml?

          • 2. Re: Error in Getting Response From Server
            chaudharyamardeep Level 1

            My Service-config.xml is looking like tghis

             

             

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

             

                <services>
                    <service-include file-path="remoting-config.xml" />
                    <service-include file-path="proxy-config.xml" />
                    <service-include file-path="messaging-config.xml" />       
                </services>

             

                <security>
                    <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
                    <!-- Uncomment the correct app server
                    <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss">
                    <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>       
                    <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
                    <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
                    -->

             

                    <!--
                    <security-constraint id="basic-read-access">
                        <auth-method>Basic</auth-method>
                        <roles>
                            <role>guests</role>
                            <role>accountants</role>
                            <role>employees</role>
                            <role>managers</role>
                        </roles>
                    </security-constraint>
                     -->
                </security>

             

                <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"/>
                    </channel-definition>

             

                    <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
                        <properties>
                            <add-no-cache-headers>false</add-no-cache-headers>
                        </properties>
                    </channel-definition>

             

                    <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
                        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                        <properties>
                            <polling-enabled>true</polling-enabled>
                            <polling-interval-seconds>4</polling-interval-seconds>
                        </properties>
                    </channel-definition>

             

                    <!--
                    <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
                        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
                    </channel-definition>

             

                    <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
                        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
                        <properties>
                            <add-no-cache-headers>false</add-no-cache-headers>
                        </properties>
                    </channel-definition>
                    -->
                </channels>

             

                <logging>
                    <target class="flex.messaging.log.ConsoleTarget" level="Error">
                        <properties>
                            <prefix>[BlazeDS] </prefix>
                            <includeDate>false</includeDate>
                            <includeTime>false</includeTime>
                            <includeLevel>false</includeLevel>
                            <includeCategory>false</includeCategory>
                        </properties>
                        <filters>
                            <pattern>Endpoint.*</pattern>
                            <pattern>Service.*</pattern>
                            <pattern>Configuration</pattern>
                        </filters>
                    </target>
                </logging>

             

                <system>
                    <redeploy>
                        <enabled>false</enabled>
                        <!--
                        <watch-interval>20</watch-interval>
                        <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
                        <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
                        <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
                        <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
                        <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
                        <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
                         -->
                    </redeploy>
                </system>

             

            </services-config>

            • 3. Re: Error in Getting Response From Server
              Level 1

              Your remoting-config.xml has your default channels set to "my-amf" and your "my-amf" endpoint seems to be set up OK in your services-config.xml so Flex should be able to find it ok.

               

              What are the Additional Compiler Arguments set to? (Project->Properties->Flex Compiler)

              • 4. Re: Error in Getting Response From Server
                chaudharyamardeep Level 1

                The Compiler Arguments are like this----

                 

                -services "D:/TechSystems/ALMS/WebContent/WEB-INF/flex/services-config.xml" -locale en_US

                • 5. Re: Error in Getting Response From Server
                  Level 1

                  Well, everything looks fine. About the only suggestion I have is clean the project.