what is the right way to debug those issues?
In my case I have massive troubles with a LinkageError within my Java EE web project:
Problem
I included JSF API (jboss-jsf-api_2.2_spec-2.2.5.jar) into my wildfly modules directory, i.e. it will be loaded by Wildfly classloader. I have external libraries which also depend on that JSF implementation (e.g. Primefaces and OmniFaces). Additionally, to let the build process run without errors I have to add the library as an separate EAR library.
The strange manner is when adding a bean that implements function with faces event paramaters, e.g.
public void myValueChangeListener(ValueChangeEvent e) {
// do sth.
}
implementing those functions results in ...
10:22:18,571 WARN [org.jboss.modules] (MSC service thread 1-1) Failed to define class javax.faces.event.ValueChangeEvent in Module "javax.faces.api:main" from local module loader @468a169f (finder: local module finder @13d344e7 (roots: /home/user/app-server/wildfly8/modules,/home/user/app-server/wildfly8/modules/system/layers/base)): java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "javax/faces/event/ValueChangeEvent"
... starting point for my SEVERE
10:22:18,578 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Critical error during deployment: : java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "javax/faces/event/ValueChangeEvent"
(removing the parameter allows to build the project without errors)
Question
How to cope with such problems? I would need an overview about the order the classes are loaded. Probably there is a way to show an entire classloader tree or any profiling tool which will do the same.