[jboss-user] [JBoss Seam] - Problem in seam-gen reverse engineered database

dbinder do-not-reply at jboss.com
Wed Jun 27 12:13:33 EDT 2007


Hello,

I'm new to jboss-seam and I wanted to demonstrate the power of seam and seam-gen to my co-workers and bosses. I tried reverse engineer a recent application we developped to show the time that should have been spared. but ...
I ended up with exceptions (always of the same kind)

the exceptions seems to take place on relationship tables (thoses things you should simply not CRUD). I admit that the side of the application should be deleted in a real-life project but as I said it's for framework testing purpose;

here are the exception and incriminated beans and jsf.

JSF:

  | <s:link view="/CUtiliserOrList.xhtml" 
  | 	       value="CUtiliserOr List" 
  | 	 propagation="none"/>
  | 

exception:

  | javax.faces.el.PropertyNotFoundException: Bean: entity.CUtiliserOrList_$$_javassist_259, property: cUtiliserOr
  | 	at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:483)
  | 	at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:454)
  | 	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:417)
  | 	at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
  | 	at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
  | 	at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
  | 	at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
  | 	at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:69)
  | 	at org.jboss.seam.pages.Param.getValueFromModel(Param.java:93)
  | 	at org.jboss.seam.core.Pages.getPageParameterValue(Pages.java:615)
  | 	at org.jboss.seam.core.Pages.getConvertedParameters(Pages.java:591)
  | 	at org.jboss.seam.ui.HtmlLink.encodeBegin(HtmlLink.java:128)
  | 	at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:280)
  | 	at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:81)
  | 	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
  | 	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
  | 	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
  | 	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
  | 	at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  | 	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 	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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
  | 	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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
  | 	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:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	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(Unknown Source)
  | 

entity bean:

  | package entity;
  | // Generated 27 juin 2007 15:28:15 by Hibernate Tools 3.2.0.b9
  | 
  | import javax.persistence.AttributeOverride;
  | import javax.persistence.AttributeOverrides;
  | import javax.persistence.Column;
  | import javax.persistence.EmbeddedId;
  | import javax.persistence.Entity;
  | import javax.persistence.FetchType;
  | import javax.persistence.JoinColumn;
  | import javax.persistence.ManyToOne;
  | import javax.persistence.Table;
  | import org.hibernate.validator.NotNull;
  | 
  | /**
  |  * CUtiliserOr generated by hbm2java
  |  */
  | @Entity
  | @Table(name = "c_utiliser_or", catalog = "besace01")
  | public class CUtiliserOr implements java.io.Serializable {
  | 
  | 	private CUtiliserOrId id;
  | 	private Origine origine;
  | 	private Contrat contrat;
  | 
  | 	public CUtiliserOr() {
  | 	}
  | 
  | 	public CUtiliserOr(CUtiliserOrId id, Origine origine, Contrat contrat) {
  | 		this.id = id;
  | 		this.origine = origine;
  | 		this.contrat = contrat;
  | 	}
  | 
  | 	@EmbeddedId
  | 	@AttributeOverrides({
  | 			@AttributeOverride(name = "fkCContraintOr", column = @Column(name = "fk_c_contraint_or", nullable = false, length = 36)),
  | 			@AttributeOverride(name = "fkCUtiliserOr", column = @Column(name = "fk_c_utiliser_or", nullable = false, length = 36))})
  | 	@NotNull
  | 	public CUtiliserOrId getId() {
  | 		return this.id;
  | 	}
  | 
  | 	public void setId(CUtiliserOrId id) {
  | 		this.id = id;
  | 	}
  | 	@ManyToOne(fetch = FetchType.LAZY)
  | 	@JoinColumn(name = "fk_c_utiliser_or", nullable = false, insertable = false, updatable = false)
  | 	@NotNull
  | 	public Origine getOrigine() {
  | 		return this.origine;
  | 	}
  | 
  | 	public void setOrigine(Origine origine) {
  | 		this.origine = origine;
  | 	}
  | 	@ManyToOne(fetch = FetchType.LAZY)
  | 	@JoinColumn(name = "fk_c_contraint_or", nullable = false, insertable = false, updatable = false)
  | 	@NotNull
  | 	public Contrat getContrat() {
  | 		return this.contrat;
  | 	}
  | 
  | 	public void setContrat(Contrat contrat) {
  | 		this.contrat = contrat;
  | 	}
  | 
  | }
  | 

session.entity bean

  | package entity;
  | 
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.framework.EntityQuery;
  | import java.util.List;
  | import java.util.Arrays;
  | 
  | @Name("cUtiliserOrList")
  | public class CUtiliserOrList extends EntityQuery {
  | 
  | 	private static final String[] RESTRICTIONS = {
  | 			"lower(cUtiliserOr.id.fkCContraintOr) like concat(lower(#{cUtiliserOrList.cUtiliserOr.id.fkCContraintOr}),'%')",
  | 			"lower(cUtiliserOr.id.fkCUtiliserOr) like concat(lower(#{cUtiliserOrList.cUtiliserOr.id.fkCUtiliserOr}),'%')",};
  | 
  | 	private CUtiliserOr cUtiliserOr;
  | 
  | 	public CUtiliserOrList() {
  | 		cUtiliserOr = new CUtiliserOr();
  | 		cUtiliserOr.setId(new CUtiliserOrId());
  | 	}
  | 
  | 	@Override
  | 	public String getEjbql() {
  | 		return "select cUtiliserOr from CUtiliserOr cUtiliserOr";
  | 	}
  | 
  | 	@Override
  | 	public Integer getMaxResults() {
  | 		return 25;
  | 	}
  | 
  | 	public CUtiliserOr getCUtiliserOr() {
  | 		return cUtiliserOr;
  | 	}
  | 
  | 	@Override
  | 	public List<String> getRestrictions() {
  | 		return Arrays.asList(RESTRICTIONS);
  | 	}
  | 
  | }
  | 

Can someone help me find out where the problem comes from ?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058286#4058286

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058286



More information about the jboss-user mailing list