When using PrimeFaces and faces-config together, I get a NullPointerException. Before adding faces-config.xml, everything worked fine. After I added faces-config.xml for changing navigation, I got the following Error when calling every page:
java.lang.NullPointerException
org.primefaces.context.PrimeFacesContext.release(PrimeFacesContext.java:26)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:612)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
de.mypackage.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:19)
The CharacterEncodingFilter just ensures usage of UTF-8:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);
}
So this can't be an error source. The faces-config.xml contains the following text:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>index</from-outcome>
<to-view-id>/index.jsf</to-view-id>
</navigation-case>
</navigation-rule>
This should direct every link to index to one index.jsf, not regarding in which folder the current site is. But if the faces-config.xml is just like this:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
the same error appears.
Everything is running on Tomcat 7.
The search for the error did not contain much results, in http://forum.primefaces.org/viewtopic.php?f=3&t=30109&start=10 someone seems to have the same problem with an old release of PrimeFaces 4.0, but as I'm getting it from maven, this can't be my error.
Has anybody an hint how to solve this problem?