FacesException: Expression Error: Named Object: custom.component.MyCustomJSFComponent not found in EAP 7.4
Issue
We are getting this error when moving out custom JSF component from our war into the ear/lib where the war is a sub-deployment of the ear:
javax.servlet.ServletException: Expression Error: Named Object: custom.component.MyCustomJSFComponent not found.
at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:725)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:451)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
...
Caused by: javax.faces.FacesException: Expression Error: Named Object: custom.component.MyCustomJSFComponent not found.
at com.sun.faces.util.Util.notNullNamedObject(Util.java:478)
at com.sun.faces.application.applicationimpl.InstanceFactory.createComponentApplyAnnotations(InstanceFactory.java:743)
at com.sun.faces.application.applicationimpl.InstanceFactory.createComponent(InstanceFactory.java:294)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:459)
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:681)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:564)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:152)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:111)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:55)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:179)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:111)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:55)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:52)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:46)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:120)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:358)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:199)
at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:708)
... 47 more
When it is packaged in the war, it works fine.
my-jsf-components.jar
- META-INF
- my-jsf-components.taglib.xml
- custom.component.MyCustomJSFComponent.class
- custom.component.MyCustomJSFComponentRenderer.class
The custom component is defined using annotations:
import javax.faces.render.FacesRenderer;
import javax.faces.render.Renderer;
@FacesRenderer(rendererType = "custom.component.MyCustomJSFComponentRenderer", componentFamily = "custom.component")
public class MyCustomJSFComponentRenderer extends Renderer {
...
}
The custom rendrer is defined using annotations:
import javax.faces.component.FacesComponent;
@FacesComponent("custom.component.MyCustomJSFComponent")
public class MyCustomJSFComponent extends javax.faces.component.html.HtmlSelectOneMenu {
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7
- Java Server Faces (JSF) 2.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.