f.haeder.net

Mojarra 2.3.5 thrown exception to less explanatry

If you have somewhere in your templates and views an id that is invalid it is currently very hard to track errors. Here is an excerpt what I get from one of my views:
java.lang.IllegalArgumentException:  
        at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:605)
        at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:422)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.assignUniqueId(ComponentTagHandlerDelegateImpl.java:438)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:180)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:195)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:88)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:313)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:372)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:351)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:204)
        at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:125)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:195)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:88)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:313)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:372)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:351)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:204)
        at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:125)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:208)
        at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:414)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:384)
        at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:161)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:135)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:96)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:195)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:88)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:313)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:372)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:351)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:204)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:175)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:88)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:313)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:372)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:351)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:204)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:175)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:94)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:88)
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:162)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:381)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:102)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:223)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1692)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.mxchange.jfinancials.filter.FinancialsNoCacheFilter.doFilter(FinancialsNoCacheFilter.java:72)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:654)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:483)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
        at java.lang.Thread.run(Thread.java:748)

So, a nice long back-trace but what needs to be done? You may ask that yourself and it is okay. :-) Well, the first line is my point here. Just an exception is sometimes not enough. So I filled a report there at #microsoft-hub and I hope they take care of it soon (maybe even next release 2.3.6?).
This would be cool! :-)

Link: https://github.com/javaserverfaces/mojarra/issues/4375
#microsoft-hub #pending javaee jsf mojarra

Fixed NPE in PrimeFaces!

I have just pushed a pull request for #PrimeFaces on #GitHub. Let's hope, they accept it.

Here is the link:
#PrimeFaces #GitHub jsf npe primefaces
fix primefaces repeatable-example
Just deploy it (here with #Payara, maybe Micro works?) and unselect all, then select "None selected".

Problem with simple h:form, h:selectManyListbox and h:commandButton

I'm currently having trouble with this simple form getting working:
<h:form id="choose_projects_form">
<div class="table_big">
<div class="table_header">
<h:outputText value="#{msg.USER_REPORTS_CHOOSE_PROJECTS_TITLE}" />
</div>

<div class="para">
<div class="form_label">
<h:outputLabel for="selectedProjects" value="#{msg.USER_CHOOSE_PROJECTS}" />
</div>

<div class="form_field">
<h:selectManyListbox styleClass="projects" id="selectedProjects" size="5" value="#{choosenProjectsReportsController.selectedProjects}" required="true" requiredMessage="#{msg.USER_FIELD_SELECTED_PROJECT_REQUIRED}">
<f:converter converterId="ProjectConverter" />
<f:selectItems value="#{choosenProjectsReportsController.availableProjects}" var="project" itemValue="#{project}" itemLabel="#{msg[project.i18nKey]}" />
</h:selectManyListbox>
</div>

<div class="clear"></div>

<h:message for="selectedProjects" errorClass="errors" fatalClass="errors" warnClass="errors" showSummary="true" />
</div>

<div class="para notice">
<h:outputText value="#{msg.USER_CHOOSE_PROJECTS_NOTICE}" />
</div>

<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
<h:commandButton styleClass="submit" type="submit" action="#{choosenProjectsReportsController.doChooseProjects()}" value="#{msg.BUTTON_SHOW_CHOOSEN_PROJECT_STATISTICS}" />
</div>
</div>
</h:form>


The backing bean (web controller) has this defined:

...
import javax.enterprise.context.SessionScoped;
...
@Named ("choosenProjectsReportsController")
@SessionScoped
public class ReportsChoosenCustomersWebSessionBean extends BaseReportsController implements ReportsChoosenCustomersWebSessionController {
...
private final List<ReportProject> availableProjects; // +getter as no setter is needed/possible
...
private ReportProject selectedProjects[]; // + getter/setter
...
}


In constructor the list is initialized, in a @PostConstruct method it is being filed (ReportProject is an enumeration).

All projects are being shown an the selectManyListbox and commandButton are both correctly being rendered. If it select one (or more) and hit the submit button, a POST request goes.

The problem is that doChooseProjects() is not being invoked and also the converter's getAsObject() method is not invoked. Also no error message shows up (including log file).

A search on Internet like "selectManyListbox converter action not invoked" (no quotes) doesn't turn up any useful.
#strange-bug javaee jsf
h:selectManyListbox seems not to be the main cause for this. When I have commented it out, the action method is still not called.
Well, it looks like that JSF became confused of having to much nested templates. :-/ Or to much ui:fragment rendered="#{someController.fooMethod()}" ??? I need this to have conditions in templates, e.g. if the user calling the page is really logged-in, else the user is not allowed to access that page.
Yes, that was the case. :-(
#Bug, maybe. It should not detected as #tag as there are curly braces.
#Bug #tag
newer older