-
1. Re: Why Seam-gen does not generate entities - PostgreSql?
maynard Apr 2, 2010 12:42 AM (in response to maynard)OK, I am still trying to generate project from Postgresql database. I have tried to use the most simplest database schema - one table with only primary key and some description fields; I have tried to add and remove schema name, I have tried to use different evironments - JBoss 4.x, JBoss EPA, Seam 2.1 and 2.2, etc. At present there is no results - the model directory is empty, there are no entities and no relevant JSF pages in the generated project.
I went through the generated project - there is no log journal in which I could see what had been done (e.g. if connection to database and schema read had been successful etc).So - what's wrong with my configuration. I am using JDBC 3 driver for PG 8.3, connection is always successful (so - if server is not started - this is reconciled before the start of generation etc.)?
I am looking now to try to do this with Apache Derby database, but while it was pretty easy to set up database from Netbeans IDE, the plenty of work is needed if it is used from JBDS.
Maybe there is available some already generated project? It could be nice to see what is the pattern for development. It is a bit uneasy - it could be nice to go ahead and start development, but at present it is impossible to overcome seam-gen task. :(
-
2. Re: Why Seam-gen does not generate entities - PostgreSql?
maynard Apr 3, 2010 1:24 AM (in response to maynard)OK - I decided to abandon Postgresql in favour of MySQL, I have 5.0.x installed. Again - I had successful ping to database and I tried to generate entities on built in JBDS EPA and also - on 4.x JBoss with JDK 1.5 (there are legends that one is advised to use older JDK with JBDS). Well - the result is zero - tha application is generated, the Eclipse log in worksapce is emty - there is no error entries due to these actions; the application can be deployed on server and run and there is no any indication that there can be single entity into the project generated. I had the pretty basic single table with 3 fields and 1 field for primary key. And even this apperas to be too heavy...
Good books advise to start with seam-gen generated project - maybe this should be put at the end of book. Huh!
-
3. Re: Why Seam-gen does not generate entities - PostgreSql?
boomerbrian.brian.abston.featurenotbug.com Apr 3, 2010 5:19 PM (in response to maynard)I bet your Postgres Connection string is incorrect in your Seam Gen config file. The first time I used Postgres my connection had an issue. It didn't report any errors but it didn't generate any entities either. Once I figured it out I haven't had anymore issues with Seam and Postgres.
-
4. Re: Why Seam-gen does not generate entities - PostgreSql?
idyoshin Apr 3, 2010 10:19 PM (in response to maynard)With PostgreSQL there is a specific issue. You need to specify the scheme where to look for tables. By default it tries to scan for scheme public (which is default for connection). so double check your database and database connection and in seam-gen give correct answer for scheme to scan.
Kind regards,
Ilya Dyoshin
-
5. Re: Why Seam-gen does not generate entities - PostgreSql?
maynard Apr 4, 2010 1:28 AM (in response to maynard)My build.properties (for Postgres) is:
#Generated by seam setup #Sun Mar 21 01:19:56 EET 2010 hibernate.connection.password=postgres workspace.home=H\:/JBossProjects hibernate.connection.dataSource_class=org.postgresql.jdbc3.Jdbc3ConnectionPool model.package=com.nmc.hrsm.model driver.jar=C\:/HRSM_LIB/postgresql-8.3-605.jdbc3.jar action.package=com.nmc.hrsm.action test.package=com.nmc.hrsm.test database.type=postgres richfaces.skin=deepMarine glassfish.domain=domain1 hibernate.default_catalog.null= hibernate.default_schema=hrsm database.drop=n project.name=HRSM_GEN hibernate.connection.username=postgres glassfish.home=C\:/Program Files/glassfish-v2.1 hibernate.connection.driver_class=org.postgresql.Driver hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider jboss.domain=default project.type=ear icefaces.home= database.exists=y jboss.home=H\:/jboss-4.2.3.GA driver.license.jar= hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect *hibernate.connection.url=jdbc\:postgresql\://localhost\:5432/hrms_database* icefaces=n
and the seam-gen log is:
[hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engi neering) [hibernate] 1. task: hbm2java (Generates a set of .java files) [hibernate] 2010.4.4 02:17:58 org.hibernate.cfg.Environment <clinit> [hibernate] INFO: Hibernate 3.2.4.sp1 [hibernate] 2010.4.4 02:17:58 org.hibernate.cfg.Environment <clinit> [hibernate] INFO: hibernate.properties not found [hibernate] 2010.4.4 02:17:58 org.hibernate.cfg.Environment buildBytecodeProvide r [hibernate] INFO: Bytecode provider name : cglib [hibernate] 2010.4.4 02:17:58 org.hibernate.cfg.Environment <clinit> [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.reveng.OverrideRepository addFil e [hibernate] INFO: Override file: H:\JBossProjects\HRSM_GEN\resources\seam-gen.re veng.xml [hibernate] 2010.4.4 02:17:59 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: Using Hibernate built-in connection pool (not for production u se!) [hibernate] 2010.4.4 02:17:59 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: Hibernate connection pool size: 20 [hibernate] 2010.4.4 02:17:59 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: autocommit mode: false [hibernate] 2010.4.4 02:17:59 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql:// localhost:5432/hrms_database [hibernate] 2010.4.4 02:17:59 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: connection properties: {user=postgres, dataSource_class=org.po stgresql.jdbc3.Jdbc3ConnectionPool, password=****} [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: RDBMS: PostgreSQL, version: 8.3.5 [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 605) [hibernate] 2010.4.4 02:17:59 org.hibernate.dialect.Dialect <init> [hibernate] INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect [hibernate] 2010.4.4 02:17:59 org.hibernate.transaction.TransactionFactoryFactor y buildTransactionFactory [hibernate] INFO: Using default transaction strategy (direct JDBC transactions) [hibernate] 2010.4.4 02:17:59 org.hibernate.transaction.TransactionManagerLookup Factory getTransactionManagerLookup [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, us e of read-write or transactional second-level cache is not recommended) [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic flush during beforeCompletion(): disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic session close at end of transaction: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch size: 15 [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch updates for versioned data: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Scrollable result sets: enabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Connection release mode: auto [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default schema: hrsm [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default batch fetch size: 1 [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Generate SQL with comments: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL updates by primary key: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL inserts for batching: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory createQueryTrans latorFactory [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFact ory [hibernate] 2010.4.4 02:17:59 org.hibernate.hql.ast.ASTQueryTranslatorFactory <i nit> [hibernate] INFO: Using ASTQueryTranslatorFactory [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query language substitutions: {} [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JPA-QL strict compliance: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Second-level cache: enabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query cache: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory createCacheProvi der [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Optimize cache for minimal puts: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Structured second-level cache entries: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Statistics: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default entity-mode: pojo [hibernate] 2010.4.4 02:17:59 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Named query checking : enabled [hibernate] 2010.4.4 02:18:00 org.hibernate.connection.DriverManagerConnectionPr ovider close [hibernate] INFO: cleaning up connection pool: jdbc:postgresql://localhost:5432/ hrms_database [hibernate] 2010.4.4 02:18:00 org.hibernate.tool.Version <clinit> [hibernate] INFO: Hibernate Tools 3.2.2.GA [javaformatter] *Java formatting of 0 files completed.* Skipped 0 file(s).
So - I see that there is well formated connection string and the default catalog is given as well. Besides - I created one table in public schema as well - so - there was no way for Seam without table in its path. I am making comparison with the Seam book and I see that the last line should be someting like
Java formatting of NNN files completed.
- NNN and no 0. -
6. Re: Why Seam-gen does not generate entities - PostgreSql?
maynard Apr 4, 2010 1:39 AM (in response to maynard)And the output from
seam generate -verbose
does not contain any errors either:[hibernate] INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql:// localhost:5432/hrms_database [hibernate] 2010.4.4 02:36:52 org.hibernate.connection.DriverManagerConnectionPr ovider configure [hibernate] INFO: connection properties: {user=postgres, dataSource_class=org.po stgresql.jdbc3.Jdbc3ConnectionPool, password=****} [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: RDBMS: PostgreSQL, version: 8.3.5 [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 605) [hibernate] 2010.4.4 02:36:52 org.hibernate.dialect.Dialect <init> [hibernate] INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect [hibernate] 2010.4.4 02:36:52 org.hibernate.transaction.TransactionFactoryFactor y buildTransactionFactory [hibernate] INFO: Using default transaction strategy (direct JDBC transactions) [hibernate] 2010.4.4 02:36:52 org.hibernate.transaction.TransactionManagerLookup Factory getTransactionManagerLookup [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, us e of read-write or transactional second-level cache is not recommended) [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic flush during beforeCompletion(): disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic session close at end of transaction: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch size: 15 [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch updates for versioned data: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Scrollable result sets: enabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Connection release mode: auto [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default schema: hrsm [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default batch fetch size: 1 [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Generate SQL with comments: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL updates by primary key: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL inserts for batching: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory createQueryTrans latorFactory [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFact ory [hibernate] 2010.4.4 02:36:52 org.hibernate.hql.ast.ASTQueryTranslatorFactory <i nit> [hibernate] INFO: Using ASTQueryTranslatorFactory [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query language substitutions: {} [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JPA-QL strict compliance: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Second-level cache: enabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query cache: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory createCacheProvi der [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Optimize cache for minimal puts: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Structured second-level cache entries: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Statistics: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default entity-mode: pojo [hibernate] 2010.4.4 02:36:52 org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Named query checking : enabled [hibernate] 2010.4.4 02:36:52 org.hibernate.connection.DriverManagerConnectionPr ovider close [hibernate] INFO: cleaning up connection pool: jdbc:postgresql://localhost:5432/ hrms_database [hibernate] 2010.4.4 02:36:53 org.hibernate.tool.Version <clinit> [hibernate] INFO: Hibernate Tools 3.2.2.GA dropping H:\JBossSeam\jboss-seam-2.1.2\lib\ant.jar from path as it doesn't exist [javaformatter] Java formatting of 0 files completed. Skipped 0 file(s). generate-ui: [echo] Building project 'HRSM_GEN' to generate views and controllers [ant] calling target(s) [jar] in build file H:\JBossProjects\HRSM_GEN\buil d.xml parsing buildfile H:\JBossProjects\HRSM_GEN\build.xml with URI = file:/H:/JBossP rojects/HRSM_GEN/build.xml