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
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>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>
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:<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>
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 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)
Anyone have any idea how to clean this up to make both servlets play together nicely?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:
Thanks,
Larry


Reply With Quote