[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1253) jboss-el resolver chain breaks on HashMap$Value

Stuart Robertson (JIRA) jira-events at lists.jboss.org
Thu Apr 26 09:43:30 EDT 2007

jboss-el resolver chain breaks on HashMap$Value

                 Key: JBSEAM-1253
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1253
             Project: JBoss Seam
          Issue Type: Bug
          Components: JSF
    Affects Versions: 1.2.1.GA
         Environment: Seam from CVS, JBoss 4.2.0CR2, Facelets
            Reporter: Stuart Robertson

HashMap$Value extends AbstractCollection, so I expected the following to work.  I'm creating a unordered list from the values in a Map.  Here's the xhtml:

<ui:repeat var="descriptor" value="#{catalogMapping.rawApplicableDescriptors.conditionalRequired}">
	<h:outputText value="#{descriptor.description}"/>

Here's the relevant bits in "rawApplicableDescriptors":

    private final Map<String, CatalogItemDescriptor> conditionalRequired = new HashMap<String, CatalogItemDescriptor>();

    public Collection<CatalogItemDescriptor> getConditionalRequired()
        return conditionalRequired.values();

But here's what I see:

Caused by: javax.el.PropertyNotFoundException: /members/catalog/mapping/applicable-fields.xhtml @20,54 value="#{descriptor.description}": Property 'description' not found on type java.util.HashMap$Values
	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)
	at javax.faces.component.UIOutput.getValue(UIOutput.java:173)

Tracing through in the debugger, all of the resolvers in the chain are called in sequence, and none of them can resolve the value.  It appears the one that is throwing (Wish I knew why Eclipse isn't showing the inner stacktrace) is BeanElResolver, from jboss-el.  Looks like NullPointer at:

	public Object getValue(ELContext context, Object base, Object property)
			throws NullPointerException, PropertyNotFoundException, ELException {
		if (context == null) {
			throw new NullPointerException();

Hmm.  Wait.  Duh.  The problem is't down here.  It's in the el's handling of 


ui:repeat should be iterating over the contents of the collection.  Meaning #{descriptor...} should be an instance of the contained type.  Instead 	<h:outputText value="#{descriptor.description}"/> is trying to resolve "description" as a property of the _collection itself_.  

I'm having trouble giving more detail on this one.  It should be very easy to reproduce.  Please let me know if there's anything I can do to help investigate.

Oh, and this works fine if I iterate over a list rather than a collection of type HashMap$Value

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list