The secret to this problem is in the exception message "Error looking up property .... in object type "java.lang.String"
Since you are using struts use the <s:set /> tag to set the products List OGNL variable to a JSTL variable. Also it the class of the objects in your list is String and not the Product class you think you have. Please post your DAO, Manager and Action code so we can see why you have Strings instead of Products. -Dusty Rob Hills wrote: > > Hi All, > > I have a weird error on a Listing JSP that's had me stumped for several > hours. > > I have a POJO named "Product" and have built associated ProductDao, > ProductDaoHibernate, ProductManager, ProductManagerImpl > and ProductAction classes, as well as tests for Dao, Manager and Action. > I have a ProductList.jsp and I believe I've correctly configured all the > "glue" bits (bean defninitions in applicationContext.xml, action > definitions in struts.xml etc.). > > All tests pass OK and the web app starts up (Jetty + HSQLDB). > > However, when I go to view my products list, I get a blank page and the > following error: > > [myapp] WARN [btpool0-1] LookupUtil.<init>(99) | Exception: [.LookupUtil] > Error looking up property "id" in object type > "java.lang.String". Cause: Unknown property 'id' > java.lang.NoSuchMethodException: Unknown property 'id' > at > org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122) > at > org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:408) > at org.displaytag.util.LookupUtil.getProperty(LookupUtil.java:271) > at org.displaytag.util.LookupUtil.getBeanProperty(LookupUtil.java:129) > at org.displaytag.model.Column.getValue(Column.java:124) > at > org.displaytag.model.Column.createChoppedAndLinkedValue(Column.java:201) > at org.displaytag.model.Column.initialize(Column.java:178) > at > org.displaytag.render.TableWriterTemplate.writeTableBody(TableWriterTemplate.java:313) > at > org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:138) > at > org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:643) > at org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1557) > at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1206) > at > org.apache.jsp.WEB_002dINF.pages.admin.productList_jsp._jspService(org.apache.jsp.WEB_002dINF.pages.admin.productList_jsp: > 206) > <.. lots more ..> > > Unfortunately, at no point does the stacktrace drop into any of my own > classes, nor do any of my debug messages appear. > > The following snippet is from my ProductList.jsp: > > <c:set var="products" value="products" scope="request"/> > <display:table name="products" class="table" requestURI="" > id="productList" export="true" pagesize="25"> > <display:column property="id" sortable="true" href="editProduct.html" > media="html" > paramId="id" paramProperty="id" titleKey="product.id"/> > <display:column property="id" media="csv excel xml pdf" > titleKey="product.id"/> > <display:column property="name" sortable="true" > titleKey="product.name"/> > <.. lots more ..> > > My initial interpretation of the error message is that the "products" list > being returned by the c:set line in the jsp is actually coming in as > a list of strings and the server is complaining that the first String > doesn't contain an ID (which it wouldn't of course). However, I've been > back through my classes and the relevant methods are definitely returning > List<Product>. > > The first line of my ProductAction.list() method is a log.debug call that > never prints to the log so I'm at a loss to figure out what's going > on. > > Has anyone else seen anything like this before? Any thoughts on what > might be causing this problem, or where I should look? > > TIA, > Rob Hills > Waikiki, Western Australia > Mobile +61 (412) 904-357 > Fax: +61 (8) 9529-2137 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/AppFuse-2.0-%2B-Hibernate-%2B-Struts-2---Error-looking-up-property-%22id%22-tf4666835s2369.html#a13334575 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]