11 Replies Latest reply on Dec 22, 2008 4:15 AM by huix jan

    Wrong JBossTools Entity Generation on DB Table Name with Und

    kabil akpınar Newbie

      Hi,
      For about a week I worked on a Seam Web Project which uses a mysql db in which table names include underscore like o_test_test_test_test.
      When I generate entities from eclipse, it generates all files but when I try to execute application, it says like:

      Property 'oTestTestTestTest' not found on type org.domain.testseam.session.OTestTestTestTestList_$$_javassist_1

      After trying an other sample like otesttesttesttest table Generation creates correct files and web application runs normally.

      My Environment is:
      Eclipse Europa Winter
      JBossTools 2.1.1.GA
      JBoss Seam 2.1.0.SP1
      MySQL 5.0.67
      JBoss AS 4.2.3 GA

      SQL file for DB is below, I would also like to add project in here.

      -- MySQL dump 10.11
      --
      -- Host: localhost Database: sixtmin
      -- ------------------------------------------------------
      -- Server version 5.0.67-community-nt

      /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
      /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
      /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
      /*!40101 SET NAMES utf8 */;
      /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
      /*!40103 SET TIME_ZONE='+00:00' */;
      /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
      /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
      /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
      /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

      --
      -- Table structure for table `o_test_test_test_test`
      --

      DROP TABLE IF EXISTS `o_test_test_test_test`;
      SET @saved_cs_client = @@character_set_client;
      SET character_set_client = utf8;
      CREATE TABLE `o_test_test_test_test` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `namewer` varchar(45) NOT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
      SET character_set_client = @saved_cs_client;

      --
      -- Dumping data for table `o_test_test_test_test`
      --

      LOCK TABLES `o_test_test_test_test` WRITE;
      /*!40000 ALTER TABLE `o_test_test_test_test` DISABLE KEYS */;
      INSERT INTO `o_test_test_test_test` VALUES (1,'test'),(2,'test2');
      /*!40000 ALTER TABLE `o_test_test_test_test` ENABLE KEYS */;
      UNLOCK TABLES;
      /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

      /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
      /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
      /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
      /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
      /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
      /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
      /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

      -- Dump completed on 2008-12-18 23:58:48

        • 1. Re: Wrong JBossTools Entity Generation on DB Table Name with
          Max Rydahl Andersen Master

          underscores should just work fine; so need to know the full stacktrace of that exception and what code/xhtml that causes it ?

          • 2. Re: Wrong JBossTools Entity Generation on DB Table Name with
            kabil akpınar Newbie


            You can download Generated Files at

            http://rapidshare.com/files/174793249/testseam.rar.html

            Stack Trace is below,

            SEVERE: Error Rendering View[/home.xhtml]
            javax.el.PropertyNotFoundException: Property 'oTestTestTestTest' not found on type org.domain.testseam.session.OTestTestTestTestList_$$_javassist_1
             at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
             at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
             at javax.el.BeanELResolver.property(BeanELResolver.java:279)
             at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
             at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
             at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
             at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
             at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
             at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
             at org.jboss.seam.navigation.Param.getStringValueFromModel(Param.java:133)
             at org.jboss.seam.navigation.Pages.getStringValuesFromModel(Pages.java:765)
             at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBase.java:62)
             at org.jboss.seam.ui.renderkit.LinkRendererBase.doEncodeBegin(LinkRendererBase.java:26)
             at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
             at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
             at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
             at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:103)
             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
             at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
             at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
             at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
             at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
             at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
             at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
             at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
             at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
             at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
             at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
             at java.lang.Thread.run(Thread.java:619)
            10:55:23,250 ERROR [STDERR] Dec 19, 2008 10:55:23 AM com.sun.facelets.FaceletViewHandler handleRenderException
            SEVERE: Error Rendering View[/home.xhtml]
            javax.el.PropertyNotFoundException: Property 'oTestTestTestTest' not found on type org.domain.testseam.session.OTestTestTestTestList_$$_javassist_1
             at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
             at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
             at javax.el.BeanELResolver.property(BeanELResolver.java:279)
             at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
             at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
             at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
             at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
             at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
             at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
             at org.jboss.seam.navigation.Param.getStringValueFromModel(Param.java:133)
             at org.jboss.seam.navigation.Pages.getStringValuesFromModel(Pages.java:765)
             at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBase.java:62)
             at org.jboss.seam.ui.renderkit.LinkRendererBase.doEncodeBegin(LinkRendererBase.java:26)
             at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
             at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
             at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
             at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:103)
             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
             at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
             at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
             at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
             at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
             at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
             at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
             at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
             at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
             at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
             at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
             at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
             at java.lang.Thread.run(Thread.java:619)
            



            • 3. Re: Wrong JBossTools Entity Generation on DB Table Name with
              Max Rydahl Andersen Master

              kabil,

              No really fun to have wait 1 minute for a simple download...next time please just show the relevant part of the file instead of everything.

              The error says that it has a problem finding the property oTestTestTestTest in home.xhtml - but there is no such reference in the files you sent.

              What did you do to get the error ?

              In any case I think I know what is causing the error. Your table starts with o_test which result in OTest which in javabeans spec result in the property to be named OTest and not oTest because of the double capitals. I got a feeling that Seam-gen's templates does not "obey" those rules strictly enough as the code generation does.

              So if you go an rename whatever reference you have from oTest... to OTest it should work.





              In any case I think what is the problem
              And looking at the class OTestTestTestTestList.java the method getOTestTestTestTestList

              • 4. Re: Wrong JBossTools Entity Generation on DB Table Name with
                kabil akpınar Newbie

                I am sorry about file download issue...

                Yes I could also guess the error on generation about starting capitals on object name, hence changing names manually should work. Bu many generated files contains same naming convention and this requires many changes.

                But in fact I wonder is it a bug in in seam generation of ui files?

                You asked -> What did you do to get the error ?

                In fact I am developing a project which uses mysql db with the names like o_vehicle_type vs. So I generated using JBoss Tools and make no change to project and similar exception occurred. So After I created this sample project and I got the same problem. I mean I did not touch the generated files.

                • 5. Re: Wrong JBossTools Entity Generation on DB Table Name with
                  Max Rydahl Andersen Master

                  well, I assume you don't want to have an o_ in the beginning of every class name ?

                  I suggest you should use a programming reverse engineering strategy which will allow you to remove the o_ prefix.

                  But yes, this is an error in the seamgen templates afaik.

                  • 6. Re: Wrong JBossTools Entity Generation on DB Table Name with
                    kabil akpınar Newbie

                    Many thanks four your help firstly.

                    In order to resolve this issue in next releases, what can it be done?

                    Can I post an issue on jira?

                    • 7. Re: Wrong JBossTools Entity Generation on DB Table Name with
                      Max Rydahl Andersen Master

                      it needs to be fixed in seam-gen templates - post a jira in seam's jira and put the link here.

                      • 9. Re: Wrong JBossTools Entity Generation on DB Table Name with
                        huix jan Newbie

                        I have post this issue on seam's forums for half year,just not post it on jira.Half year passed,this issue is still there.
                        http://www.seamframework.org/Community/SeamGenToolBug

                        • 10. Re: Wrong JBossTools Entity Generation on DB Table Name with
                          Max Rydahl Andersen Master

                          huixjan, how about posting it to jira then ? Don't expect bugs reported only in forums will be fixed.