As I do not know the details of your deployment (e.g. class loader isolation and where the classes packed)
I'll give you a few information in general.
By default JBoss will load all jar/ear files in lib or deploy with one classloader except WAR files, this is a bit different.
If you look into your error message you find that the classes are loaded from WebAppClassLoader and UnifiedClassLoader3.
If you have packed the same class file into a WebApp and a EJBApp it will be loaded by a different ClassLoader.
If you using it and have calls between the different Apps containing such classes the JVM is not able to handle it.
The solution can be
- use call-by-value (performance drawback)
- move such classes as library into the servers lib folder and remove from EAR