2.6 NPE in CDNResourceHandler #339

Closed
djmj opened this Issue Jan 14, 2017 · 4 comments

Projects

None yet

2 participants

@djmj
djmj commented Jan 14, 2017 edited

I tried to merge from 1.8.1 to 2.6 snapshop since CDNResourceHandler supports locale resources again but i get a NPE trying to load a simple resource like:

<link rel="shortcut icon" href="#{resource['cdn-img:favicon_16.png']}" type="image/x-icon"/>

DefaultResourceHandler

getWrapped().createResource(resourceName, libraryName) seems to return null. While debugging i saw that PrimeFacesExtensionResourceHandler and OmniResourceHandler were also called.

There is no null check for the resource in CDNResourceHandler.decorateResource ?

java.lang.NullPointerException
at org.omnifaces.resourcehandler.RemappedResource.(RemappedResource.java:57)
at org.omnifaces.resourcehandler.CDNResourceHandler.decorateResource(CDNResourceHandler.java:248)
at org.omnifaces.resourcehandler.DefaultResourceHandler.createResource(DefaultResourceHandler.java:76)
at com.sun.faces.renderkit.html_basic.StylesheetRenderer.encodeEnd(Unknown Source)
at javax.faces.component.UIComponentBase.encodeEnd(Unknown Source)
at javax.faces.component.UIComponent.encodeAll(Unknown Source)
at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:93)
at javax.faces.component.UIComponentBase.encodeBegin(Unknown Source)
at javax.faces.component.UIComponent.encodeAll(Unknown Source)
at javax.faces.component.UIComponent.encodeAll(Unknown Source)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(Unknown Source)
at com.sun.faces.application.view.MultiViewHandler.renderView(Unknown Source)
at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:196)
at javax.faces.application.ViewHandlerWrapper.renderView(Unknown Source)
at javax.faces.application.ViewHandlerWrapper.renderView(Unknown Source)
at org.omnifaces.viewhandler.OmniViewHandler.renderView(OmniViewHandler.java:121)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
at com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
at javax.faces.webapp.FacesServlet.service(Unknown Source)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

@BalusC
Member
BalusC commented Jan 14, 2017

Ahh and I released 2.6-RC1 just two hours ago :)

This is indeed an oversight. It happened after I fixed a Sonar warning wrt serialization on RemappedResource class. I'll look into it and add an integration test on this.

@BalusC BalusC closed this Jan 14, 2017
@BalusC BalusC reopened this Jan 14, 2017
@BalusC BalusC closed this in c84350d Jan 14, 2017
@BalusC
Member
BalusC commented Jan 14, 2017

Fixed, it's available in today's latest 2.6-SNAPSHOT.

Thank you for reporting this issue!

@djmj
djmj commented Jan 15, 2017

Thank you for that quick fix.
The RC-1 candidate to download does not has this fix though.

@BalusC
Member
BalusC commented Jan 16, 2017 edited

You're welcome. No, RC1 was released a hour before you opened this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment