Ivan
Ivan

Reputation: 71

Classloader settings do not apply on Websphere 8

I have IBM Websphere 8.5.5.10. and hibernate-jpa-2.0-api-1.0.0.Final.jar is a default jar. However, I want to use a newer version -> hibernate-jpa-2.1-api-1.0.0.Final.jar. I set "Classes loaded with local class loader first (parent last)" and "Single class loader for application". In spite of that, I get the following error:

Caused by: java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index;
...
Delegation Mode: PARENT_FIRST).
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:973) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
...

Looks like this error occurs because the old/parent's jar is loaded first. Also. please notice that Delegation Mode is PARENT_FIRST although I defined different. And I checked many times my classloader definition, restarted the application and even the server and always the same:(

Can someone help, please?

Upvotes: 1

Views: 2189

Answers (1)

Gas
Gas

Reputation: 18040

This was already discussed in few posts , check this. You cannot use JPA 2.1 with WAS 8.5.5.x in a container managed way, as it only supports 2.0. You either have to upgrade to WAS 9.0, switch to WebSphere Liberty, or use JPA in application managed way.

Upvotes: 2

Related Questions