1 Reply Latest reply on Feb 7, 2018 5:56 AM by Ken LAW

    JSF 2.1.x - Wildfly 10 Caused by: java.lang.NullPointerException [Server:server-one]  at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:136)

    Ken LAW Newbie

      Hello,

      We migrate an application from glassfish 4 to Wildfly 10.1.0.

      When we use some pages, we have the error below.

      We want to avoid modifications of code and want to find a solution with configuration modification.

      We suppose the bug it's linked to the JSF Version.

      Our application on glassfish use a JSF version 2.1.21 and IceFaces 3.3.

       

      Solutions we have tested (but they fail) :

      1) In the wildfly (folder modules) Replace the following jars on jboss and modify the associated module.xml :

      wildfly-10.1.0.Final\modules\system\layers\base\javax\faces\api\main

      <resource-root path="jboss-jsf-api_2.2_spec-2.2.13.jar"/>  ==>  <resource-root path="jsf-api-2.1.21.jar"/>

      wildfly-10.1.0.Final\modules\system\layers\base\com\sun\jsf-impl\main

      <resource-root path="jsf-impl-2.2.13.SP1.jar"/>                   ==>  <resource-root path="jsf-impl-2.1.21.jar"/>

       

      2) Add the JAVA_OPT : -Dorg.apache.el.parser.COERCE_TO_ZERO=false

       

      3) Add the JAVA_OPT : -Dorg.apache.el.parser.COERCE_TO_ZERO=true

       

      4) Combination of solutions 2 or 3 with the solution 1

       

      5) Implement the ElResolver

      public class EmptyToNullStringELResolver extends ELResolver {

        
      @Override
        
      public Class<?> getCommonPropertyType(ELContext context, Object base) {
        
      return String.class;
        
      }

        
      @Override
        
      public Object convertToType(ELContext context, Object value, Class<?> targetType) {
        
      if (value == null && targetType == String.class) {
        context
      .setPropertyResolved(true);
        
      }

        
      return value;
        
      }

        
      @Override
        
      public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
        
      return null;
        
      }

        
      @Override
        
      public Class<?> getType(ELContext context, Object base, Object property) {
        
      return null;
        
      }

        
      @Override
        
      public Object getValue(ELContext context, Object base, Object property) {
        
      return null;
        
      }

        
      @Override
        
      public boolean isReadOnly(ELContext context, Object base, Object property) {
        
      return true;
        
      }

        
      @Override
        
      public void setValue(ELContext context, Object base, Object property, Object value) {
        
      // NOOP.
        
      }

      }

      And register it in faces-config.xml as below:

      <application>
         
      <el-resolver>com.example.EmptyToNullStringELResolver</el-resolver>
      </application>

      The error we have when we deploy our application without any modification in the conf of wildfly :

      10:10:31,571 ERROR [io.undertow.request] (default task-11) UT005023: Exception handling request to /mypage.xhtml: javax.servlet.ServletException

      [Server:server-one]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)

      [Server:server-one]     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

      [Server:server-one]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

      [Server:server-one]     at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:205)

      [Server:server-one]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

      [Server:server-one]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

      [Server:server-one]     at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

      [Server:server-one]     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityR

      [Server:server-one]     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.

      [Server:server-one]     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(Securitandler.java:78)

      [Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      [Server:server-one]     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformaer.java:131)

      [Server:server-one]     at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuter.java:57)

      [Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      [Server:server-one]     at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidential

      [Server:server-one]     at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(SeronstraintHandler.java:64)

      [Server:server-one]     at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMecha)

      [Server:server-one]     at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAutdler.java:77)

      [Server:server-one]     at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHan

      [Server:server-one]     at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSationHandler.java:43)

      [Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      [Server:server-one]     at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHa

      [Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      [Server:server-one]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.jav

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

      [Server:server-one]     at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThr48)

      [Server:server-one]     at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.jav

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.ja

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:2

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

      [Server:server-one]     at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:1

      [Server:server-one]     at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

      [Server:server-one]     at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

      [Server:server-one]     at java.lang.Thread.run(Thread.java:748)

      [Server:server-one] Caused by: java.lang.NullPointerException

      [Server:server-one]     at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:136)

      [Server:server-one]     at com.sun.faces.facelets.tag.jstl.core.ChooseWhenHandler.isTestTrue(ChooseWhenHandler.java:87)

      [Server:server-one]     at com.sun.faces.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:104)

      [Server:server-one]     at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)

      [Server:server-one]     at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

      [Server:server-one]     at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.ja

      [Server:server-one]     at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegat

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      [Server:server-one]     at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106)

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.j

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111)

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.ja

      [Server:server-one]     at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegat

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      [Server:server-one]     at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.ja

      [Server:server-one]     at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegat

      [Server:server-one]     at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      [Server:server-one]     at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)

      [Server:server-one]     at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

      [Server:server-one]     at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199

      [Server:server-one]     at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)

      [Server:server-one]     at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

      [Server:server-one]     at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)

      [Server:server-one]     at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164)

      [Server:server-one]     at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrateg

      [Server:server-one]     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)

      [Server:server-one]     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

      [Server:server-one]     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

      [Server:server-one]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

      [Server:server-one]     ... 43 more

      [Server:server-one]