Friday, July 12, 2013

ATG Error: PropertyNotFoundException: The class 'atg.adapter.gsa.GSAItem' does not have the property …"

Earlier today, I was investigating a problem where a particular JSP page in an ATG Commerce application failed rendering midway through.  In the ATG application log, the following stack trace appeared:

<Jul 12, 2013 1:37:36 PM EDT> <Error> <HTTP> <WL-101020> <[ServletContext@1926834063[app:myApp-unpacked module:app path:/root spec-version:2.5]] Servlet failed with Exception
javax.el.PropertyNotFoundException: The class 'atg.adapter.gsa.GSAItem' does not have the property 'name'.
    at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:579)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:281)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:185)
    at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
    at weblogic.servlet.jsp.ELHelper.evaluate(ELHelper.java:32)
    at jsp_servlet._web_45_inf._fragments._panels._lists.__page._jsp__tag6(__page.java:357)
    ...

The problem turned out to be that an upstream JSP that was passing an object parameter into the page I was looking at had had a bug introduced where it started passing an object of type RepositoryItem, instead of the expected type.  The error occurred when my JSP code assumed that the parameter object was of a particular type, and attempted to call a method on the object that didn’t exist on the RepositoryItem object.

1 comment:

  1. If you want you can check the item type, before accessing its properties.
    On JSP page,
    ${item.itemDescriptor.itemDescriptorName=='product'}

    ReplyDelete