6 Replies Latest reply on Jan 7, 2008 2:48 PM by tgilmour

    HTTP Status 500 error with SSL

    Syndrake
      Background: I can browse to http://me.com/flex2gateway/ and receive
      a blank page with no errors. I cannot browse to
      https://me.com/flex2gateway/ - I get an HTTP: Status 500 error. The
      SSL cert is setup correctly on the server (I can browse pages in the
      same site via SSL, and my sample Flex app loads and works until I
      click a button that attempts to load data using remote object with an SSL endpoint).

      Looking in the error log found at C:\CFusionMX7
      \runtime\logs\coldfusion-err.log, I find:

      09/26 12:44:36 error No configured channel has an endpoint
      path '/flex2gateway/'.
      flex.messaging.MessageException: No configured channel has an
      endpoint path '/flex2gateway/'.
      at flex.messaging.MessageBroker.getEndpoint
      (MessageBroker.java:318)
      at flex.messaging.MessageBrokerServlet.service
      (MessageBrokerServlet.java:329)
      at javax.servlet.http.HttpServlet.service
      (HttpServlet.java:853)
      at coldfusion.bootstrap.BootstrapServlet.service
      (BootstrapServlet.java:78)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
      at jrun.servlet.JRunInvokerChain.invokeNext
      (JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke
      (JRunRequestDispatcher.java:257)
      at jrun.servlet.ServletEngineService.dispatch
      (ServletEngineService.java:541)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable
      (JRunProxyService.java:204)
      at
      jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable
      (ThreadPool.java:318)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable
      (ThreadPool.java:426)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable
      (ThreadPool.java:264)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

      When I compile using a services-config file with a channel using port 80, my app works fine. When I compile with a different services-config file with an SSL channel, it fails.

      HTTP channel that works:

      <channels>
      <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
      <endpoint uri=" http://me.com/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
      <properties>
      <polling-enabled>false</polling-enabled>
      <serialization>
      <instantiate-types>false</instantiate-types>
      </serialization>
      </properties>
      </channel-definition>
      </channels>

      SSL Channel defninition that fails:

      <channels>
      <channel-definition id="my-cfamf" class="mx.messaging.channels.SecureAMFChannel">
      <endpoint uri="https://me.com/flex2gateway/" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
      <properties>
      <polling-enabled>false</polling-enabled>
      <serialization>
      <instantiate-types>false</instantiate-types>
      </serialization>
      </properties>
      </channel-definition>
      </channels>

      It seems like something with ColdFusion is not configured properly,
      and I'm not sure what that is. I'm running the latest version of CF
      running on IIS 6 and Windows Server 2003 (latest service packs and
      updates).

      Thoughts welcome!

      Thanks,

      -Tony
        • 1. Re: HTTP Status 500 error with SSL
          knallore_adobe
          Does this happen only on IE or on Firefox as well?

          • 2. Re: HTTP Status 500 error with SSL
            Syndrake Level 1
            It occurs in both IE and Firefox. -tony
            • 3. Re: HTTP Status 500 error with SSL
              knallore_adobe Level 1
              The endpoint URI for the secureAMFchannel definition should be:
              https://me.com/flex2gateway/messagebroker/amfsecure
              • 4. HTTP Status 500 error with SSL
                Peter Farland Level 3
                I just want to restate knallore's poste regarding channel definitions as it is essentially correct, but the issue was that he didn't realize that /flex2gateway was the servlet mapping already (not the context root).

                In general, if you have two channels defined that use the same servlet mapping then the endpoints must be unique from the servlet mapping onwards, so you should add some path info to the endpoint URI to distinguish between the secure and normal AMF channels:

                SecureAMFChannel endpoint:
                https://me.com/flex2gateway/secureamf

                AMFChannel endpoint
                http://me.com/flex2gateway/amf

                Also, in web.xml the servlet mapping must allow for path info... here is what it is in FDS:

                <servlet-mapping>
                <servlet-name>MessageBrokerServlet</servlet-name>
                <url-pattern>/messagebroker/*</url-pattern>
                </servlet-mapping>

                Notice the /* at the end of the servlet mapping pattern. Please check that your equivalent entry for ColdFusion 7.0.2's web.xml (i.e. for /flex2gateway/*) includes the /*.

                Also, as always, please ensure that you don't have a dirty classpath with older versions of CF Mystic and/or beta versions of FDS too.
                • 5. Re: HTTP Status 500 error with SSL
                  Syndrake Level 1
                  Pete,

                  As you mentioned on the Flex Yahoo group:

                  ===
                  Also, can you try adding the following property to your
                  <channel-definition> <properties> section:

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

                  ...restart the server and try again?
                  ===

                  I believe that property corrected my problem - I do not have multiple channels defined; I had removed the non-ssl channel and replaced with one ssl channel. I'm going to try having both channels defined next.

                  Anyway, thanks!

                  -Tony
                  • 6. Re: HTTP Status 500 error with SSL
                    tgilmour
                    Ok, I wrestled with this for a couple days. I had exactly the same error. HTTPS was getting a 500 error, but HTTP was not. Here's the issue: You need to configure both the services-config.xml file in your context root (on your dev server) and the one in the JRUN4 folder on your production box (the one that's https). Both must match up to work. Once you modify this file, restart jrun on your production server and the 500 error will disappear. Recompile your code, and it will find the service. It's a two-ended thing. The services-config file on the server basically starts your flex2gateway jrun servlet. How it communicates to Flex is defined there.

                    c$\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\flex\services-config.xml (production server)

                    <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                    <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
                    </channel-definition>

                    I hope that helps. I developed in a non-ssl environment and moved it to our SSL production server, and everything stopped working. I couldn't find anything to help on the internet either.

                    -Tom