Wednesday, July 2, 2008

Spring upgradation from 2.1 to 2.5.5

Today we are upgrading our application from spring 2.1.1 to spring 2.5.5. During upgrdation we encountered the following exception:


nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'viewClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.web.servlet.view.tiles.TilesView]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)

After litte bit digging found that spring 2.5.5 by default supports tiles2, where as we are using tiles 1.x version. To have backward compatibility we added spring-webmvc-struts.jar.

The following are the steps that are followed for upgradation:

1) Added the new version of spring.jar to the project
2) Added spring-webmvc.jar ---> Spring MVC is moved to separate jar in the latest version
3) Added spring-webmvc-struts.jar --.> For back ward compatibility of tiles 1.x. The latest
version of spring supports only tiles2

spring-webmvc.jar and spring-webmvc-struts.jar can be found under :
spring-framework-2.5.5\dist\modules

No comments: