Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.0-beta, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4
-
None
-
None
Description
The improvement 4099 introduced with version 2.3 leads to a NullPointerException in TagAttributeImpl.java:550 View File on Github
Location ccLocation = (Location) actx.getFaceletCompositionContext(). getCompositeComponentFromStack().getAttributes().get( CompositeComponentELUtils.LOCATION_KEY);
getCompositeComponentFromStack() returns null, because there is no stack.
The composite component is not calling any child components and used inside a ui:composition
Usage of composite component in test.xhtml (simplified)
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:cw="http://xmlns.jcp.org/jsf/composite/components" xmlns:ui="http://java.sun.com/jsf/facelets"> <cw:attributeGroup saveListener="#{customerBean.updateAttributeContainer(cc.wrapper)}" wrapper="#{attributeGroup}" /> </ui:composition>
The problem is caused because of "cc.wrapper". This worked in 2.2 and now we can't update.
Error displayed on page (not helpful)
/test.xhtml at line 16 and column 37 saveListener="#{customerBean.updateAttributeContainer(cc.wrapper)}" null viewId=/test.xhtml location=C:\data\workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\provDB-webapp\test.xhtml phaseId=RENDER_RESPONSE(6) Caused by: java.lang.NullPointerException - /test.xhtml at line 16 and column 37 saveListener="#{customerBean.updateAttributeContainer(cc.wrapper)}" null at org.apache.myfaces.view.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:550)
Stack Trace
javax.faces.view.facelets.TagAttributeException: /test.xhtml at line 16 and column 37 saveListener="#{customerBean.updateAttributeContainer(cc.wrapper)}" null at org.apache.myfaces.view.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:578) at org.apache.myfaces.view.facelets.tag.composite.CompositeComponentRule$ValueExpressionMetadata.applyMetadata(CompositeComponentRule.java:101) at org.apache.myfaces.view.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:45) at org.apache.myfaces.view.facelets.tag.composite.CompositeComponentResourceTagHandler.setAttributes(CompositeComponentResourceTagHandler.java:488) at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:290) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:51) at org.apache.myfaces.view.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:160) at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:59) at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:48) at org.apache.myfaces.view.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:187) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:483) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:79) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:266) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:206) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at de.my.core.tomcat.reverseproxy.ReverseProxySessionManager.doFilter(ReverseProxySessionManager.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at org.apache.myfaces.view.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:550) ... 52 more
Attachments
Attachments
Issue Links
- is duplicated by
-
MYFACES-4286 NullPointerException in TagAttribute.impl caused by MYFACEs-4099
- Closed
- links to