7 Replies Latest reply on Oct 15, 2010 5:18 PM by Philippe Leménager

    Simple Seam app configured for Tomcat

    Philippe Leménager Newbie

      Hello Seamians !

       

      I've been trying to config a simple seam test project for Tomcat 6 using JBoss Tools but it still doesn't work after reading many things about it on the Internet and trying the solutions proposed.

       

      1) New Seam Web Project

      1.a) Seam web project window

      Project name : projettest

      Target runtime : Apache Tomcat v6.0

      Dynamic web module version : 2.5 (default choice)

      Target Server : Tomcat v6.0 Server at localhost

      Configuration : Dynamic Web Project with Seam 2.2 (default choice)

      NEXT

       

      1.b) Java

      NEXT

       

      1.c) Web Module

      NEXT

       

      1.d) JSF Capabilities

      After some unsuccessfull tries, I've created a user-library with jsf-api.jar and jsf-impl.jar taken in jboss-seam-2.2.0.GA/lib directory and selected this new library + "Include libraries with this application". I lived the other things by default.

      NEXT

       

      1.d) Seam Facet

      Seam Runtime : jboss-seam-2.2.0.GA

      Deploy as : WAR

      Database type : MySQL5 (InnoDB)

      Connection profile MysQL Test (configured and tested)

      Database Schema Name : Test

      Database Catalog Name : Test

      DB Tables already exists in database : selected (the database contains only one simple table called users (usr_id, username, name, password) with two lines inside).

      I leaved the other options as default.

      FINISH

       

      => The project has been created without errors.

       

      2) Changing some things, after reading issues about this operation.

      2.a) projettest/WebContent/META-INF/context.xml

       

       

      2.b) projettest/WebContent/WEB-INF/classes/META-INF/persistence.xml

       

       

      2.c) projettest/WebContent/WEB-INF/components.xml

      I've deleted all params in tag <core:init />

       

      2.d) projettest/WebContent/WEB-INF/pages.xml

      I've commented the last tag <exception>, this one :

      <!-- <exception>
              <redirect view-id="/error.xhtml">
                  <message severity="error">Unexpected error, please try again</message>
              </redirect>
          </exception> -->

       

      2.e) Added jars

      I copied from jboss-seam-2.2.0.GA/lib those jars :

      - commons-collections.jar

      - commons-lang.jar

      - commons-logging.jar

      - concurrent.jar

      - dom4j.jar

      - hibernate-annotations.jar

      - hibernate-common-annotations.jar

      - hibernate-core.jar

      - hibernate-entitymanager.jar

      - hibernate-search.jar

      - hibernate-validator.jar

      - javassist.jar

      - jboss-common-core.jar

      - jta.jar

      - log4j.jar

      - lucene-core.jar

      - persistence-api.jar

      - slf4j-api.jar

      - slf4j-log4j12.jar

       

      2.f) log4j.xml

      I've copied the file log4j.xml from jboss-seam-jpa example project to projettest/WebContent/WEB-INF/classes.

       

      3) Starting Tomcat and trying to access to the project

      There is no error when I start Tomcat, just this info message :

      org.apache.catalina.core.StandardContext addApplicationListener
      INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.

       

      I also have this WARN :

      WARN  [PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.

       

      When I type http://localhost:8080/projettest in Firefox, I already have the "Welcome to Seam!" page with the url http://localhost:8080/projettest/home.seam but some errors appears in Tomcat console :

      12:22:09,217 ERROR [SeamPhaseListener] swallowing exception
      java.lang.RuntimeException: exception invoking: getTransaction
          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)

      ...

      Caused by: javax.naming.NamingException: Cannot create resource instance
          at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)

      ...

      12:22:09,310 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
      java.lang.IllegalStateException: Could not commit transaction
          at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)

      ...

      Caused by: java.lang.RuntimeException: exception invoking: getTransaction
          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)

      ...

      Caused by: javax.naming.NamingException: Cannot create resource instance
          at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)

      ...

      Many times the same errors.

       

      4) Generate entities

      4.1) New Seam Generate Entities

      Reverse engineer from database is selected

      NEXT

       

      4.2) Select Tables

      I had to click on the Refresh button because no database had appeared. Then I selected Test database and clicked on the Include button.

      FINISH

       

      => Some more files have been generated successfully.

       

      5) Trying to browse data

      After reloading the home page, a "Browse Data / Users List" menu appears. When I click on it, I already have the UsersList.seam page with some more ERROR [SeamPhaseListener] swallowing exception in Tomcat Console.

      If I click on the Search button, with ou without something in the fields of the page, the application crashes with these errors :

      org.apache.catalina.core.StandardWrapperValve invoke
      GRAVE: "Servlet.service()" pour la servlet Faces Servlet a généré une exception
      javax.el.PropertyNotFoundException: /UsersList.xhtml @19,81 value="#{usersList.users.username}": Target Unreachable, identifier 'usersList' resolved to null
          at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)

      ...

       

      I've searched on the Internet but didn't find clear explanation and solution.

       

      Someone here can help me ?

       

      Thanks in advance.

        • 1. Re: Simple Seam app configured for Tomcat
          Denis Golovin Master

          Following your notes I got through all problems you explained. Last problems seems to be in persistence.xml and compomemt.xml. I finally get my application working by fixing those two files as explained here Running seam-gen project on apache tomcat without embedded JBoss. I also joined src/main and src/hot source folders, because I was not sure if hot deployment supported uder tomcat. Last thing I did was antlr.jar added to WEB-INF/lib to fix class not found exception related to antlr parser.

          • 2. Re: Simple Seam app configured for Tomcat
            Philippe Leménager Newbie

            On my test project, this error has finally been resolved.

            You don't have to specify Database Schema Name and Database Catalog Name but only one one these parameters. With the catalog, you can browse the database when you Seam Generate Entities to choose the tables to work with in your application.

            I don't remember if it's the only action required to fix it.

             

            I now have on my real project, generated with the same method, another error :

            13 oct. 2010 17:29:51 com.sun.facelets.FaceletViewHandler handleRenderException
            GRAVE: Error Rendering View[/TEPersonnePrsList.xhtml]
            javax.faces.FacesException: javax.el.PropertyNotFoundException:  /TEPersonnePrsList.xhtml @19,93  value="#{tEPersonnePrsList.tEPersonnePrs.prsNom}": Property  'tEPersonnePrs' not found on type  org.domain.stamas.session.TEPersonnePrsList_$$_javassist_seam_2
            at javax.faces.component.UIOutput.getValue(UIOutput.java:187)
            ...
            Caused by: javax.el.PropertyNotFoundException: /TEPersonnePrsList.xhtml  @19,93 value="#{tEPersonnePrsList.tEPersonnePrs.prsNom}": Property  'tEPersonnePrs' not found on type  org.domain.stamas.session.TEPersonnePrsList_$$_javassist_seam_2
            at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)

             

            My table is called t_e_peronne_prs and I havn't made any change in the java or xhtml files generated by Seam Generate Entities.

             

            I've serached on the Internet but didn't found anything for me.

            • 3. Re: Simple Seam app configured for Tomcat
              Denis Golovin Master

              Would be good to know some details about your app. If you would post MySQL DDL for tEPersonnePrs that would let me generate the same code and verify it on my side.

              • 4. Re: Simple Seam app configured for Tomcat
                Philippe Leménager Newbie

                OK, here is the detail of the operations I've done.

                 

                1) File / New / Seam Web Project

                1.1) Window "Seam Web Project"

                Project name : stamas

                Project contents : Use default

                Target Runtime : Apache Tomcat v6.0

                Dynamic web module version : 2.5
                Target Server : Tomcat v6.0 at localhost
                Configuration : Default Configuration for Apache Tomcat v6.0

                => Clic on Modify + Java Persistence, Java Server Faces and Seam

                => Save As "Seam + Tomcat"

                => OK

                Configuration : Seam + Tomcat

                Next >

                 

                1.2) Window "Java"

                Next >

                 

                1.3) Window "Web module"

                Next >

                 

                1.4) Window "JPA Facet"

                Platform : Hibernate (défaut)
                JPA Implementation :
                    Type : EclipseLink 1.1.x
                    Include libraries with this application is selected

                Connection : MySQL Stamas

                Clic on Connect => "Override default schema from connection" option appears

                Add driver library to buid path : selected

                Driver : MySQL JDBC Driver

                Override default schema from connection : selected

                Schema : stamas

                Persistent class management : Discover annotated classes automatically

                Create orm.xml : not selected

                Next >

                 

                1.5) Window "JSF Capabilities"
                JSF implementation library
                    Type : User Library

                     I've created a library called seam-jsf with jsf-api.jar and jsf-impl.jar from jboss-seam-2.2.0.GA/lib

                     The new library seam-jsf is selected

                     Include librairies with this application is selected

                Other params by default.

                Next >

                 

                1.6) Window "Seam Facets"
                Seam runtime : jboss-seam-2.2.0.GA
                Deploy as : WAR
                Database type : MySQL5 (InnoDB)
                DB Tables already exists in database : selected

                Recreate database tables and data on deploy : not selected

                Other params by default.

                Finish >

                 

                2) Tries of lauching the project

                I've tried several times to launch the default application created by JBoss Tools, by right click on the project then Run As / Run on server, and I had many successive errors that I've fixed by these operations :

                2.1) Concole message : "INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:..."

                Ignored

                 

                2.2) Console message : INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.

                Open stamas/WebContent/WEB-INF/web.xml and comment :

                <listener>
                    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                </listener>

                 

                 

                2.3) Adding jars

                In order to fix the java.lang.ClassNotFoundException errors, I've copied these jars from jboss-seam-2.2.0.GA/lib to stamas/WebContent/WEB-INF/lib/

                commons-collections.jar
                commons-logging.jar
                dom4j.jar
                hibernate-annotations.jar
                hibernate-commons-annotations.jar
                hibernate-core.jar
                hibernate-entitymanager.jar
                hibernate-validator.jar
                javassist.jar
                jta.jar
                log4j.jar
                slf4j-api.jar
                slf4j-log4j12.jar

                 

                2.4) Console message : ATTENTION: no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.

                Ignored for the moment. My test app is OK with this message.

                 

                2.5) Box message : "Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."

                Open stamas/WebContent/WEB-INF/components.xml and erase the params in tag <core>

                Original : <core:init debug="true" jndi-pattern="@jndiPattern@"/>

                Becomes : <core:init />

                 

                Open stamas/WebContent/WEB-INF/pages.xml and comment the last exception tag :

                <exception>
                    <redirect view-id="/error.xhtml">
                        <message severity="error">Unexpected error, please try again</message>
                    </redirect>
                </exception>

                 

                The "Welcome to Seam!" page appears but many groups of two errors in the console :

                 

                2.6) GRAVE: swallowing exception
                java.lang.RuntimeException: exception invoking: getTransaction
                Caused by: javax.naming.NamingException: Cannot create resource instance
                    at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)

                 

                ATTENTION: uncaught exception, passing to exception handler
                java.lang.IllegalStateException: Could not commit transaction
                    at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)
                Caused by: java.lang.RuntimeException: exception invoking: getTransaction
                    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)
                Caused by: javax.naming.NamingException: Cannot create resource instance
                    at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)

                 

                Open stamas/WebContent/WEB-INF/components.xml

                Add this :

                xmlns:transaction="http://jboss.com/products/seam/transaction"
                http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd
                <transaction:entity-transaction entity-manager="#{entityManager}"/>

                 

                There is the begining of the file :

                <?xml version="1.0" encoding="UTF-8"?>
                <components xmlns="http://jboss.com/products/seam/components"
                            xmlns:core="http://jboss.com/products/seam/core"
                            xmlns:persistence="http://jboss.com/products/seam/persistence"
                            xmlns:drools="http://jboss.com/products/seam/drools"
                            xmlns:bpm="http://jboss.com/products/seam/bpm"
                            xmlns:security="http://jboss.com/products/seam/security"
                            xmlns:mail="http://jboss.com/products/seam/mail"
                            xmlns:web="http://jboss.com/products/seam/web"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xmlns:transaction="http://jboss.com/products/seam/transaction"
                            xsi:schemaLocation=
                                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd
                                 http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd">

                 

                   <core:init />

                 

                   <core:manager concurrent-request-timeout="500"
                                 conversation-timeout="120000"
                                 conversation-id-parameter="cid"
                                 parent-conversation-id-parameter="pid"/>

                 

                   <transaction:entity-transaction entity-manager="#{entityManager}"/>

                 

                2.7) [EL Severe]: 2010-10-13 10:28:38.958--ServerSession(1872202644)--Local Exception Stack:
                Exception [EclipseLink-4021] (Eclipse Persistence Services - 1.1.3.v20091002-r5404): org.eclipse.persistence.exceptions.DatabaseException
                Exception Description: Unable to acquire a connection from driver [null], user [null] and URL [null].  Verify that you have set the expected driver class and URL.  Check your login, persistence.xml or sessions.xml resource.  The jdbc.driver property should be set to a class that is compatible with your database platform
                    at org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:375)

                 

                Modifiy stamas/src/META-INF/persistence.xml like this :

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence version="1.0"
                    xmlns="http://java.sun.com/xml/ns/persistence"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                >
                    <persistence-unit name="stamas" transaction-type="RESOURCE_LOCAL">
                        <provider>org.hibernate.ejb.HibernatePersistence</provider>
                        <non-jta-data-source>java:comp/env/jdbc/stamasDatasource</non-jta-data-source>
                        <properties>
                            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
                            <property name="hibernate.hbm2ddl.auto" value="update" />
                            <property name="hibernate.show_sql" value="true" />
                            <property name="hibernate.format_sql" value="true" />
                            <property name="hibernate.default_catalog" value="stamas"/>
                        </properties>
                    </persistence-unit>
                </persistence>

                 

                2.8) Console message : log4j:WARN No appenders could be found for logger (javax.servlet.ServletContextListener).
                log4j:WARN Please initialize the log4j system properly.

                 

                Copy jboss-seam-2.2.0.GA/examples/jpa/resources-tomcat/WEB-INF/classes/logj4.xml in stamas/WebContent/WEB-INF/classes/

                 

                2.9) Console message : ERROR [DatasourceConnectionProvider] Could not find datasource: java:comp/env/jdbc/stamasDatasource
                javax.naming.NameNotFoundException: Le Nom jdbc n'est pas lié à ce Contexte (=> translate : JDBC name is not linked to this context)

                 

                Create file stamas/WebContent/META-INF/context.xml

                <?xml version="1.0" encoding="UTF-8"?> 
                <Context crossContext="true" 
                  debug="5" 
                  docBase="stamas" 
                  path="/stamas" 
                  reloadable="true"> 
                  <Resource auth="Container" 
                  driverClassName="com.mysql.jdbc.Driver" 
                  maxActive="20" 
                  maxIdle="10" 
                  maxWait="-1" 
                  name="jdbc/stamasDatasource" 
                  type="javax.sql.DataSource" 
                  url="jdbc:mysql://localhost:3306/stamas" 
                  username="root" 
                  password="***" /> 
                </Context>

                 

                Copy tag <Resource> from this file in apache-6.0.29/conf/Catalina/localhost/stamas.xml. It looks like this :
                <?xml version="1.0" encoding="UTF-8"?>
                <Context crossContext="true"
                        debug="5"
                        docBase="/usr/local/apache-tomcat-6.0.29/wtpwebapps/stamas"
                        reloadable="true"
                        source="org.eclipse.jst.jee.server:stamas">
                        <Resource auth="Container"
                                driverClassName="com.mysql.jdbc.Driver"
                                maxActive="20"
                                maxIdle="10"
                                maxWait="-1"
                                name="jdbc/stamasDatasource"
                                password="***"
                                type="javax.sql.DataSource"
                                url="jdbc:mysql://localhost:3306/stamas"
                                username="root"/>
                </Context>

                 

                => The app start without errors but there is still a WARN message in the console :

                WARN  [PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.

                 

                The app works properly with this message. I can use the Login option and log with admin and no password like suggested by the app.

                => Warn message ignored.

                 

                3) Generate Entities

                I've created the database with tables, herited tables and views. There are the first ones I've tried to import in my app...

                CREATE TABLE `t_e_personne_prs` (
                  `prs_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la personne',
                  `prs_nom` varchar(30) COLLATE utf8_bin NOT NULL COMMENT 'Nom de la personne',
                  `prs_prenom` varchar(30) COLLATE utf8_bin NOT NULL COMMENT 'Prénom de la personne    ',
                  `prs_adrel` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT 'Adresse électronique  de la personne',
                  `prs_telephone` char(10) COLLATE utf8_bin DEFAULT NULL COMMENT 'Numéro de téléphone de la personne',
                  PRIMARY KEY (`prs_id`),
                  KEY `x_prs_nom_prenom` (`prs_nom`,`prs_prenom`)
                ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table des personnes.';

                 

                CREATE TABLE `t_e_fonction_fct` (
                  `fct_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la fonction logicielle',
                  `fct_libelle` varchar(45) COLLATE utf8_bin NOT NULL COMMENT 'Libelle de la fonction logicielle',
                  PRIMARY KEY (`fct_id`),
                  KEY `x_fct_libelle` (`fct_libelle`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table des fonctions du logiciel';

                 

                CREATE TABLE `t_e_type_utilisateur_tu` (
                  `tu_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant du type d''utilisateur',
                  `tu_libelle` varchar(45) COLLATE utf8_bin NOT NULL COMMENT 'Libellé du type d''utilisateur',
                  PRIMARY KEY (`tu_id`),
                  UNIQUE KEY `x_tu_libelle` (`tu_libelle`)
                ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table des types d''utilisateurs';

                 

                CREATE TABLE `t_j_uti_acceder_fct_uaf` (
                  `uaf_id_type_utilisateur` tinyint(3) unsigned NOT NULL COMMENT 'Identifiant du type d''utilisateur',
                  `uaf_id_fonction` tinyint(3) unsigned NOT NULL COMMENT 'Identifiant de la fonction logicielle',
                  PRIMARY KEY (`uaf_id_type_utilisateur`,`uaf_id_fonction`),
                  KEY `c_fk_uaf_id_fonction` (`uaf_id_fonction`),
                  CONSTRAINT `c_fk_uaf_id_fonction` FOREIGN KEY (`uaf_id_fonction`)  REFERENCES `t_e_fonction_fct` (`fct_id`) ON DELETE CASCADE ON UPDATE NO  ACTION,
                  CONSTRAINT `c_fk_uaf_id_type_utilisateur` FOREIGN KEY  (`uaf_id_type_utilisateur`) REFERENCES `t_e_type_utilisateur_tu`  (`tu_id`) ON DELETE CASCADE ON UPDATE NO ACTION
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table associative des accès aux fonctions par les types d''ut';

                 

                CREATE TABLE `t_h_utilisateur_uti` (
                  `uti_id_personne` int(10) unsigned NOT NULL,
                  `uti_id_type_utilisateur` tinyint(3) unsigned NOT NULL,
                  `uti_login` varchar(20) COLLATE utf8_bin NOT NULL COMMENT 'Nom d''utilisateur',
                  `uti_mot_passe` varchar(10) COLLATE utf8_bin NOT NULL COMMENT 'Mot de passe de l''utilisateur',
                  PRIMARY KEY (`uti_id_personne`),
                  KEY `x_uti_login` (`uti_login`),
                  KEY `c_fk_uti_id_personne` (`uti_id_personne`),
                  KEY `c_fk_uti_id_type_utilisateur` (`uti_id_type_utilisateur`),
                  KEY `FKD5A26A0C856BF70A` (`uti_id_type_utilisateur`),
                  CONSTRAINT `c_fk_uti_id_personne` FOREIGN KEY (`uti_id_personne`)  REFERENCES `t_e_personne_prs` (`prs_id`) ON DELETE CASCADE ON UPDATE NO  ACTION,
                  CONSTRAINT `c_fk_uti_id_type_utilisateur` FOREIGN KEY  (`uti_id_type_utilisateur`) REFERENCES `t_e_type_utilisateur_tu`  (`tu_id`) ON UPDATE NO ACTION,
                  CONSTRAINT `FKD5A26A0C856BF70A` FOREIGN KEY (`uti_id_type_utilisateur`) REFERENCES `t_e_type_utilisateur_tu` (`tu_id`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table des utilisateurs de l''application. Hérite de la table ';

                 

                CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY  DEFINER VIEW `v_utilisateur_personne_type` AS select  `u`.`uti_id_personne` AS `uti_id_personne`,`u`.`uti_login` AS  `uti_login`,`u`.`uti_mot_passe` AS `uti_mot_passe`,`p`.`prs_nom` AS  `prs_nom`,`p`.`prs_prenom` AS `prs_prenom`,`p`.`prs_adrel` AS  `prs_adrel`,`p`.`prs_telephone` AS `prs_telephone`,`tu`.`tu_id` AS  `id_type_utilisateur`,`tu`.`tu_libelle` AS `type_utilisateur` from  ((`t_e_personne_prs` `p` join `t_h_utilisateur_uti` `u`  on((`u`.`uti_id_personne` = `p`.`prs_id`))) join  `t_e_type_utilisateur_tu` `tu` on((`tu`.`tu_id` =  `u`.`uti_id_type_utilisateur`)));

                 

                Then, File / New / Seam Generate Entities

                 

                3.1) Window "Generate Seam Entities

                Seam Project : stamas
                Hibernate console configuration : stamas
                Generation mode : Reverse engineer from database
                => Next >

                 

                3.2) Generate Seam Entities Select Tables

                Clic on Refresh, browse the catalog and select tables.

                Clic on Include, the tables appear in the right part of the window.

                Finish

                 

                The tables are already imported and the CRUD xhtml pages are created.

                 

                When I restart the app and try to Browse Data / TEPersonnePrs or any other table, I have the error explained in my previous message.

                 

                Thank you for your help.

                • 5. Re: Simple Seam app configured for Tomcat
                  Philippe Leménager Newbie

                  After some tests, I've found a cause of the problem.

                  It seems that Seam or Hibernate refuses the table names with an underscore after the first character.

                  In a new test project, the app works fine with the same definition of the table t_e_personne_prs but with the simpliest name personne_prs or with the name te_personne_prs.

                  The name t_personne_prs causes the error.

                   

                  Somebody knows what are the restrictions about the names of the tables ?

                   

                  Or is it a bug ?

                  • 6. Re: Simple Seam app configured for Tomcat
                    Max Rydahl Andersen Master

                    i think this is a bug in the seam-gen templates!

                     

                    btw. have you checked that "tEPersonnePrs"actually exists as a field or property on the class ?

                    • 7. Re: Simple Seam app configured for Tomcat
                      Philippe Leménager Newbie

                      Yes I had checked the names in the xhtml page and in the java source code.

                      Now I've changed the names of my tables and the app is functional.

                       

                      Thanks for your interest about my problem now solved.