I just tried to add a composite JSF component into my weld project on glassfish 3.1.2. This always fails with a null pointer exception. I traced down the problem and found out, that it results from the following code within the class com.sun.faces.application.ApplicationImpl.
@Override
public UIComponent [More ...] createComponent(FacesContext context, Resource componentResource) throws FacesException {
// RELEASE_PENDING (rlubke,driscoll) this method needs review.
Util.notNull("context", context);
Util.notNull("componentResource", componentResource);
UIComponent result = null;
// use the application defined in the FacesContext as we may be calling
// overriden methods
Application app = context.getApplication();
ViewDeclarationLanguage pdl = app.getViewHandler().getViewDeclarationLanguage(context, context.getViewRoot().getViewId());
BeanInfo componentMetadata = pdl.getComponentMetadata(context, componentResource);
....
The problem seems to be, that the ViewDeclarationLanguage pdl result to null and therefore the call for getComponentMetadata(...) result in the NPE.
The question is, why is this ViewDeclarationLanguage null? Is there anything special in this stack or do I have to configure any further properties?
Thank you very much for your help!
Thomas