In our maven we remove all of the dependencies and just deploy it in the ear's lib directory.
I have also tried in the domain's/lib directory (and not in the ear's lib) and in the glassfish/lib/endorsed. None of them produce good results. I have done a search in every case to ensure that the DocumentFactory class is only in one jar anywhere under glassfish and it is always just in one spot – still getting the:
Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
So while normally I would think this was the same jar being included more than once – I think this time it is because of the SimpleSingleton loading that dom4j is doing and depending how it is being called it is using a different class loader.
It seems a change in 4.3.6 regarding classloading or usage of dom4j should lead us to the issue.
|