File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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(

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 "".
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?
subject: NamespaceHandler giving NPE for UI tag library in JSF2
It's not a secret anymore!