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
https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7
https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7
https://community.jboss.org/wiki/DeploymentModuleDependencies
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.