Created by Paolo Escobar / @pao_esco
pom.xml to add Spring IO Platformpom.xml (remove versions managed by Spring)Hibernate.LONG does not exist anymore
The code does not compile
Hibernate 4 removed this attribute
Change
query.unwrap(SQLQuery.class).addScalar("id", Hibernate.LONG);
To
query.unwrap(SQLQuery.class).addScalar("id", new LongType());
Generics, Mockito and Spring Security : Collection<? extends GrantedAuthority>
Tests don't compile
Changes in Spring Security
Collection<GrantedAuthority> changed to Collection<? extends GrantedAuthority>
Change
Mockito.when(auth.getAuthorities()).thenReturn(authorities);
To
Mockito.doReturn(authorities).when(auth).getAuthorities();
Another CacheManager with same name 'cacheManager' already exists in the same VM
Hibernate 3 uses ehcache
Hibernate 4 uses it's own internal hibernate-ehcache
Some classes have changed
Change
hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.EhCacheRegionFactory
To
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
Configuration problem: You cannot use a spring-security-2.0.xsd schema with Spring Security 3.0. Please update your schema declarations to the 3.0 schema."
Spring xml files declare xsd import to use Spring features
XSD versions must be aligned with Spring version in the classpath
Change
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
To
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
Spring context is not loading properly on startup
With the upgrade, some old dependencies on servlet-api and jsp-api stayed in the classpath
Clean classpath
servlet-api and jsp-api must be provided
JerseyServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
Spring context is not loading properly on startup
With new versions, configuration has changed
Compatibility between versions (Spring 4 and Jersey 2)
In our project : removed Jersey because it was not used
Another solution is to upgrade to Jersey 2.x
Another solution is to migrate to Spring MVC
java.sql.SQLException: data exception: string data, right truncation
Some attributes in @Entity classes are annotated @Lob
Hibernate dialect org.hibernate.dialect.HSQLDialect has changed
It does not handle @Lob the same way
Change
@Lob
@Column(name = "BODY" )
public String getBody() {
return body;
}
To
@Lob
@Column(name = "BODY", length = 10000)
public String getBody() {
return body;
}