The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossInjectionProvider' does not implement the InjectionProvider interface

From Foochal

Jump to: navigation, search


Error message

I got the following message when launching a seam application in JBoss 4.2.2 GA

FATAL [application] JSF1029: The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossInjectionProvider' does not implement the InjectionProvider interface. 

Here's the stack trace which follows the above error:

 Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.ClassCastException: com.sun.faces.config.WebConfiguration cannot be cast to com.sun.faces.config.WebConfiguration
	at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:135)
	at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:228)
	at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

...

java.lang.ClassCastException: com.sun.faces.application.ApplicationAssociate cannot be cast to com.sun.faces.application.ApplicationAssociate
	at com.sun.faces.application.ApplicationAssociate.clearInstance(ApplicationAssociate.java:186)
	at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:440)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3895)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4527)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4391)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)

Analysis

The problem is causes by two versions of jsf-api and jsf-impl jars at runtime. The application included one version and the other version was coming from Jboss container.

Solution

Your application should not provide the jsf-api and jsf-impl jars. They should be specified as "provided" in maven.


Personal tools