4 Replies Latest reply on Apr 19, 2010 6:36 AM by shavo26

    Seam 2.2.0GA + JBoss AS 5.1GA + Postgres 8.4

    rgoytacaz
      Hello Seam users,

      I've been trying unsuccessfully to get started with this configuration, but I've been facing countless problems.

      Iḿ in deeply need of help, if you have some experience please hang in there. It seems like a big wall of text, but its mostly logs from the whole process.

      Basically I started by downloading and installing, Seam 2.2.0GA, AS 5.1GA, Postgres 8.4. I'm using JDK 1.6.

      *First I ran ./seam setup, this is my ~/progs/seam2.2.0ga/seam-gen/build.properties*



      Generated by seam setup
      Sat Aug 29 19:12:18 BRT 2009
      hibernate.connection.password=abc123
      workspace.home=/home/rgoytacaz/workspace
      hibernate.connection.dataSource_class=org.postgresql.ds.PGConnectionPoolDataSource
      model.package=com.atom.Commerce.model
      hibernate.default_catalog=PostgreSQL
      driver.jar=/home/rgoytacaz/postgresql-8.4-701.jdbc4.jar
      action.package=com.atom.Commerce.action
      test.package=com.atom.Commerce.test
      database.type=postgres
      richfaces.skin=glassX
      glassfish.domain=domain1
      hibernate.default_schema=Core
      database.drop=n
      project.name=Commerce
      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=/srv/jboss-5.1.0.GA
      driver.license.jar=
      hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
      hibernate.connection.url=jdbc\:postgresql\:Atom
      icefaces=n


      *And ./seam create-project output*


      SEAM_HOME: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA
      Using seam-gen sources from: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/seam-gen
      Buildfile: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/seam-gen/build.xml

      init:

      init-properties:
           [echo] /srv/jboss-5.1.0.GA

      validate-workspace:

      validate-project:

      icefaces-staging-copy:

      initcopy:

      initpoms:
           [echo] Setting up dependencies
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
      [artifact:install] [INFO] Installing /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms/root.pom to /home/rgoytacaz/.m2/repository/org/jboss/seam/root/2.2.0.GA/root-2.2.0.GA.pom
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
      [artifact:install] [INFO] Installing /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms/parent.pom to /home/rgoytacaz/.m2/repository/org/jboss/seam/parent/2.2.0.GA/parent-2.2.0.GA.pom
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms
           [copy] Copying 1 file to /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/classes/poms

      copyseam:

      copyseamdependencies:

      copyjbossembedded:

      copy-icefaces-home:

      copy-icefaces-maven:

      copy-lib:
           [echo] Copying Seam and dependencies to the /home/rgoytacaz/workspace/Commerce/lib directory...
           [copy] Copying 141 files to /home/rgoytacaz/workspace/Commerce/lib
           [echo] Copying JBoss Embedded configuration to the /home/rgoytacaz/workspace/Commerce/bootstrap directory...
           [copy] Copying 30 files to /home/rgoytacaz/workspace/Commerce/bootstrap

      file-copy-war:

      file-copy-ear:
           [echo] Copying build scripts for EAR deployment to the /home/rgoytacaz/workspace/Commerce directory...
           [copy] Copying 1 file to /home/rgoytacaz/workspace/Commerce
           [echo] Copying resources needed for EAR deployment to the /home/rgoytacaz/workspace/Commerce/resources directory...

      setup-filters:

      file-copy:

      create-project:
           [echo] A new Seam project named 'Commerce' was created in the /home/rgoytacaz/workspace directory
           [echo] Type './seam explode' and go to http://localhost:8080/Commerce
           [echo] Eclipse Users: Import the project using File > Import... > Existing Projects into Workspace, set the root directory to /home/rgoytacaz/workspace, then select the project named Commerce
           [echo] NetBeans Users: Open the project using File > Open project... and select the project folder /home/rgoytacaz/workspace/Commerce
           [echo] IDEA Users: Open the project using File > Open project... and select the file /home/rgoytacaz/workspace/Commerce/Commerce.ipr


      *Now this when the problems started, I already have 3 tables in postgres. When I run ./seam generate-entities, this is my output.*


      SEAM_HOME: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA
      Using seam-gen sources from: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/seam-gen
      Buildfile: /home/rgoytacaz/progs/jboss-seam-2.2.0.GA/seam-gen/build.xml

      init:

      init-properties:
           [echo] /srv/jboss-5.1.0.GA

      validate-workspace:

      validate-project:

      init-generate:

      generate-model:
           [echo] Reverse engineering database using JDBC driver /home/rgoytacaz/postgresql-8.4-701.jdbc4.jar
           [echo] project=/home/rgoytacaz/workspace/Commerce
           [echo] model=com.atom.Commerce.model
      *[hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
      [hibernate] 1. task: hbm2java (Generates a set of .java files)
      [hibernate] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
      [hibernate] log4j:WARN Please initialize the log4j system properly.
      [javaformatter] Java formatting of 4 files completed. Skipped 0 file(s).
      *
      generate-ui:
           [echo] Building project 'Commerce' to generate views and controllers

      init:

      groovy.compile:

      groovy.copy:

      compile:
          [javac] Compiling 4 source files to /home/rgoytacaz/workspace/Commerce/exploded-archives/Commerce.ear/Commerce_jar

      copyclasses:

      jar:
      [hibernate] Executing Hibernate Tool with a JPA Configuration
      [hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl
      [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 8 files completed. Skipped 0 file(s).
           [echo] Type './seam restart' and go to http://localhost:8080/Commerce

      generate:

      generate-entities:

      BUILD SUCCESSFUL
      Total time: 12 seconds


      *Log4j is showing that appender error, what is that?How to fix it?*

        • 1. Re: Seam 2.2.0GA + JBoss AS 5.1GA + Postgres 8.4
          rgoytacaz

          Then next I imported the project into eclipse, did a deploy into my JBoss AS 5.1 and check my server log



          03:18:52,747 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=Commerce.ear,jar=Commerce.jar,name=AuthenticatorBean,service=EJB3
          03:18:52,748 INFO  [EJBContainer] STARTED EJB: com.atom.Commerce.action.AuthenticatorBean ejbName: AuthenticatorBean
          03:18:52,799 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
          
                  Commerce/AuthenticatorBean/local - EJB3.x Default Local Business Interface
                  Commerce/AuthenticatorBean/local-com.atom.Commerce.action.Authenticator - EJB3.x Local Business Interface
          
          03:18:52,927 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=Commerce.ear/Commerce.jar#Commerce
          03:18:53,092 INFO  [Version] Hibernate Annotations 3.4.0.GA
          03:18:53,141 INFO  [Environment] Hibernate 3.3.1.GA
          03:18:53,152 INFO  [Environment] hibernate.properties not found
          03:18:53,160 INFO  [Environment] Bytecode provider name : javassist
          03:18:53,171 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
          03:18:53,370 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
          03:18:53,381 INFO  [Version] Hibernate EntityManager 3.4.0.GA
          03:18:53,459 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
                  name: Commerce
                  ...]
          03:18:53,528 WARN  [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
          03:18:53,869 INFO  [AnnotationBinder] Binding entity from annotated class: com.atom.Commerce.model.Products
          03:18:54,158 INFO  [EntityBinder] Bind entity com.atom.Commerce.model.Products on table products
          03:18:54,381 INFO  [AnnotationBinder] Binding entity from annotated class: com.atom.Commerce.model.Productsculturedetail
          03:18:54,381 INFO  [EntityBinder] Bind entity com.atom.Commerce.model.Productsculturedetail on table productsculturedetail
          03:18:54,432 INFO  [AnnotationBinder] Binding entity from annotated class: com.atom.Commerce.model.Cultures
          03:18:54,433 INFO  [EntityBinder] Bind entity com.atom.Commerce.model.Cultures on table cultures
          03:18:54,622 INFO  [CollectionBinder] Mapping collection: com.atom.Commerce.model.Products.productsculturedetails -> productsculturedetail
          03:18:54,628 INFO  [CollectionBinder] Mapping collection: com.atom.Commerce.model.Cultures.productsculturedetails -> productsculturedetail
          03:18:54,641 INFO  [Version] Hibernate Validator 3.1.0.GA
          03:18:54,718 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
          03:18:54,815 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
          03:18:54,823 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
          03:18:55,088 INFO  [SettingsFactory] RDBMS: PostgreSQL, version: 8.4.0
          *03:18:55,089 INFO  [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.4 JDBC3 (build 701)*
          03:18:55,139 INFO  [Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
          03:18:55,154 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
          03:18:55,161 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
          03:18:55,180 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
          03:18:55,182 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
          03:18:55,183 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
          03:18:55,184 INFO  [SettingsFactory] JDBC batch size: 15
          03:18:55,184 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
          03:18:55,230 INFO  [SettingsFactory] Scrollable result sets: enabled
          03:18:55,237 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
          03:18:55,266 INFO  [SettingsFactory] Connection release mode: auto
          03:18:55,269 INFO  [SettingsFactory] Default schema: Core
          03:18:55,269 INFO  [SettingsFactory] Default catalog: PostgreSQL
          03:18:55,270 INFO  [SettingsFactory] Default batch fetch size: 1
          03:18:55,270 INFO  [SettingsFactory] Generate SQL with comments: disabled
          03:18:55,271 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
          03:18:55,271 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
          03:18:55,271 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
          03:18:55,281 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
          03:18:55,282 INFO  [SettingsFactory] Query language substitutions: {}
          03:18:55,282 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
          03:18:55,283 INFO  [SettingsFactory] Second-level cache: enabled
          03:18:55,283 INFO  [SettingsFactory] Query cache: disabled
          03:18:55,339 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
          03:18:55,341 INFO  [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
          03:18:55,346 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
          03:18:55,346 INFO  [SettingsFactory] Cache region prefix: persistence.unit:unitName=Commerce.ear/Commerce.jar#Commerce
          03:18:55,347 INFO  [SettingsFactory] Structured second-level cache entries: disabled
          03:18:55,361 INFO  [SettingsFactory] Echoing all SQL to stdout
          03:18:55,364 INFO  [SettingsFactory] Statistics: disabled
          03:18:55,364 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
          03:18:55,365 INFO  [SettingsFactory] Default entity-mode: pojo
          03:18:55,365 INFO  [SettingsFactory] Named query checking : enabled
          03:18:55,510 INFO  [SessionFactoryImpl] building session factory
          03:18:55,942 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=Commerce.ear/Commerce.jar#Commerce
          03:18:55,946 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
          03:18:55,954 INFO  [NamingHelper] Creating subcontext: persistence.unit:unitName=Commerce.ear
          03:18:55,955 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=Commerce.ear/Commerce.jar#Commerce
          03:18:55,956 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext
          03:18:55,977 INFO  [SchemaUpdate] Running hbm2ddl schema update
          03:18:55,977 INFO  [SchemaUpdate] fetching database metadata
          03:18:55,983 INFO  [SchemaUpdate] updating schema
          03:18:56,065 INFO  [TableMetadata] table found: atom.cultures
          03:18:56,072 INFO  [TableMetadata] columns: [culture_id, locale, currency_code, country]
          03:18:56,073 INFO  [TableMetadata] foreign keys: []
          03:18:56,073 INFO  [TableMetadata] indexes: [culture_pk]
          03:18:56,122 INFO  [TableMetadata] table found: atom.products
          03:18:56,122 INFO  [TableMetadata] columns: [product_id, active]
          03:18:56,123 INFO  [TableMetadata] foreign keys: []
          03:18:56,123 INFO  [TableMetadata] indexes: [product_pk]
          03:18:56,261 INFO  [TableMetadata] table found: atom.productsculturedetail
          03:18:56,261 INFO  [TableMetadata] columns: [culture_id, product_id, name]
          03:18:56,261 INFO  [TableMetadata] foreign keys: [culture_fk, product_fk]
          03:18:56,261 INFO  [TableMetadata] indexes: [productculturedetail_fk]
          03:18:56,301 INFO  [TableMetadata] table found: atom.cultures
          03:18:56,301 INFO  [TableMetadata] columns: [culture_id, locale, currency_code, country]
          03:18:56,301 INFO  [TableMetadata] foreign keys: []
          03:18:56,301 INFO  [TableMetadata] indexes: [culture_pk]
          03:18:56,339 INFO  [TableMetadata] table found: atom.products
          03:18:56,339 INFO  [TableMetadata] columns: [product_id, active]
          03:18:56,339 INFO  [TableMetadata] foreign keys: []
          03:18:56,339 INFO  [TableMetadata] indexes: [product_pk]
          03:18:56,394 INFO  [TableMetadata] table found: atom.productsculturedetail
          03:18:56,394 INFO  [TableMetadata] columns: [culture_id, product_id, name]
          03:18:56,394 INFO  [TableMetadata] foreign keys: [culture_fk, product_fk]
          03:18:56,394 INFO  [TableMetadata] indexes: [productculturedetail_fk]
          *03:18:56,405 ERROR [SchemaUpdate] Unsuccessful: alter table PostgreSQL.atom.productsculturedetail add constraint FKBD5D849BC0A26E19 foreign key (culture_Id) references PostgreSQL.atom.cultures
          03:18:56,406 ERROR [SchemaUpdate] ERROR: cross-database references are not implemented: "postgresql.atom.productsculturedetail"
          03:18:56,407 ERROR [SchemaUpdate] Unsuccessful: alter table PostgreSQL.atom.productsculturedetail add constraint FKBD5D849BFFFC9417 foreign key (product_Id) references PostgreSQL.atom.products
          03:18:56,408 ERROR [SchemaUpdate] ERROR: cross-database references are not implemented: "postgresql.atom.productsculturedetail"*
          03:18:56,408 INFO  [SchemaUpdate] schema update complete
          03:18:56,411 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
          03:18:57,216 INFO  [TomcatDeployment] deploy, ctxPath=/Commerce
          03:18:57,986 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/Commerce'
          03:19:00,237 INFO  [ServletContextListener] Welcome to Seam 2.2.0.GA
          03:19:03,844 WARN  [PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
          03:19:04,094 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
          03:19:04,125 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
          03:19:04,135 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:20s:14ms



          If you check the section regarding hibernate loading information from my tables, there is something odd going on there.


          Also theres this..



          *03:18:55,089 INFO  [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.4 JDBC3 (build 701)*




          I didn't give it a JDBC3 driver, I gave it a JDBC4 driver, I don't know where he got this information, where do I set it to use JDBC4? seam-gen isn't following the build.properties...


          and finally when i try to browse the generate ui, for my entities..




          03:34:00,828 INFO  [STDOUT] Hibernate: 
              select
                  products0_.product_Id as product1_0_,
                  products0_.active as active0_ 
              from
                  PostgreSQL.atom.products products0_ limit ?
          03:34:00,848 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: 0A000
          03:34:00,849 ERROR [JDBCExceptionReporter] ERROR: cross-database references are not implemented: "postgresql.atom.products"
            Position: 81
          03:34:00,871 SEVERE [viewhandler] Error Rendering View[/ProductsList.xhtml]
          javax.el.ELException: /ProductsList.xhtml: Error reading 'resultList' on type com.atom.Commerce.action.ProductsList_$$_javassist_seam_2
                  at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
                  at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
                  at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)
                  at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRenderer.java:189)
                  at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRenderer.java:148)
                  at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:100)
                  at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
                  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
                  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
                  at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                  at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
                  at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
                  at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
                  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:40)
                  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:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
                  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:60)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                  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:235)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                  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:158)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                  at java.lang.Thread.run(Thread.java:619)
          Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
                  at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:80)
                  at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:71)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                  at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                  at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
                  at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
                  at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                  at com.atom.Commerce.action.ProductsList_$$_javassist_seam_2.getResultList(ProductsList_$$_javassist_seam_2.java)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
                  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
                  at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
                  at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
                  at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                  at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
                  at org.jboss.el.parser.AstChoice.getValue(AstChoice.java:27)
                  at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                  at com.sun.facelets.el.ELText$ELTextVariable.writeText(ELText.java:184)
                  at com.sun.facelets.el.ELText$ELTextComposite.writeText(ELText.java:108)
                  at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
                  ... 58 more
          Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
                  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
                  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                  at org.hibernate.loader.Loader.doList(Loader.java:2231)
                  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
                  at org.hibernate.loader.Loader.list(Loader.java:2120)
                  at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
                  at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
                  at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
                  at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
                  ... 94 more
          Caused by: org.postgresql.util.PSQLException: ERROR: cross-database references are not implemented: "postgresql.atom.products"
            Position: 81
                  at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
                  at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
                  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
                  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
                  at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
                  at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
                  at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
                  at org.hibernate.loader.Loader.doQuery(Loader.java:697)
                  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
                  at org.hibernate.loader.Loader.doList(Loader.java:2228)
                  ... 102 more
          03:34:00,927 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          03:34:00,927 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >)
          03:34:00,934 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          03:34:00,934 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >)
          03:34:00,939 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          03:34:00,939 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >)
          03:34:00,942 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          03:34:00,942 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >)
          03:34:01,109 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          03:34:01,109 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000101:e7b8:4a9a19bd:86 status: ActionStatus.ABORT_ONLY >)




          Can someone help me?

          • 2. Re: Seam 2.2.0GA + JBoss AS 5.1GA + Postgres 8.4
            rgoytacaz

            Cant I edit my posts?

            • 3. Re: Seam 2.2.0GA + JBoss AS 5.1GA + Postgres 8.4
              shavo26

              nice stack trace.
              Came upon this error to when i was creating a CRUD seam project using seam-gen and an existing database on postgres.


              Environment:
              seam 2.2.0.GA
              jdk 1.6
              jboss 5.1.0.GA
              post gres 8.4
              i used the driver jar postgresql-8.4-701.jdbc3.jar


              The problem is around catalog as far as im aware. Once i removed this property from persistence.xml and ran seam restart i could access one of my entities via web browser.


              persistence.xml



              <persistence-unit name="open18">
                    <provider>org.hibernate.ejb.HibernatePersistence</provider>
                    <jta-data-source>open18Datasource</jta-data-source>
                    <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
                    <!--
                    <jar-file>../../vehicles.jar</jar-file>
                    -->
                    <properties>
                       <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
                       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                       <property name="hibernate.show_sql" value="true"/>
                       <property name="hibernate.format_sql" value="true"/>
                       <!-- <property name="hibernate.default_catalog" value="pg_catalog"/> -->
                       <property name="hibernate.default_schema" value="open18"/>
                       <property name="jboss.entity.manager.factory.jndi.name" value="java:/open18EntityManagerFactory"/>
                    </properties>
                 </persistence-unit>





              connection url should be in the formats:





                 jdbc:postgresql:database
                  jdbc:postgresql://host/database
                  jdbc:postgresql://host:port/database





              I used the second choice.
              Here is my seam-gen.properties too:




              #Generated by seam setup
              #Fri Apr 16 16:27:48 EST 2010
              hibernate.connection.password=Buckyboy12
              workspace.home=h\:/Projects/seaminaction-20090413/seaminaction/projects/shane
              hibernate.connection.dataSource_class=org.postgresql.jdbc3.Jdbc3ConnectionPool
              model.package=org.open18.model
              hibernate.default_catalog=pg_catalog
              driver.jar=C\:/InstalledSoftware/eBusiness/jboss-5.1.0.GA-jdk6/jboss-5.1.0.GA/common/lib/postgresql-8.4-701.jdbc3.jar
              action.package=org.open18.action
              test.package=org.open18.test
              database.type=postgres
              richfaces.skin=glassX
              glassfish.domain=domain1
              hibernate.default_schema=open18
              database.drop=y
              project.name=open18
              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=C\:/InstalledSoftware/eBusiness/jboss-5.1.0.GA-jdk6/jboss-5.1.0.GA
              driver.license.jar=
              hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
              hibernate.connection.url=jdbc\:postgresql\://localhost/postgres
              icefaces=n



              To summarise, these are the main properties your interested in:



              hibernate.default_catalog=PostgreSQL
              hibernate.default_schema=Core
              hibernate.connection.username=postgres
              hibernate.connection.url=jdbc\:postgresql\:Atom





              if you remove catalog from your persistence.xml then try to restart your app and see if exception still occurs.




              • 4. Re: Seam 2.2.0GA + JBoss AS 5.1GA + Postgres 8.4
                shavo26

                ha i dont receive that error anymore but when i try and access one of my entities lists i get a stacktrace:




                SEVERE [facelets.viewhandler] (http-127.0.0.1-8080-5) Error Rendering View[/MemberList.xhtml]
                javax.el.ELException: /MemberList.xhtml: Error reading 'resultList' on type org.open18.action.MemberList_$$_javassist_seam_7
                        at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
                        at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
                        at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)
                Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: member near line 1, column 8 [select member from org.open18.model.Member member]
                        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:601)
                        at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:96)
                        at org.jboss.seam.persistence.EntityManagerProxy.createQuery(EntityManagerProxy.java:81)
                        at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:181)
                Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: member near line 1, column 8 [select member from org.open18.model.Member member]
                        at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
                        at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)





                I find it strange on seam 2.2.0 that creating a CRUD project via seam gen and existing db schema, i would have any issues in the first place, or is this an issue around postgres?