New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6 NPE in CDNResourceHandler #339

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

Comments

Projects
None yet
2 participants
@djmj

djmj commented Jan 14, 2017

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

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jan 14, 2017

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jan 14, 2017

Member

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

Thank you for reporting this issue!

Member

BalusC commented Jan 14, 2017

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

Thank you for reporting this issue!

@djmj

This comment has been minimized.

Show comment
Hide comment
@djmj

djmj Jan 15, 2017

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

djmj commented Jan 15, 2017

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

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jan 16, 2017

Member

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

Member

BalusC commented Jan 16, 2017

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