1 Reply Latest reply on Sep 15, 2011 10:17 AM by jstone1111

    flash builder 4 + blazeDS 4.0.0.14931 remoteObject over SSL, spring-blazeds 1.5.0

    jstone1111

      I am trying to use remoteObject over amfsecure channel running on https  with no authentications.  On flash client side, I am using Flash Builder  4 with Flex SDK 4.1. After imported the self-signed certificates into  cacerts in Flash Builder install, I could configure  Window/Preferences/Adobe/RDS Configuration to point to the web app  running on SSL and test connection was successful. When hit on https://mymachine/myApp/messagebroker/amfsecure in browser, my app log file indicated that a request was received.

       

      But  when trying to connect my flash project data/services through BlazeDS, I  got RDS 404 error with reason as Not Found. Flex server is set to https://mymachine/myApp and context root is /myApp.

       

      web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app>  
      
        <!-- Spring security -->
        <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
       
        <!-- Spring configuration -->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                /WEB-INF/spring/*-config.xml
            </param-value>
        </context-param>
        <listener>
             <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>  
       
        <servlet>
               <servlet-name>myApp</servlet-name>
               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
               <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
               <servlet-name>myApp</servlet-name>
               <url-pattern>/messagebroker/*</url-pattern>
        </servlet-mapping>
       
        <servlet>
               <servlet-name>spring-mvc</servlet-name>
               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
               <load-on-startup>1</load-on-startup>
        </servlet>     
        <servlet-mapping>
               <servlet-name>spring-mvc</servlet-name>
               <url-pattern>/spring/*</url-pattern>
        </servlet-mapping> 
        <servlet>
            <servlet-name>RDSDispatchServlet</servlet-name>
            <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
             <init-param>
                 <param-name>useAppserverSecurity</param-name>
                 <param-value>false</param-value>
             </init-param>
             <init-param>
                 <param-name>messageBrokerId</param-name>
                 <param-value>_messageBroker</param-value>
             </init-param> 
             <load-on-startup>10</load-on-startup>
        </servlet>
        <servlet-mapping id="RDS_DISPATCH_MAPPING">
            <servlet-name>RDSDispatchServlet</servlet-name>
            <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
        </servlet-mapping>
       
        <welcome-file-list>
           <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
       
      </web-app>

       

      flex/services-config.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <services-config>
      
          <services>
              <default-channels>
                 <channel ref="my-secure-amf"/>
              </default-channels>
              <service-include file-path="remoting-config.xml" />
          </services>
      
          <channels>
              <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                  <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
              </channel-definition>
          
              <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>
                      <add-no-cache-headers>false</add-no-cache-headers>
                  </properties>
              </channel-definition>
      
              <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                  <endpoint url="https://{server.name}:443/{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="Debug">
                  <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>
       
          <security>
               <security-constraint id="trusted">
                  <roles>
                      <role>ROLE_ANONYMOUS</role>
                      <role>ROLE_USER</role>
                      <role>ROLE_ADMIN</role>
                  </roles>
              </security-constraint>
          </security>
      
          <system>
              <redeploy>
                  <enabled>false</enabled>
              </redeploy>
          </system>
      
      </services-config>

       

      flex/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-secure-amf"/>
          </default-channels>
      
      </service>

       

      Please help! I don't seem to find any working samples for RDS SSL configuration. If there is one, would you please point me to the link?

       

      Thanks in advance!