0

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

Thomas
  • 41
  • 2
  • 4

1 Answers1

0

I found the solution myself, but would like to share it, if someone else stumbles over the same problem.

Within the faces-config, there was a definition of a custom view-handler. This view-handler did not handle this request correctly, so I changed it to the "org.jboss.weld.jsf.ConversationAwareViewHandler".

Now it works!

Thomas
  • 41
  • 2
  • 4