atmosphere
  1. atmosphere
  2. ATMOSPHERE-128

Configuration file settings are different for websocket vs. comet use

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Eclipse + Jetty 7.2.2

      Description

      I have my project setup to use websockets currently. I wanted to seamlessly downgrade to comet and so I set my client to use Comet instead of websockets and the server came back with an error....

      09:53:02.640 [qtp9613729-21] WARN o.a.cpr.AsynchronousProcessor - No AtmosphereHandler maps request for /Connect//
      09:53:02.640 [qtp9613729-21] WARN o.a.cpr.AsynchronousProcessor - AtmosphereHandler registered: /Spacewar/Connect
      2011-05-30 09:53:02.640:WARN::/Spacewar/Connect
      javax.servlet.ServletException: No AtmosphereHandler maps request for /Connect//
      at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:260)
      at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:183)

      I understand the error, I can fix it but it requires a change in my server side configuration files. Websockets work just fine (asside from the bugs I reported earlier).

      My server side configurations are as follows:

      atmosphere.xml:

      web.xml:
      <!-- ATMOSPHERE CONFIGURATION SECTION -->

      spacewar.SWServer

      AtmosphereServlet
      AtmosphereServlet
      org.atmosphere.cpr.AtmosphereServlet
      <!-- Uncomment if you want to use Servlet 2.5 Async Support
      true
      -->

      org.atmosphere.useWebSocket
      true

      0

      AtmosphereServlet
      /Connect

      <!-- END OF ATMOSPHERE CONFIG -->

        Activity

        Hide
        Emperorlou added a comment - - edited

        Yuck my config files didn't come out right...

        Here they are again...

        atmosphere.xml:

        <atmosphere-handlers>
            <atmosphere-handler context-root="/Spacewar/Connect" class-name="org.atmosphere.gameFramework.GameFrameworkAtmosphereHandler">
            </atmosphere-handler>
        </atmosphere-handlers>
        

        web.xml

            <!-- ATMOSPHERE CONFIGURATION SECTION -->
            <listener>
                <listener-class>spacewar.SWServer</listener-class>
            </listener>
            <servlet>
                <description>AtmosphereServlet</description>
                <servlet-name>AtmosphereServlet</servlet-name>
                <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
                <!-- Uncomment if you want to use Servlet 2.5 Async Support 
                <async-supported>true</async-supported>
                <init-param>
                    <param-name>org.atmosphere.useWebSocket</param-name>
                    <param-value>true</param-value>
                </init-param>
                -->
                <load-on-startup>0</load-on-startup>
            </servlet>
            <servlet-mapping>
                <servlet-name>AtmosphereServlet</servlet-name>
                <url-pattern>/Connect</url-pattern>
            </servlet-mapping>
            <!-- END OF ATMOSPHERE CONFIG -->
        
        Show
        Emperorlou added a comment - - edited Yuck my config files didn't come out right... Here they are again... atmosphere.xml: <atmosphere-handlers> <atmosphere-handler context-root= "/Spacewar/Connect" class-name= "org.atmosphere.gameFramework.GameFrameworkAtmosphereHandler" > </atmosphere-handler> </atmosphere-handlers> web.xml <!-- ATMOSPHERE CONFIGURATION SECTION --> <listener> <listener-class>spacewar.SWServer</listener-class> </listener> <servlet> <description>AtmosphereServlet</description> <servlet-name>AtmosphereServlet</servlet-name> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> <!-- Uncomment if you want to use Servlet 2.5 Async Support <async-supported> true </async-supported> <init-param> <param-name>org.atmosphere.useWebSocket</param-name> <param-value> true </param-value> </init-param> --> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AtmosphereServlet</servlet-name> <url-pattern>/Connect</url-pattern> </servlet-mapping> <!-- END OF ATMOSPHERE CONFIG -->
        Hide
        Emperorlou added a comment -

        If I change my atmosphere.xml file by removing the /Spacewar from the "/Spacewar/Comet" value, comet works but Websockets don't. When I try running websockets with this change, I get the following error:

        10:09:56.718 [qtp1947116-26] INFO org.atmosphere.cpr.AtmosphereServlet - WebSocket upgrade requested
        10:09:56.765 [qtp1947116-26] INFO o.atmosphere.cpr.WebSocketProcessor - Atmosphere detected WebSocketSupport: org.atmosphere.websocket.JettyWebSocketSupport
        10:09:56.781 [qtp1947116-26] DEBUG o.a.cpr.AsynchronousProcessor - (suspend) invoked:
        HttpServletRequest: org.atmosphere.cpr.AtmosphereServlet$JettyRequestFix@7ee46a
        HttpServletResponse: org.atmosphere.websocket.WebSocketHttpServletResponse@c62c07
        10:09:56.781 [qtp1947116-26] WARN o.a.cpr.AsynchronousProcessor - No AtmosphereHandler maps request for /Spacewar/Connect/*
        10:09:56.781 [qtp1947116-26] WARN o.a.cpr.AsynchronousProcessor - AtmosphereHandler registered: /Connect
        10:09:56.843 [qtp1947116-26] INFO o.atmosphere.cpr.WebSocketProcessor - failed invoking atmosphere servlet doCometSupport()
        javax.servlet.ServletException: No AtmosphereHandler maps request for /Spacewar/Connect/*
        at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:260) ~[atmosphere-runtime-0.7.1.jar:0.7.1]
        at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:183) ~[atmosphere-runtime-0.7.1.jar:0.7.1]

        Show
        Emperorlou added a comment - If I change my atmosphere.xml file by removing the /Spacewar from the "/Spacewar/Comet" value, comet works but Websockets don't. When I try running websockets with this change, I get the following error: 10:09:56.718 [qtp1947116-26] INFO org.atmosphere.cpr.AtmosphereServlet - WebSocket upgrade requested 10:09:56.765 [qtp1947116-26] INFO o.atmosphere.cpr.WebSocketProcessor - Atmosphere detected WebSocketSupport: org.atmosphere.websocket.JettyWebSocketSupport 10:09:56.781 [qtp1947116-26] DEBUG o.a.cpr.AsynchronousProcessor - (suspend) invoked: HttpServletRequest: org.atmosphere.cpr.AtmosphereServlet$JettyRequestFix@7ee46a HttpServletResponse: org.atmosphere.websocket.WebSocketHttpServletResponse@c62c07 10:09:56.781 [qtp1947116-26] WARN o.a.cpr.AsynchronousProcessor - No AtmosphereHandler maps request for /Spacewar/Connect/* 10:09:56.781 [qtp1947116-26] WARN o.a.cpr.AsynchronousProcessor - AtmosphereHandler registered: /Connect 10:09:56.843 [qtp1947116-26] INFO o.atmosphere.cpr.WebSocketProcessor - failed invoking atmosphere servlet doCometSupport() javax.servlet.ServletException: No AtmosphereHandler maps request for /Spacewar/Connect/* at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:260) ~ [atmosphere-runtime-0.7.1.jar:0.7.1] at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:183) ~ [atmosphere-runtime-0.7.1.jar:0.7.1]
        Hide
        jfarcand added a comment -

        Fixed in Atmosphere 0.8

        Show
        jfarcand added a comment - Fixed in Atmosphere 0.8

          People

          • Assignee:
            Unassigned
            Reporter:
            Emperorlou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: