Page 1 of 2

Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 20 Jan 2023, 22:40
by gesker
Hello:

Was trying the rain theme on a new project. At first glance the theme appears to be applied correctly but on first page load I'm getting the error below. Default saga has no issues, of course.

New project is in Quarkus (2.15.x) on JDK 17 and primefaces 12.0.0. Not attempting to native package but I am using openj9 as the base image in my test k8s environment. However, I did first notice that this error is thrown upon the first page interaction when the project is run in dev mode after issuing

Code: Select all

./mvnw compile quarkus:dev
.

Kind of hoping there is something obvious (perhaps a web.xml setting) that I'm overlooking in the configuration. I'd love a pointer in the right direction.

Thanks,
Dennis

Code: Select all

2023-01-20 12:47:27,643 ERROR [io.und.req.io] (executor-thread-3) Exception handling request 6daf9acc-ecdc-4042-af10-c4a9227704d3-1 to /javax.faces.resource/layout-tapestry-dim.css.xhtml: java.lang.NullPointerException: Cannot invoke "java.lang.String.length()" because "value" is null
        at org.apache.myfaces.resource.ValueExpressionFilterInputStream.read(ValueExpressionFilterInputStream.java:134)
        at java.base/java.io.InputStream.read(InputStream.java:293)
        at java.base/java.io.InputStream.read(InputStream.java:218)
        at org.apache.myfaces.application.ResourceHandlerImpl.pipeBytes(ResourceHandlerImpl.java:646)
        at org.apache.myfaces.application.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:589)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at org.primefaces.application.resource.PrimeResourceHandler.handleResourceRequest(PrimeResourceHandler.java:87)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:72)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        at org.omnifaces.filter.CacheControlFilter.doFilter(CacheControlFilter.java:239)
        at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:108)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:183)
        at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:108)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.omnifaces.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:123)
        at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:108)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
        at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)
        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)
        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.quarkus.undertow.runtime.RewriteCorrectingHandlerWrappers$PostWrapper$1.handleRequest(RewriteCorrectingHandlerWrappers.java:51)
        at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:110)
        at io.undertow.server.handlers.SecureCookieHandler.handleRequest(SecureCookieHandler.java:54)
        at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:93)
        at io.quarkus.undertow.runtime.RewriteCorrectingHandlerWrappers$PreWrapper$1.handleRequest(RewriteCorrectingHandlerWrappers.java:31)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:595)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:120)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:284)
        at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:417)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:857)

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 24 Jan 2023, 11:00
by mert.sincan
Interesting! Could you please attach your template.xhtml for us?

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 24 Jan 2023, 17:34
by gesker
I did not use the included template.xhtml. I just installed the jar (mvn install:install ... ), included the dependency in my pom.xml, dropped the css/scss/js/sass files in to the appropriate places in my resources folder and then referenced them from my index.xhtml. And, I updated the primefaces.THEME entry in my web.xml.

The colors scheme seems to apply fine and so far everything seems to function well. My IDE's linter also seems happy but still I am getting that error.

Here is what I "think" are the relevant parts of my index.xhtml.

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
>
<h:form id="main_form">

    <h:head>
        <!-- Remove some lines and add icon bar -->
        <!-- <h:outputStylesheet library="css" name="tweak.css"/> -->
        <!-- Rain Theme Begin -->
        <h:outputStylesheet library="css" name="primeflex.min.css"/>
        <h:outputStylesheet library="css" name="primeicons.css"/>
        <h:outputStylesheet library="css" name="layout-tapestry-dim.scss"/>
        <h:outputStylesheet library="css" name="layout-tapestry-dim.css"/>
    </h:head>


    <h:body onload="getLocation();">

        <p:growl id="growl" showDetail="true" sticky="false"/>
        
        <!-- snip out a bunch of tags -->

    </h:body>

    <h:outputScript library="js" name="layout.js"/>
    <h:outputScript library="js" name="prism.js"/>
    <ui:include id="geolocationScript" src="web/script/geolocationScript.xhtml"/>
</h:form>
</html>

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 27 Jan 2023, 00:31
by mert.sincan
Thanks a lot for the sample page! Firstly, please remove <h:outputStylesheet library="css" name="layout-tapestry-dim.scss"/> and could you please check layout-tapestry-dim.css file under resources/css folder in your project? Theme jar doesn't include layout styles.

Best Regards,

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 31 Jan 2023, 20:42
by gesker
Commented out <h:outputStylesheet library="css" name="layout-tapestry-dim.scss"/> and confirmed layout-tapestry-dim.css is under the css directory with the other style sheets. I also expanded the target jar just to double check that it was being packaged.

Still throwing the same error.

Something else I could check?

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 07 Feb 2023, 14:24
by olgubasak
Hi,
Unfortunately, I couldn't see the error either. Could you try running it in our sample project?

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 09 Feb 2023, 00:40
by gesker
By any chance is there a sample project with Quarkus? If what I'm getting is an error related to the layout of a Quarkus project that might help cut to the chase pretty quickly.

If not I can try pulling the application backing code out and copying over the relevant files.

BTW, thank you so much for looking at my issue. Very much appreciated.

Dennis

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 01 Mar 2023, 12:47
by cagatay.civici
I'm afraid Quarkus is out of the scope of the Rain template.

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 01 Mar 2023, 19:20
by gesker
Darn. Primefaces and Quarkus are great together. --drg

Re: Exception handling request /javax.faces.resource/layout-tapestry-dim.css.xhtml

Posted: 01 Aug 2023, 07:35
by mert.sincan
+1