We have figured out that at the point where the library (not controlled by us) casts to the appopriate implementation the classloader is mixed up and therefore we get the exception.
I have read the following
although I see that between EAR deployments you can share dependencies and hence the classloader the same I am not certain can be said for WAR deployments. Is there a way we can put the libray in one WAR and share the dependency/classloader from the others?
Note we cannot change the deployment structure as this is dictated by Liferay compile/deployment process.