-
15. Re: Seam generate-entities failing
azavia Dec 2, 2006 4:38 AM (in response to azavia)Oh, just got this:
Error - /CommentEdit.xhtml: Bean: com.azavia.blog.User_$$_javassist_5, property: id An Error Occurred: /CommentEdit.xhtml: Bean: com.azavia.blog.User_$$_javassist_5, property: id - Stack Trace javax.el.ELException: /CommentEdit.xhtml: Bean: com.azavia.blog.User_$$_javassist_5, property: id at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48) at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:433) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:440) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:332) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:301) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:277) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:123) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:234) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580) 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.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32) 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.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46) 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.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(Thread.java:619) + Component Tree + Scoped Variables Dec 2, 2006 4:36:55 AM - Generated by Facelets
-
16. Re: Seam generate-entities failing
paradigmza Dec 13, 2006 3:44 PM (in response to azavia)Hi,
I have also been getting this error[hibernate] Expression pojo.identifierProperty is undefined on line 47, column 85 in view/list.xhtml.ftl. [hibernate] The problematic instruction: [hibernate] ---------- [hibernate] ==> ${pojo.identifierProperty.name} [on line 47, column 83 in view/list.xhtml.ftl] [hibernate] ---------- [hibernate] Java backtrace for programmers: [hibernate] ---------- [hibernate] freemarker.core.InvalidReferenceException: Expression pojo.identifierProperty is undefined on line 47, column 85 in view/list.xhtml.ftl. [hibernate] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) [hibernate] at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134) [hibernate] at freemarker.core.Dot._getAsTemplateModel(Dot.java:78) [hibernate] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) [hibernate] at freemarker.core.Expression.getStringValue(Expression.java:93) [hibernate] at freemarker.core.DollarVariable.accept(DollarVariable.java:76) [hibernate] at freemarker.core.Environment.visit(Environment.java:196) [hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
and the problem is with tables with composite primary keys.
I was using MySql And everything works perfectly until I add a table with a composite primary key.
create table `seantest`.`linktable` (
`link_fk` int(11) NOT NULL DEFAULT '0' ,
`link2_fk` int(11) NOT NULL DEFAULT '0' ,
PRIMARY KEY (`link_fk`,`link2_fk`)
)Engine=InnoDB;
Any ideas on how to fix this?
Thanks
Sean. -
17. Re: Seam generate-entities failing
gavin.king Dec 13, 2006 3:51 PM (in response to azavia)Composite keys are not yet supported by seam-gen. Why not work on a patch?
-
18. Re: Seam generate-entities failing
bunzee Dec 14, 2006 7:56 PM (in response to azavia)Hi,
I think there's a general issue when seam-gen is used to generate-entities from sqlserver (or postgresql). Basically the system table also got processed too and hibernate complains about missing primary key and whatnot.
Does any one know how to set it such that only the non-system tables get processed by seam?
Thank you,
BunZ -
19. Re: Seam generate-entities failing
maxandersen Dec 15, 2006 1:46 AM (in response to azavia)to limit the reverse engineering to a specific schema set hibernate.default_schema in build.properties.
-
20. Re: Seam generate-entities failing
bunzee Dec 15, 2006 9:58 AM (in response to azavia)Max,
Thank you for your help. Could you please show me how or point me to the reference where it said settting hibernate.schema_default in build properties.
I googled around and find some literature that said something like "hibernate.schema_default=SCHEMA". I suspect that SCHEMA is an XML file locate somewhere!!! Is this true? If yes, could you please point me to ref to an example of this SCHEMA file!
In general, I am pretty lost with the whole JBoss SEAM and how it uses hibernate. I search all over jboss seam directory but could not find any "hibernate related" xml file! (besides those in the example directories!)
Thanks a bunch,
BunZ -
21. Re: Seam generate-entities failing
gavin.king Dec 15, 2006 12:38 PM (in response to azavia)Last night I added prompts for default_schema and default_catalog to "seam setup". I didn't quite appreciate how important that was.
Grab a build of CVS if you like. -
22. Re: Seam generate-entities failing
maxandersen Dec 15, 2006 1:34 PM (in response to azavia)bunzee, a default_schema in context of hibernate has nothing to do with xml. It refers to the notion of a database schema.
until we get a new release from seam-gen or you start using the cvs build you will need to set it in the build.properties file manually.
you set it by just having a line similar to:
hibernate.default_schema=yourschemaname
where yourschemaname is the specific schema you want to reverse engineer. If you don't speicfy one seam gen will currently by default reverse engineer *all* schemas. -
23. Re: Seam generate-entities failing
bunzee Dec 18, 2006 2:55 AM (in response to azavia)Hi max,
Could you please post an example of a schema?
I am using sqlserver 2000 and lets say my database named myclass has 1 table named Student that has 3 columns: ID, name, and address.
If I want to reveng only the student table in the myclass database and no system table at all. How should I come about to do this?
Thank you,
bunZ -
24. Re: Seam generate-entities failing
maxandersen Dec 18, 2006 4:30 AM (in response to azavia)put the following line in default.properties:
hibernate.default_schema myclass -
25. Re: Seam generate-entities failing
bunzee Dec 18, 2006 12:28 PM (in response to azavia)Max,
Thank you. I understand that I should put the line: hibernate.default_schema myclass. My question is:
1. what is myclass? Is it some schema file generated by the database manager? Is it a java class called "myclass" in a "myclass.java" file?
Please be patient with me if I sound "rediculous" as I am a newbie in this.
thanks a bunch,
BunZ -
26. Re: Seam generate-entities failing
gavin.king Dec 18, 2006 12:47 PM (in response to azavia)Its the name of the database schema that the tables you want to reverse engineer exist in.
-
27. Re: Seam generate-entities failing
maxandersen Dec 18, 2006 2:26 PM (in response to azavia)"in the myclass database"
it was the name you use yourself for your database; I assumed that was the schema.
see http://en.wikipedia.org/wiki/Physical_schema for more background info. -
28. Re: Seam generate-entities failing
bunzee Dec 19, 2006 11:48 AM (in response to azavia)Hi Max and Gavin,
I googled around and found this discussion:
http://channel9.msdn.com/ShowPost.aspx?PostID=259075
It seemed to me that the schema is something like:
{server}.{database}.{owner}.{object}
When I set:
hibernate.default_schema=bunzee
And the tables in the sql2000 dbase have: dbo as owner for system table and bunzee as owner for mytable
Then <seam generate-entities> picks up the right table.
Is my understanding of the "schema" correct?
If it is, is there a way to assign hibernate.default_schema such that all table with prefix "sys" should be ignored (since sql2000 prefix all system tables with sys)?
If I have to filter by owner of the table, it could be problem for us since many of our existing tables are dbo (same owner as system tables).
Thanks a lot guys,
bunz -
29. Re: Seam generate-entities failing (check jms tables)
lpmon Dec 20, 2006 9:42 AM (in response to azavia)Several 'standard' JMS tables have composite primary keys. (jms_messages, jms_subscriptions, ..)
So: It seems like almost everyone would run into this issue using stndard JBoss. ?????
I encountered this problem. When I removed the JMS tables the problem was gone. Alternative might be: temporarilty alter the JMS keys then restore them later.