Please provide the following details:
1. The *current structure* / Current approach which you are using of your EAR which is giving the ClassCastException.
2. The complete stackTrace of the exception which you are getting, sothat we can see which class is being referenced and which class is causing the ClassCastException.
3. The exact place/name of the JAR which contains the class mentioned in the ClassCastException. ANd where that jar is placed inside the EAR.
4. If using module then list the JARs present inside the list.
The new AS7 or WildFly has a different policy for class loading. In my opinion more clear, but the migration might have issues.
Most problem is if you have the setting "call by value" to false which is the default.
In this case remote invocations will use call by reference, in that case you have often errors like "class A can not be cast to A". That means you create class A in webapp1 and call something in webapp2 which use a different classloader. (remember a class is identified by full name AND classloader).
So if you cant find the reason please provide the information Jay asked for.