1

Before I go post an issue, Hope you can answer this (looks like a bug) brand new project, GF 4.0, OmniFaces 1.6.3

Followed all instructions, but getting this exception

Caused by: java.lang.NullPointerException
at org.omnifaces.util.FacesLocal.getRequestMap(FacesLocal.java:913)
at org.omnifaces.util.FacesLocal.getRequestAttribute(FacesLocal.java:921)
at org.omnifaces.util.Faces.getRequestAttribute(Faces.java:1381)
at org.omnifaces.eventlistener.CallbackPhaseListener.getCallbackPhaseListeners(CallbackPhaseListener.java:110)
at org.omnifaces.eventlistener.CallbackPhaseListener.afterPhase(CallbackPhaseListener.java:77)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
... 37 more

This works: localhost:8080/WEB-APP/javax.faces.resource/layout/my_layout.css

This does NOT work (Exception above): localhost:8080/WEB-APP/javax.faces.resource/layout/my_layout.css.html

This does NOT work (Exception above): localhost:8080/WEB-APP/javax.faces.resource/layout/my_layout.css.jsf

<h:graphicImage> , <h:outputStylesheet> etc. will generate the .jsf / .html extension, thus all fails.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I'm unable to reproduce it. With GF4, the `` and `` produce the right URLs without JSF mapping. If I request the resource individually with "wrong" URL (with `.jsf` extension), then I get -as expected- a 404. Perhaps your project setup is messed up? The exception at least indicates that `FacesContext#getCurrentInstance()` or perhaps `getExternalContext()` returned `null`, which is quite strange at that point. Your indication that the components didn't generate the right URL indicates that there's another resource handler registered which has overriden it. – BalusC Nov 04 '13 at 12:03
  • Thanks. I will try completely new project on another VM and get back to you. – Lenny Primak Nov 05 '13 at 18:18
  • You are right, @BalusC . Going with a clean domain on another VM stops the problem from happening on an example project, but I am still unable to integrate with my existing project. Do you think there could be any interactions with other servlet filters of some kind perhaps? Does OmniFaces use a servlet filter of its own that could be interacting with something I am using? I know it's not a lot to go on, but I am stumped, for now, but I will be trying to isolate this further. Thank you for your help so far – Lenny Primak Nov 06 '13 at 10:12
  • OmniFaces does not use servlet filters for this feature. On the other hand, it's theoretically quite possible that a 3rd party or a custom servlet fitler is causing all this trouble. – BalusC Nov 06 '13 at 10:16

1 Answers1

1

This can happen when UnmappedResourceHandler isn't actually included in faces-config.xml

My faces-config.xml has <javaee:faces-config> instead of <faces-config> so none of the directives inside were actually getting executed.