How to resolve javassist conflict between application and JBoss when using aspectj in JBoss EAP 6?

Solution Verified - Updated -

Issue

  • An application includes javassist and uses aspectj in JBoss EAP 6.
  • ClassCastExceptions occur on Hibernate entities similar to the following:
Caused by: java.lang.ClassCastException: org.example.jaxws.EapTest_$$_javassist_0 cannot be cast to org.example.jaxws.EapTest
  at org.example.jaxws.HelloWorldImpl.sayHi_aroundBody2(HelloWorldImpl.java:42) [classes:]

Environment

JBoss Enterprise Application Platform (EAP) 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.