Set iteration error: org.hibernate.collection.PersistentSet,
kryptontri Mar 21, 2006 5:00 PMHi, I;m trying to iterate through a set of data
but when i try to retrieve values it fails with
21:51:09,278 ERROR [STDERR] 21-Mar-2006 21:51:09 com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View javax.el.ELException: /viewGalleryPage.xhtml: Bean: org.hibernate.collection.PersistentSet, property: 0 at com.sun.facelets.compiler.UIText.encodeBegin(UIText.java:51) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:511) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:518) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:447) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BasePro tocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 21:51:09,288 ERROR [STDERR] 21-Mar-2006 21:51:09 com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Took Type: java.io.PrintWriter
This is my view
<!-- Images -->
<c:choose>
<c:when test='${galleryPage.images == null}'>
Empty Gallery
</c:when>
<c:otherwise>
<c:forEach var="image" items="${galleryPage.images}">
Image Id is ${image}.id
</c:forEach>
</c:otherwise>
</c:choose>
<!-- End Images -->
And my backing bean
@Entity
@Name("galleryPage")
@Scope(SESSION)
@Inheritance(strategy = InheritanceType.JOINED)
public class GalleryPage extends Page {
private String description = null;
private Set<Image> images = new HashSet<Image>(0);
@NotNull
@Length (min = 5, max = 500, message = "Description is required and must be at most {max} characters long.")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="galleryPage")
public Set<Image> getImages() {
return images;
}
public void setImages(Set<Image> images) {
this.images = images;
}
public void addImage(Image image) {
this.images.add(image);
}
public void removeImage(Image image) {
this.images.remove(image);
}
Any ideas people? TIA