Since we had fallen behind a little the upgrade did raise some funnies. Here are the things I ran into:
Maven:
Our pom files were still referencing:
hibernate.jar
ehcache.jar
These artefacts don't exit on the latest version, so replaced those with
hibernate-core.jar and ehcache-core.jar
We also still use the hibernate tools + maven run plugin to reverse engineer our db object.
This I needed to update to a release candidate:
The code: "Hibernate.createBlob"... no longer exists
replaced with:
On the HibernateTemplate
return types are now List; not element...So needed to add casts for the lists being returned.
Added:
And configure the settings in the cfg.xml for it:
org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory.
Spring:
Amazingly some of our application context files still referenced the Spring DTD ... replaced with XSD
Maven:
Our pom files were still referencing:
hibernate.jar
ehcache.jar
These artefacts don't exit on the latest version, so replaced those with
hibernate-core.jar and ehcache-core.jar
We also still use the hibernate tools + maven run plugin to reverse engineer our db object.
This I needed to update to a release candidate:
Hibernate:
replaced with:
On the HibernateTemplate
return types are now List; not element...So needed to add casts for the lists being returned.
import org.hibernate.classic.Session;
replaced with:
import org.hibernate.Session;
Reverse engineer works a little differently...
Assigns Long to numeric...replaced with:
import org.hibernate.Session;
Reverse engineer works a little differently...
Added:
Possible Errors:
- Caused by: org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
And configure the settings in the cfg.xml for it:
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
Probably still using a reference to hibernate3 factory / bean somewhere, change to hibernate4:
org.springframework.orm.hibernate3.LocalSessionFactoryBean
org.springframework.orm.hibernate3.HibernateTransactionManager
org.springframework.orm.hibernate3.LocalSessionFactoryBean
org.springframework.orm.hibernate3.HibernateTransactionManager
- Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.hql.classic.ClassicQueryTranslatorFactory There is minor change in new APIs, so this can be resolved by replacing property value with:
org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory.
Spring:
Amazingly some of our application context files still referenced the Spring DTD ... replaced with XSD
In Spring configs added for c3p0:
Spring removed the "local"=: so needed to just change that to "ref"=
Spring removed the "local"=: so needed to just change that to "ref"=
Spring HibernateDaoSupport no longer has: "releaseSession(session);", which is a good thing so was forced to update the code to work within a transaction.
Possible Errors:
- getFlushMode is not valid without active transaction; nested exception is org.hibernate.HibernateException: getFlushMode is not valid without active transaction
Removed from hibernate properties:
<prop key="hibernate.current_session_context_class">thread</prop>
Supply a custom strategy for the scoping of the "current"Session . See Section 2.5, “Contextual sessions” for more information about the built-in strategies |
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
Another option is :
<bean id ="productHibernateTemplate" class="org.springframework.orm.hibernate4.HibernateTemplate">
<property name="sessionFactory" ref="productSessionFactory"/>
<property name="checkWriteOperations" value="false"/>
</bean>
<property name="sessionFactory" ref="productSessionFactory"/>
<property name="checkWriteOperations" value="false"/>
</bean>
- java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig
Servlet version update:
- Then deploying on weblogic javassist: $$_javassist_ cannot be cast to javassist.util.proxy.Proxy
The issue here was that there were different versions of javassist being brought into the ear. I all references removed from all our poms, so that the correct version gets pulled in from from Spring/Hibernate...
and then configured weblogic to prefer our version:
Telangana DSC Recruitment Notification 2016
ReplyDeleteThanks for author for providing amazing information in the post..................
Mass Effect 4 Andromeda. But instead of naming it Mass Effect 4,
ReplyDeletethey have added the name of a famous galaxy which says a lot about what to expect from this game.
If you are a hardcore gamer then this game is surely going to interest you. For more info, you can take a look Mass Effect 4 release date
Online tutoring could be a one stop resolution for college students United Nations agency want in-depth information on any subject during a short span of your time. Students will access it by following some simple steps. visit the site
ReplyDeleteThat is why if you're one in every of those those who need to completely perceive finance theories and formulas, there ar some sites that may give you with finance assignment facilitate. more
ReplyDeleteGood information.
ReplyDeleteThanks for sharing.
ReplyDeleteDedicated SQL Hosting refers To dependable database hosting services provided for a variety of customers. Dedicated SQL Servers differ in their specifications based upon the plan chosen By the client. Information stored in the SQL database could be accessed through The web-based SQL enterprise manager. helpful link will help you to know more.
ReplyDeleteEvery PC gamer owns a mouse, but not every PC gamer owns the best gaming mouse for their favorite FPS games, or the best ambidextrous mouse for playing left-handed. Check out the top 10 gaming mouse
ReplyDeleteThis information you give us is great.
ReplyDeleteYour blog is very interesting
ReplyDeleteAivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ giá rẻ 2021
gia ve tu my ve vietnam
vé máy bay khứ hồi từ đức về việt nam
dịch vụ vé máy bay tại nga
giá vé máy bay từ anh về hà nội
bay từ pháp về việt nam mấy tiếng
Chuyen bay cho chuyen gia nuoc ngoai
The difference between Spring and Hibernate is that spring is a complete framework and Hibernate is integrated into to Spring framework. The best part of our Alzheimer’s Care Services in Villages FL is the customized memory care service that ensures your loved one is well cared for while living at home.
ReplyDeleteIt unlocks enhanced features, performance, and compatibility with the new spring. How Can Uninstall This process may pose challenges, but the benefits in terms of stability and functionality are well worth the effort.
ReplyDelete