Results 1 to 9 of 9

Thread: BlazeDS Servlet in web.xml

Threaded View

  1. #1

    Default BlazeDS <flex:secured /> Problem with Grails

    Note: I've edited title as old one was a little misleading based on recent investigation.

    I've integrated BlazeDS with Grails, using Spring under the hood techniques. When I add a new servlet and mapping to the web.xml, I receive exceptions whether it is a Flex client request or browser request.

    This is little off track for this forum, but perhaps someone has seen this sort of issue. It is kind of a web.xml and DispatcherServlet question (or perhaps more about how Grails handles incoming requests)

    Servlet code in web.xml

    Code:
    <servlet>
    		<servlet-name>flex</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    </servlet>
    
    
    <servlet-mapping>
    		<servlet-name>flex</servlet-name>
    		<url-pattern>/messagebroker/*</url-pattern>
    </servlet-mapping>
    There is already a GrailsDispatcherServlet (child of DispatcherServlet) by default, without an explicitly stated mapping, so I assume its defaulted somewhere in Grails:

    Code:
    <servlet>
    		<servlet-name>grails</servlet-name>
    		<servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    From Flex client, I am able to call my exposed service on the server and receive an object back, but do get this exception on server side:

    Code:
    ERROR filter.UrlMappingsFilter  - Error when matching URL mapping [/(*)/(*)?/(*)?]:org.springframework.web.context.request.ServletRequestAttributes cannot be cast to org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
    java.lang.ClassCastException: org.springframework.web.context.request.ServletRequestAttributes cannot be cast to org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
    	at java.lang.Thread.run(Thread.java:619)
    If I try and access from browser using usual URL http://localhost:8080/myAppRoot/ ... I receive an error 500 page with same kind of exception:

    Code:
    Error 500:
    Servlet: default
    URI: /myAppRoot/
    Exception Message: org.springframework.web.context.request.ServletRequestAttributes cannot be cast to org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
    Caused by: org.springframework.web.context.request.ServletRequestAttributes cannot be cast to org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
    Class: Unknown
    At Line: [-1]
    Code Snippet:
    Anyone have any idea how to clean this up to make both servlets play together nicely?

    Thanks,

    Larry
    Last edited by con19m31; Apr 25th, 2010 at 11:41 AM. Reason: Title became a little misleading

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •