Announcement Announcement Module
Collapse
No announcement yet.
Setup problem: can't connect, two warnings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setup problem: can't connect, two warnings

    Could someone help me to get started?

    I am setting up BlazeDS using Spring BlazeDS Integration and I can't connect to the server. When I launch webapp I see the following warnings:

    [BlazeDS]No login command was found for 'Apache Tomcat/6.0.18'. Please ensure that the login-command tag has the correct server attribute value, or use 'all' to use the login command regardless of the server.

    After some googling I figured out that it relates to BlazeDS security. What I could not find is if I still should be able to connect with this warning in place or not. Our BlazeDS service does not require authorization to be used.

    The second warning appears when I try to connect to the server from our flash client:

    [BlazeDS]HttpFlexSession has not been registered as a listener in web.xml for this application so no events will be dispatched to FlexSessionAttributeListeners or FlexSessionBindingListeners. To correct this, register flex.messaging.HttpFlexSession as a listener in web.xml.

    My search did not produce any results. I follow this introduction article and it does not mention any HttpFlexSession registration or something like this.

    Any help is appreciated.

    The config files are below. Thanks.

    --- services-config.xml ---

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

    <services>
    <default-channels>
    <channel ref="my-amf"/>
    </default-channels>
    </services>

    <channels>

    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
    <endpoint url="http://localhost:8080/test/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
    </channel-definition>

    </channels>

    <logging>
    <target class="flex.messaging.log.ConsoleTarget" level="Warn">
    <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>

    --- end of services-config.xml ---



    --- spring-blazeds-context.xml ---

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:flex="http://www.springframework.org/schema/flex"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/flex
    http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">

    <flex:message-broker>
    <flex:message-service default-channels="my-amf" />
    </flex:message-broker>

    <!-- Expose the productService bean for BlazeDS remoting -->
    <flex:remoting-destination ref="testService" />

    </beans>

    --- end of spring-blazeds-context.xml ---



    --- web.xml servlet config ---

    <servlet>
    <description>Spring MVC Dispatcher Servlet for web application</description>
    <servlet-name>test-webapp</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet>
    <description>Spring MVC Dispatcher Servlet for remote access</description>
    <servlet-name>test-remote</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>test-webapp</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>test-remote</servlet-name>
    <url-pattern>/messagebroker/*</url-pattern>
    </servlet-mapping>

    --- end of web.xml servlet config ---
    Last edited by mhv; Aug 14th, 2009, 11:03 AM.

  • #2
    Both of the log warning messages you're getting are harmless and don't affect anything. Shouldn't have anything to do with not being able to connect.

    I don't see anything clearly wrong in your config. (BTW, please use the code tags in the future to make such snippets more readable.)

    Exactly what sort of error are you getting when you try to invoke a method on your remote service?

    Comment


    • #3
      Jeremy,

      Thanks for the feedback. I did not have any useful error code on the client side. We use a pure AS3 client instead of Flex and Adobe does not really provide a lot of info about how to handle it so it's a bit tricky. We have to get through the initial setup from the both server and client side.

      I have just been able to make the prototype working. It seems like it was a client side problem. But while messing withe the server side code I have noticed that if I add the following line to web.xml then the second warning disappears.

      Code:
      <listener>
              <listener-class>flex.messaging.HttpFlexSession</listener-class>
      </listener>
      I am not sure if it makes sense to have this line there. It does not seem to affect the way it works. What would be your recommendation?

      thnx

      Comment


      • #4
        You only need to have the HttpFlexSession in the web.xml if you want to register a server-side listener that can be notified of certain events such as attributes being added or removed from the session. (Of course, having it there also makes the warning message go away.) BlazeDS does not use this internally in any way, and I would say it's a rarely used capability which is why we don't show it configured in the sample (one less thing to have to remember to configure is always good in my view). Not having it in there doesn't effect the functionality otherwise.

        Comment


        • #5
          I see.Thanks.

          Just a suggestion, for someone who is new to BlazeDS this warning (...no events will be dispatched to FlexSessionAttributeListeners...) looks like a potential source of troubles. May be it makes sense to put a "don't panic" line about it somewhere in the documentation.

          Comment

          Working...
          X