Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IllegalArgumentException for JSF view while loading page

Even I am trying to open simple JSF page it is throwing exception, I am not getting even single hint what is wrong with the code.

i have xhtml like this

    <table border="0" bordercolor="red" width="100%" cellspacing="0"
        cellpadding="0">
        <tr>
            <td><h:messages errorClass="crudMessageError"
                    styleClass="crudmessagebackground" infoClass="crudmessageInfo"
                    layout="table" />
            </td>
        </tr>
        <tr>
            <td width="100%" align="left">

            <a4j:form id="searchTrans">
                    <table width="99%" border="0" bordercolor="red" cellpadding="3"
                        cellspacing="0" class="bodyTable">

                        <tr>
                            <td colspan="4">
                                <table width="100%" cellpadding="3" cellspacing="0">
                                    <tr>

                                        <td width="15%"><h:outputText
                                                value="#{label.counterPartOne}" class="globalHd" /></td>
                                        <td width="120px"><h:inputText id="txtCounterPart1"
                                                value="" >
                                            </h:inputText></td>
                                        <td width="15%"><h:outputText
                                                value="#{label.counterPartTwo}" class="globalHd" /></td>
                                        <td width="120px"><h:inputText id="txtCounterPart2"
                                                value="" required="true"
                                                styleClass="mandatoryTextField"
                                                requiredMessage="#{validation.customerRequiredMessage}"
                                                validator="#{customerController.validateForm}"
                                                maxlength="15">
                                            </h:inputText></td>
                                    </tr>


                                    <tr>

                                        <td width="15%"><h:outputText
                                                value="#{label.transactionsGroup}" class="globalHd" /></td>
                                        <td width="120px"><h:selectOneMenu id="DDLTransGrp"
                                                value="">
                                                <f:selectItem id="1" itemLabel="Type1" itemValue="Type1" />
                                                <f:selectItem id="2" itemLabel="Type2" itemValue="Type2" />
                                                <f:selectItem id="3" itemLabel="Type3" itemValue="Type3" />
                                                <f:selectItem id="4" itemLabel="Type4" itemValue="Type4" />
                                                <f:selectItem id="5" itemLabel="Type5" itemValue="Type5" />

                                            </h:selectOneMenu></td>

                                        <td width="15%"><h:outputText
                                                value="#{label.transactionType}" class="globalHd" /></td>
                                        <td width="120px"><h:selectOneMenu id="DDLTransType"
                                                value="">
                                                <f:selectItem id="1" itemLabel="Type1" itemValue="Type1" />
                                                <f:selectItem id="2" itemLabel="Type2" itemValue="Type2" />
                                                <f:selectItem id="3" itemLabel="Type3" itemValue="Type3" />
                                                <f:selectItem id="4" itemLabel="Type4" itemValue="Type4" />
                                                <f:selectItem id="5" itemLabel="Type5" itemValue="Type5" />

                                            </h:selectOneMenu></td>

                                    </tr>
                                    <tr>

                                        <td width="15%">
                                        <h:outputText
                                                value="#{label.profitCenter}" class="globalHd" />
                                                </td>
                                        <td width="120px">
                                        <h:inputText id="txtProfitCenter" value="" />
                                        </td>

                                    <td width="15%">    
                                    <h:outputText value="#{label.outstandingOnly}" class="globalHd" /></td>

                                    <td width="120px">
                                    <h:selectBooleanCheckbox value=""  id="chkOutstanding"/>
                                    </td>
                                    </tr>

                                <tr>
                                <td width="15%">
                                <h:outputText value="#{label.completed}" class="globalHd" />

                                </td>
                                <td width="120px">
                                <h:selectBooleanCheckbox value=""  id="chkComplete"/>
                                </td>

                                <td width="15%">
                                    <h:outputText value="#{label.positionDesk}" class="globalHd" />
                                </td>
                                <td width="120px">
                                <h:selectBooleanCheckbox value=""  id="chkPositionDesk"/>
                                </td>                                   

                                </tr>


                                <tr>
                                <td width="15%">
                                    <h:outputText value="#{label.currency}" class="globalHd" />
                                </td>

                                <td width="120px"><h:selectOneMenu id="DDLTransType"
                                                value="">
                                                <f:selectItem id="1" itemLabel="SAR" itemValue="SAR" />
                                                <f:selectItem id="2" itemLabel="USD" itemValue="USD" />                                         

                                            </h:selectOneMenu></td>



                                <td width="15%">
                                    <h:outputText value="#{label.tradingOfficer}" class="globalHd" />
                                </td>
                                <td width="120px">
                                        <h:inputText value=""  id="txtTradingOfficer"/>
                                        </td>


                                </tr>

                                <tr>
                                <td width="15%"></td>

                                <td style="width: 60px">


                <a4j:commandButton id="searchButton" value="#{button.search}" styleClass="mybutton"     />  




                </td>

                                </tr>

                                </table>
                                </td>
                        </tr>

                    </table>

                </a4j:form></td>

        </tr>

    </table>
</ui:composition>

This the main exception i am getting when try to load xhtml page

javax.servlet.ServletException: 1
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:99)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
com.bsf.web.core.SessionTimeOutFilter.doFilter(SessionTimeOutFilter.java:75)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

This is root cause produce by same exception.

root cause

java.lang.IllegalArgumentException: 1
javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:549)
javax.faces.component.UIComponentBase.setId(UIComponentBase.java:351)
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:65)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:73)
com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:54)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:65)
com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:54)
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.jstl.core.ForEachHandler.apply(ForEachHandler.java:175)
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:65)
com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:73)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:99)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
com.bsf.web.core.SessionTimeOutFilter.doFilter(SessionTimeOutFilter.java:75)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
like image 333
adam Avatar asked Jan 17 '23 09:01

adam


1 Answers

Root Cause is this line:

<f:selectItem id="1" itemLabel="Type1" itemValue="Type1" />

an id can not begin with a number.

From UIComponent#setId():

Set the component identifier of this UIComponent (if any). Component identifiers must obey the following syntax restrictions:

  • Must not be a zero-length String.
  • First character must be a letter or an underscore ('_').
  • Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').

Throws: IllegalArgumentException - if id is not syntactically valid

like image 136
Kerem Baydoğan Avatar answered Jan 29 '23 03:01

Kerem Baydoğan