Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
24. Jun 2008, 20:36 CET | Link

Hi,

Basically, when running generate-entities, all the connections seem to be made, and seam-gen does seem to gain a knowledge of the various tables, but it doesn't generate any classes, with warnings of 'no primary keys' and 'no columns found'.

I saw some others have had similar problems, but none of the solutions seemed to work for me...i've tried changing to uppercase for the default_schema as was the solution for some oracle users, and I've tried all manner of default_catalog/default_schema/hibernateconnectionURL combinations to no avail. It doesn't seem to be a problem with permissions although this app runs agaisnt postgres 8.3.1, which I am wholly unfamiliar with...is it possible that this is a metadata-permissions retrieval problem? I've gone so far as granting the public user all rights, but there was no change in the result for seam-gen

I've posted my build.properties and seam-gen output below, if anyone can help I'd appreciate it immensely!

---------------------- build.properties ---------------------- hibernate.connection.password=password workspace.home=c\:/java/workspace model.package=com.mycompany.myapp.beans driver.jar=c\:\\java\\postgresql-8.3-603.jdbc4.jar action.package=com.mycompany.myapp.beans test.package=com.mycompany.myapp.test database.type=postgres richfaces.skin=ruby hibernate.default_catalog= hibernate.default_schema= database.drop=n project.name=MyApp hibernate.connection.username=postgres hibernate.connection.driver_class=org.postgresql.Driver hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider project.type=ear icefaces.home= database.exists=y jboss.home=C\:/Program Files/jboss-4.2.2.GA hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.connection.url=jdbc\:postgresql\:MyAppDB icefaces=n

---------------------------------- seam generate-entities output: ----------------------------------

Buildfile: C:\java\jboss-seam-2.0.2.SP1\seam-gen\build.xml init: init-properties: [echo] C:/Program Files/jboss-4.2.2.GA validate-workspace: validate-project: init-generate: generate-model: [echo] Reverse engineering database using JDBC driver c:\java\postgresql-8.3-603.jdbc4.jar [echo] project=c:/java/workspace/MyApp [echo] model=com.mycompany.myapp.beans [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering) [hibernate] 1. task: hbm2java (Generates a set of .java files) [hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit> [hibernate] INFO: Hibernate 3.2.4.sp1 [hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit> [hibernate] INFO: hibernate.properties not found [hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment buildBytecodeProvider [hibernate] INFO: Bytecode provider name : cglib [hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit> [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.OverrideRepository addFile [hibernate] INFO: Override file: c:\java\workspace\MyApp\resources\seam-gen.reveng.xml [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure [hibernate] INFO: Using Hibernate built-in connection pool (not for production use!) [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure [hibernate] INFO: Hibernate connection pool size: 20 [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure [hibernate] INFO: autocommit mode: false [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure [hibernate] INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql:MyAppDB [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure [hibernate] INFO: connection properties: {user=postgres, password=****} [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: RDBMS: PostgreSQL, version: 8.3.1 [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC4 with SSL (build 603) [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.dialect.Dialect <init> [hibernate] INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory [hibernate] INFO: Using default transaction strategy (direct JDBC transactions) [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic flush during beforeCompletion(): disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Automatic session close at end of transaction: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch size: 15 [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC batch updates for versioned data: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Scrollable result sets: enabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Connection release mode: auto [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default schema: [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default catalog: [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default batch fetch size: 1 [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Generate SQL with comments: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL updates by primary key: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Order SQL inserts for batching: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> [hibernate] INFO: Using ASTQueryTranslatorFactory [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query language substitutions: {} [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: JPA-QL strict compliance: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Second-level cache: enabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Query cache: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory createCacheProvider [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Optimize cache for minimal puts: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Structured second-level cache entries: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Statistics: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Default entity-mode: pojo [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings [hibernate] INFO: Named query checking : enabled [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in Container. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Container [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in InfoTag. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for InfoTag [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in Interaction. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Interaction [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in Media. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Media [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in User. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for User [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: The JDBC driver didn't report any primary key columns in WorkItem. Asking rev.eng. strategy [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey [hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for WorkItem [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Container) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.InfoTag) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Interaction) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Media) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.User) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses [hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.WorkItem) as no columns were found. [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider close [hibernate] INFO: cleaning up connection pool: jdbc:postgresql:MyAppDB [hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.tool.Version <clinit> [hibernate] INFO: Hibernate Tools 3.2.0.CR1 [javaformatter] Java formatting of 0 files completed. Skipped 0 file(s). generate-ui: [echo] Building project 'MyApp' to generate views and controllers init: compile: [javac] Compiling 1 source file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar copyclasses: jar: [copy] Copying 1 file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar\META-INF [copy] Copying 1 file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar [hibernate] Executing Hibernate Tool with a JPA Configuration [hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl [hibernate] Jun 24, 2008 2:13:02 PM org.hibernate.cfg.annotations.Version <clinit> [hibernate] INFO: Hibernate Annotations 3.3.0.GA [hibernate] Jun 24, 2008 2:13:02 PM org.hibernate.ejb.Version <clinit> [hibernate] INFO: Hibernate EntityManager 3.3.1.GA [hibernate] 2. task: generic exportertemplate: view/view.xhtml.ftl [hibernate] 3. task: generic exportertemplate: view/view.page.xml.ftl [hibernate] 4. task: generic exportertemplate: view/edit.xhtml.ftl [hibernate] 5. task: generic exportertemplate: view/edit.page.xml.ftl [hibernate] 6. task: generic exportertemplate: src/EntityList.java.ftl [hibernate] 7. task: generic exportertemplate: view/list.page.xml.ftl [hibernate] 8. task: generic exportertemplate: src/EntityHome.java.ftl [hibernate] 9. task: generic exportertemplate: view/layout/menu.xhtml.ftl [javaformatter] Java formatting of 1 files completed. Skipped 0 file(s). [echo] Type 'seam restart' and go to http://localhost:8080/MyApp generate: generate-entities: BUILD SUCCESSFUL Total time: 3 seconds

Thanks to anyone who can point me in the right direction.

13 Replies:
24. Jun 2008, 20:38 CET | Link

Yikes, let me try that again with some better formatting....sorry!

24. Jun 2008, 20:41 CET | Link

build.properties

hibernate.connection.password=password
workspace.home=c\:/java/workspace
model.package=com.avaya.lynx.mediasift.beans
driver.jar=c\:/java/postgresql-8.3-603.jdbc4.jar
action.package=com.avaya.lynx.mediasift.beans
test.package=com.avaya.lynx.mediasift.test
database.type=postgres
richfaces.skin=ruby
hibernate.default_catalog=
hibernate.default_schema=
database.drop=n
project.name=MediaSift2
hibernate.connection.username=postgres
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
project.type=ear
icefaces.home=
database.exists=y
jboss.home=C\:/Program Files/jboss-4.2.2.GA
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.url=jdbc\:postgresql\:MediaSift
icefaces=n

seam generate-entities output

Buildfile: C:\java\jboss-seam-2.0.2.SP1\seam-gen\build.xml

init:

init-properties:
     [echo] C:/Program Files/jboss-4.2.2.GA

validate-workspace:

validate-project:

init-generate:

generate-model:
     [echo] Reverse engineering database using JDBC driver c:\java\postgresql-8.3-603.jdbc4.jar
     [echo] project=c:/java/workspace/MyApp
     [echo] model=com.mycompany.myapp.beans
[hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernate] 1. task: hbm2java (Generates a set of .java files)
[hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: Hibernate 3.2.4.sp1
[hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: hibernate.properties not found
[hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment buildBytecodeProvider
[hibernate] INFO: Bytecode provider name : cglib
[hibernate] Jun 24, 2008 2:12:59 PM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.OverrideRepository addFile
[hibernate] INFO: Override file: c:\java\workspace\MyApp\resources\seam-gen.reveng.xml
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: Using Hibernate built-in connection pool (not for production use!)
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: Hibernate connection pool size: 20
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: autocommit mode: false
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql:MyAppDB
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: connection properties: {user=postgres, password=****}
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: RDBMS: PostgreSQL, version: 8.3.1
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC4 with SSL (build 603)
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.dialect.Dialect <init>
[hibernate] INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
[hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
[hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Automatic flush during beforeCompletion(): disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Automatic session close at end of transaction: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC batch size: 15
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC batch updates for versioned data: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Scrollable result sets: enabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC3 getGeneratedKeys(): disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Connection release mode: auto
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default schema: 
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default catalog: 
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default batch fetch size: 1
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Generate SQL with comments: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Order SQL updates by primary key: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Order SQL inserts for batching: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
[hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
[hibernate] INFO: Using ASTQueryTranslatorFactory
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Query language substitutions: {}
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JPA-QL strict compliance: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Second-level cache: enabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Query cache: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory createCacheProvider
[hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Optimize cache for minimal puts: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Structured second-level cache entries: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Statistics: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default entity-mode: pojo
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Named query checking : enabled
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in Container. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Container
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in InfoTag. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for InfoTag
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in Interaction. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Interaction
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in Media. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for Media
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in User. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for User
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in WorkItem. Asking rev.eng. strategy
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for WorkItem
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Container) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.InfoTag) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Interaction) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.Media) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.User) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.cfg.JDBCBinder createPersistentClasses
[hibernate] WARNING: Cannot create persistent class for org.hibernate.mapping.Table(MyAppDB.WorkItem) as no columns were found.
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.connection.DriverManagerConnectionProvider close
[hibernate] INFO: cleaning up connection pool: jdbc:postgresql:MyAppDB
[hibernate] Jun 24, 2008 2:13:00 PM org.hibernate.tool.Version <clinit>
[hibernate] INFO: Hibernate Tools 3.2.0.CR1
[javaformatter] Java formatting of 0 files completed. Skipped 0 file(s).

generate-ui:
     [echo] Building project 'MyApp' to generate views and controllers

init:

compile:
    [javac] Compiling 1 source file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar

copyclasses:

jar:
     [copy] Copying 1 file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar\META-INF
     [copy] Copying 1 file to c:\java\workspace\MyApp\exploded-archives\MyApp.jar
[hibernate] Executing Hibernate Tool with a JPA Configuration
[hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl
[hibernate] Jun 24, 2008 2:13:02 PM org.hibernate.cfg.annotations.Version <clinit>
[hibernate] INFO: Hibernate Annotations 3.3.0.GA
[hibernate] Jun 24, 2008 2:13:02 PM org.hibernate.ejb.Version <clinit>
[hibernate] INFO: Hibernate EntityManager 3.3.1.GA
[hibernate] 2. task: generic exportertemplate: view/view.xhtml.ftl
[hibernate] 3. task: generic exportertemplate: view/view.page.xml.ftl
[hibernate] 4. task: generic exportertemplate: view/edit.xhtml.ftl
[hibernate] 5. task: generic exportertemplate: view/edit.page.xml.ftl
[hibernate] 6. task: generic exportertemplate: src/EntityList.java.ftl
[hibernate] 7. task: generic exportertemplate: view/list.page.xml.ftl
[hibernate] 8. task: generic exportertemplate: src/EntityHome.java.ftl
[hibernate] 9. task: generic exportertemplate: view/layout/menu.xhtml.ftl
[javaformatter] Java formatting of 1 files completed. Skipped 0 file(s).
     [echo] Type 'seam restart' and go to http://localhost:8080/MyApp

generate:

generate-entities:

BUILD SUCCESSFUL
Total time: 3 seconds
24. Jun 2008, 21:04 CET | Link

I have the same configuration working.

I'm using the driver that comes with Aqua Datastudio

Here is the build.properties file:.


#Generated by seam setup
#Tue Jun 10 17:06:00 PDT 2008
hibernate.connection.password=myPassword
workspace.home=/opt/seamp
model.package=com.dpn.model
driver.jar=/opt/postgre/postgresql.jar
action.package=com.dpn.action
test.package=com.dpn.test
database.type=postgres
richfaces.skin=blueSky
hibernate.default_catalog.null=
hibernate.default_schema.null=
database.drop=n
project.name=eReferrals
hibernate.connection.username=myUser
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
project.type=ear
icefaces.home=
database.exists=y
jboss.home=/opt/jboss-4.2.2.GA
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.url=jdbc\:postgresql\://127.0.0.1\:5432/myUser
icefaces=n
24. Jun 2008, 23:52 CET | Link

No such luck; same results.

My environment appears ;) identical when i swap in the driver that comes with Aqua Datastudio (which incidentally is for postgres 8.2, i'm not deep enough yet so not sure if this may cause you future issues if you're using an 8.3 install?).

This leads me to believe it's something I've misconfigured with postgres somehow...perplexing since i'm on localhost and using the master account to log in for dev purposes...

Any other suggestions out there as for somethign i've misconfigured or quirks with seam?

25. Jun 2008, 00:19 CET | Link

I am guessing that you are missing the port and/or database name in your properties file.

Have you tried to change the connection entry as follows ?


hibernate.connection.url=jdbc\:postgresql\://127.0.0.1\:5432/myUser
25. Jun 2008, 14:23 CET | Link

Yeah, i've mixed and matched the 3 properties dealing with the url, schema, and catalog...I'd tried 'localhost' before, but not the loopback ip...which I just tried on the off chance that i was missing some sort of 'localhost' resolution in postgres....no dice though, unfortunately.

In addition, I've now tried a few remote postgres installations, and I get the same no primary key and no columns found messages (note that this has nothing to do with IP listening etc...since seam correctly reports that it can't connect to the DB if the postmaster isn't listening properly)

Also, maybe some additional debug info would help?

In the datasource explorer in Eclipse, i CAN connect, i CAN see all the tables and column info, as well as the Primary key etc...so if eclipse can see it...why can't seam-gen?

Also, it should be noted that I've tried using the Eclipse gui tool for the seam generate entities action, but in the hibernate log I get the same 3 messages for every table: didn't report any primary keys, rev.eng stategy didn't report primary key columns, and cannot create persistent class as no columns were fouind.....

25. Jun 2008, 15:41 CET | Link

I've now also tried using postgres 8.2.5 (win32) just in case there was some undiscovered driver issue, but same result: hibernate finds my tables, but doesn't find PKs or columns therein and so doesn't generate anything...

WTF?

26. Jun 2008, 00:08 CET | Link

I just swapped out the postgres database for a mysql one...everything worked fine!

Can you please confirm the version of postgres you're using? And which OS? I'll have to deploy on postgres.

Thanks

26. Jun 2008, 18:09 CET | Link

Posgresl SQL 8.1.4 on I686 Red Hat Linux (Kernel 2.6.9-67.0.15.EL).

FYI:. I had a similar case using an Oracle DB: Some tables , and fields had theirs names enclosed on double quotes.

On SQL server had problems as well when a field takes as name for example datetime or system.

Rating:  * * * *
26. Jun 2008, 18:29 CET | Link

OK, for now I'll chalk it up to a weirdness between flavours in my environment. I'll try out your config when I get a few hours to find an available linux box 'round here; i'll re-post with my success or failure.

BUT....is there anyone out there that has a seam app running successfully against a windows version of postgresql (i.e. v8.2+)? If not, perhaps this should be raised in JIRA (though if anywhere, I guess the bug would be in hibernate, and not Seam specifically)

FYI - I have a thread on the postgres forums as well, and it doesn't seem like I've actually misconfigured anything...especially since I can see everything from the Eclipse Data Source Explorer pane...this lends credence to my bug theory methinks...

Thank Roger.

08. Jul 2008, 11:34 CET | Link

I have the same problem when trying to generate Entities with a postgresql 8.3 database on Linux (my databese in on a Linux server, but my Jboss is on my Windows workstation) I have configured postgreSQL so that he logs the SQL queries (you made that by modifying the postgresql.conf file and restarting the database). In the log, I have found this kind of query :

SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, ct.relname AS TABLE_NAME, NOT i.indisunique AS NON_UNIQUE, NULL AS INDEX_QUALIFIER, ci.relname AS INDEX_NAME, CASE i.indisclustered WHEN true THEN 1 ELSE CASE am.amname WHEN 'hash' THEN 2 ELSE 3 END END AS TYPE, a.attnum AS ORDINAL_POSITION, CASE WHEN i.indexprs IS NULL THEN a.attname ELSE pg_get_indexdef(ci.oid,a.attnum,false) END AS COLUMN_NAME, NULL AS ASC_OR_DESC, ci.reltuples AS CARDINALITY, ci.relpages AS PAGES, NULL AS FILTER_CONDITION FROM pg_catalog.pg_namespace n, pg_catalog.pg_class ct, pg_catalog.pg_class ci, pg_catalog.pg_attribute a, pg_catalog.pg_am am , pg_catalog.pg_index i WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid AND a.attrelid=ci.oid AND ci.relam=am.oid AND n.oid = ct.relnamespace AND n.nspname = 'public' AND ct.relname = 'compte_bancaire' ORDER BY NON_UNIQUE, TYPE, INDEX_NAME, ORDINAL_POSITION

Notice the name of the table (compte_bancaire) in lower case. The real name of my table is Compte_bancaire, with the first c in upper case.

So I tried to changed the table names in my database. And it worked fine.

It seems that the postrgesql JDBC driver does not support uppercase letters in table names. I hope that will help?

08. Jul 2008, 14:18 CET | Link

In fact, it is a bad practice to have uppercase letters in a table name or in a column name with postgreSQL. Under postgres, all names sould be in lower case (on the contrary, on Oracle, all names should be in upper case)

26. Oct 2009, 04:11 CET | Link

I am playing around with the Seam reeng and having same issue with Postgres 8.3.xx. It fails to recognize primary key for tables. I used it against freshly created tables on local machine (windows vista running postgres 8.3) but has similar issues. Running against Postgres 8.3 database in unix env also has issues but gives similar errors.

I tried multiple postgresql drivers and permutations and combinations on two isolated tables to get it to work. It worked on one combination (I think the driver was Postgres-8.3-605.jdbc4.jar, it was then I reverse engineered all the tables in the database. But the entire process is very finicky to say the least. I would say, try various permutations and combinations (jboss version to ultimately deploy successfully), postgresql driver version, hibernate Jars etc) and if it works, run it against your main database so at least you have majority of routine CRUD done.

If someone found a solid solution and combination. may want to post here. Some permutations that worked and did not work.