Question

Trying to integrate OmniFaces into a Java EE Web Project.

When implementing the following simple listener method, I receive linkage errors. I am using the WebSphere application server.

What's going on here?

public void useCreditCardChanged(javax.faces.event.ValueChangeEvent event) {
    Boolean oldVal = (Boolean) event.getOldValue();
    Boolean newVal = (Boolean) event.getNewValue();
    if (oldVal!=null) {
        this.useCreditCard = newVal;
    }
    FacesContext.getCurrentInstance().renderResponse();
}

and the log-files:

11:25:48.806 S [ConfigureListene  257] Critical error during deployment: : 
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.omnifaces.taghandler.ValidateUniqueColumn.processValueChange(Ljavax/faces/event/ValueChangeEvent;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/omnifaces/taghandler/ValidateUniqueColumn, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/faces/event/ValueChangeListener have different Class objects for the type (Ljavax/faces/event/ValueChangeEvent;)V used in the signature
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_51]
at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_51]
at com.sun.faces.util.Util.loadClass(Util.java:325) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:376) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:427) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) [jsf-impl-2.2.5-jbossorg-3.jar:]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

11:25:48.808 E [ServiceControlle 1955] MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./my-app: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./my-app: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.omnifaces.taghandler.ValidateUniqueColumn.processValueChange(Ljavax/faces/event/ValueChangeEvent;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/omnifaces/taghandler/ValidateUniqueColumn, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/faces/event/ValueChangeListener have different Class objects for the type (Ljavax/faces/event/ValueChangeEvent;)V used in the signature
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:216)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    ... 3 more

Caused by: java.lang.RuntimeException: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.omnifaces.taghandler.ValidateUniqueColumn.processValueChange(Ljavax/faces/event/ValueChangeEvent;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/omnifaces/taghandler/ValidateUniqueColumn, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/faces/event/ValueChangeListener have different Class objects for the type (Ljavax/faces/event/ValueChangeEvent;)V used in the signature
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187)
    ... 7 more

Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.omnifaces.taghandler.ValidateUniqueColumn.processValueChange(Ljavax/faces/event/ValueChangeEvent;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/omnifaces/taghandler/ValidateUniqueColumn, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/faces/event/ValueChangeListener have different Class objects for the type (Ljavax/faces/event/ValueChangeEvent;)V used in the signature
    at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_51]
    at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_51]
    at com.sun.faces.util.Util.loadClass(Util.java:325)
    at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:376)
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:427)
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378)
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321)
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
    ... 9 more
Was it helpful?

Solution

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.omnifaces.taghandler.ValidateUniqueColumn.processValueChange(Ljavax/faces/event/ValueChangeEvent;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/omnifaces/taghandler/ValidateUniqueColumn, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/faces/event/ValueChangeListener have different Class objects for the type (Ljavax/faces/event/ValueChangeEvent;)V used in the signature

You've multiple different versioned JSF API classes in webapp's runtime classpath. In this particular problem, specifically for the javax.faces.event.ValueChangeEvent class multiple different versions have been found in the webapp's runtime classpath. In other words, the webapp's runtime classpath is dirty. Most likely you've JARs in webapp's /WEB-INF/lib which do not belong there, because the appserver itself already ships those libraries out the box, such as Java EE and JSF.

Then there's another strange thing in your question. You're talking about IBM WebSphere and you've tagged [websphere], but the appserver specific classes listed in the stack trace clearly tells that it's JBoss WildFly, which is a completely different server, but perhaps explains why you added [jboss] tag as well. Again, those are two completely different servers. Know what you're using.

In any case, explore the webapp's /WEB-INF/lib and get rid of libraries which are already provided by the appserver itself, such as javaee.jar, jsf-api.jar, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top