wood burning stoves*
The moose likes JSF and the fly likes NamespaceHandler giving NPE for UI tag library in JSF2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "NamespaceHandler giving NPE for UI tag library in JSF2" Watch "NamespaceHandler giving NPE for UI tag library in JSF2" New topic

NamespaceHandler giving NPE for UI tag library in JSF2

Deepa More
Ranch Hand

Joined: May 22, 2006
Posts: 68
We are migrating from JSF1.2 to JSF2 using Websphere 8 server (in IRAD8) and using apache myfaces for JSF.
Web.xml is changed to version 3.0

and faces-config.xml to version 2.0

In my web project, I have following jars in WEB-INF/lib:

While rendering jsf page that has ui:composition tag, it gives NPE at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57).

After debugging I found that for ui:composition tag it creates org.apache.myfaces.view.facelets.compiler.TrimmedTagUnit object in org.apache.myfaces.view.facelets.compiler.CompilationManager.pushTag(Tag) method line 221.
On this TagUnit when createFaceletHandler() is invoked it further calls org.apache.myfaces.view.facelets.tag.CompositeTagLibrary.createTagHandler(..) that checks if the list of namespaces (these are namespaces in .taglib.xml file in META-INF of the jars present in WEB-INF/lib directory) contains required namespace of facelet "http://java.sun.com/jsf/facelets".
There is no jar in WEB-INF/lib that contains the taglib and hence it returns handler as null.

What could have gone wrong here? Did I missed any library to add in lib folder?
I agree. Here's the link: http://aspose.com/file-tools
subject: NamespaceHandler giving NPE for UI tag library in JSF2
Similar Threads
EJB3 - NullPointerException with @EJB Injection
JSF2 Composite Components. I meeting a problem about package the component in a jar.
JSF2 on Tomcat6
JSF 2 on Tomcat 6
@PostConstruct Method Not Called In JSF 2.0