I'm using this sample application which at the end of the tutorial gives you instructions to checkout the source from Subversion. Build and deploy to a container and you will have an existing Spring MVC webapp.

http://www.springbyexample.org/examp...ig-webapp.html

The subversion URL and command is:
svn co http://svn.springbyexample.org/web/s...bapp/tags/1.1/ simple-form-annotation-config-webapp

If you deploy that app, all is well and the webapp runs smoothly.

I then go to the root of the project and launch my Roo command-line and type the following to install Surf 1.0.0-M3.

surf install

Roo creates everything required for Surf.

When I start the application with these results I get the following error in my Tomcat logs (Tomcat version 6.0.26).

Sep 21 2010 20:57:38 DEBUG org.springframework.beans.TypeConverterDelegate - Cannot create copy of Collection type [java.util.ArrayList] - injecting original Collection as-is
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection

There are two issues here (potentially more) that is causing the app to completely crash at deployment time:

1.) You will see that the web.xml now has two declarations and mappings for the DispatcherServlet. I tried to combine these into a servlet declaration which has a url-mapping for surf specific pages and springmvc specific pages. That did not work

2.) Before running 'surf install' at the roo command-line, I renamed the original springmvc spring file from web-application-context.xml to web-application-config.xml in hope that roo would 'manage' this file and add what's needed. Rather than 'manage' this file, it completely stepped all over it and overwrote it with what's required for surf. All of the original configuration for the springmvc app was deleted.


Here is my resulting web.xml file:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee                               http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                             
  <display-name>simple-form</display-name>
    
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/web-application-config.xml</param-value>
  </context-param>

  <filter>
    <filter-name>encoding-filter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>encoding-filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <servlet>
    <servlet-name>simple-form</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value/>
    </init-param>
  </servlet>
    
  <servlet-mapping>
    <servlet-name>simple-form</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>simple-form</servlet-name>
    <url-pattern>/page/*</url-pattern>
  </servlet-mapping>
    
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

  <filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>
Please advise on how we can use Spring 3.0, annotated Spring MVC with Surf so both play nice in a single web application.

Thanks!

- Billy -