Sakai Upgrading Spring-Framework from v1.2.x to v2.0.x

Environment

Work Blog

11-28-2006

  • Added v2.0.1 spring and spring-mock JARs to our maven repository. To access our repository, edit your build.properties:
    maven.repo.remote=http://source.sakaiproject.org/maven/,http://svn.ucdavis.edu/maven/,http://www.ibiblio.org/maven2/
    maven.tomcat.home=/home/thomas/local/tomcat/
    maven.compile.source = 1.5
    maven.compile.target = 1.5
    
  • Modify master/project.properties
    # The Springframework version we are using
    sakai.spring.groupId=org.springframework
    sakai.spring.artifactId=spring
    sakai.spring.version=2.0.1
    sakai.spring.mock.artifactId=spring-mock
    sakai.spring.mock.version=2.0.1
    
  • Running "maven sakai" generated the following error:
    /home/thomas/sakai_mini_2-3-x-spring2/db/db-impl/ext/src/java/org/sakaiproject/springframework/orm/hibernate/AddableSessionFactoryBean.java:60: getBeanDefinitionNames() in org.springframework.beans.factory.ListableBeanFactory cannot be applied to (java.lang.Class<org.sakaiproject.springframework.orm.hibernate.AdditionalHibernateMappings>)
                    String[] names = applicationContext.getBeanDefinitionNames(AdditionalHibernateMappings.class);
    
    
  • Replacing getBeanDefinitionNames with getBeanNamesForType : (warning) Not sure if this will work, see comment below
    // String[] names = applicationContext.getBeanDefinitionNames(AdditionalHibernateMappings.class);
    // String[] names = applicationContext.getBeanNamesForType(AdditionalHibernateMappings.class);
    // Per Antranig Basman change the above to:
    String[] names = applicationContext.getBeanNamesForType(AdditionalHibernateMappings.class, false, false);
    
    • There is also a comment stating:
      		// this method is deprecated, but for some reason,
      		// stuff doesn't work with the replacement
                      String[] names = applicationContext.getBeanDefinitionNames(AdditionalHibernateMappings.class);
      
  • Running "maven sakai" generated the following errors:
    /home/thomas/sakai_mini_2-3-x-spring2/metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/impl/BindExceptionBase.java:51: cannot find symbol
    symbol  : method fixedField(java.lang.String)
    location: class org.sakaiproject.metaobj.utils.mvc.impl.BindExceptionBase
          String fixedField = fixedField(field);
                              ^
    /home/thomas/sakai_mini_2-3-x-spring2/metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/impl/BindExceptionBase.java:56: cannot find symbol
    symbol  : method getMessageCodesResolver()
    location: class org.sakaiproject.metaobj.utils.mvc.impl.BindExceptionBase
          return this.getMessageCodesResolver().resolveMessageCodes(errorCode,
                 ^
    /home/thomas/sakai_mini_2-3-x-spring2/metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/impl/BindExceptionBase.java:61: cannot find symbol
    symbol  : method fixedField(java.lang.String)
    location: class org.sakaiproject.metaobj.utils.mvc.impl.BindExceptionBase
          String fixedField = fixedField(field);
                              ^
    /home/thomas/sakai_mini_2-3-x-spring2/metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/impl/beans/AddableUrlHandlerMapping.java:36: lookupHandler(java.lang.String,javax.servlet.http.HttpServletRequest) in org.springframework.web.servlet.handler.AbstractUrlHandlerMapping cannot be applied to (java.lang.String)
          return super.lookupHandler(urlPath);
                      ^
    Note: /home/thomas/sakai_mini_2-3-x-spring2/metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/shared/control/servlet/FileDownloadServlet.java uses or overrides a deprecated API.
    
    • BindExceptionBase extends Spring's BindException