Search code examples
classloaderwildfly

Wildfly classloader and class location in jar in logs


I am having an issue that one of my classes are loaded by two classloaders at the same time. I am getting

Caused by: java.lang.ClassCastException: com.mycomp.myapp.InteractiveSpec cannot be cast to com.mycomp.myapp.InteractiveSpec

Which basically means its a classloader issue.

Now In jboss i remember, we used to put -v in the server startup JAVA OPTs and it used to give very detailed verbose server log and which class is having an issue and is from which jar (I think it also specified the class loader as well but I am not sure). It helped me debug when I had two different versions of one jar.

Does any one know how to debug in wildfly which class is coming from which jar and which class loader.

Thanks.


Solution

  • -verbose:class in Java OPts. I thought it was something specific to Jboss. This should work in every app server.