Victor
Victor

Reputation: 1159

Orika ClassCastException in Eclipse on redeploy

I am using orika-core-1.5.4.jar in my Liferay 7.3.5 CE GA6 Portlet in order to map some classes. Everything goes well if I test it in a main method or if it is the first time when the portlet is deployed, but goes awry if I redeploy it - eg. when I make some changes and then deploy them. The error is the following:

 java.lang.ClassCastException: ma.glasnost.orika.generated.Orika_MedicForm_FormDTO_Mapper850365342121300$0 cannot be cast to ma.glasnost.orika.impl.GeneratedObjectBase

From what I have read (here is an interesting article and also this stack article), this is because the first time, the class was generated with a AppClassLoader and the second time with RestartClassLoader - the articles refers to Spring applications. But I am not clear how to manage this. Now, I have to restart the server each time in order to avoid this.

Any ideas would help, thanks !

Upvotes: 0

Views: 73

Answers (0)

Related Questions