1 of 1 people found this helpful
That error means you have more than one definition of the MyPrivateKey class (likely in both the module and the EAR), and the caller (KeyLoginModule) and the class being called (MyKeyRing) have different ones.
Usually, you would want to remove the duplicated classes from the EAR, and use jboss-deployment-structure.xml to depend on the module.
The problem was I have this class in a jar inside ear lib and the same jar was in the custom jboss module that I created.
When I use only the module and remove the jar from ear lib, I am getting class not found error. So I removed dependency to this module (com.app.configuration) and it worked fine.