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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content