为文本的大墙感到抱歉,但它主要记录
Thx为我的任何问题提供帮助,
我一直在寻求Seam论坛的帮助,但都是徒劳的。
我正在尝试标题中提到的设置,但没有成功。
我把它都安装好了,问题从接缝开始。
,这是我的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./seam create-project工作正常,但是当我尝试generate-entities时,我得到以下.
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).,这是一号问题。我该怎么解决这个问题?这是什么?我不得不在日食中这样做。成功了,
然后,我将seam创建的项目导入eclipse,并部署到JBoss 5.1中。当我的服务器启动时,我注意到以下情况..
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问题2号。这是什么跨数据库引用?
这个呢..。
03:18:55,089 INFO [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.4 JDBC3 (build 701)问题3号我在build.properties中说过要使用JDBC4驱动程序,我不知道seam为什么坚持使用JDBC3驱动程序。我在哪里换这个?
当我进入http://localhost:5443/Commerce并尝试浏览自动生成的CRUD时。
我知道这个错误..。在com.atom.Commerce.action.ProductsList_$$_javassist_seam_2类型上读取“resultList”时错误
这就是我的服务器日志中显示的..。
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
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query问题4号这是怎么回事?跨数据库参考?
在我的任何问题上提供任何帮助。
发布于 2009-09-08 09:57:33
您确实在Seam论坛(这里和这里)上收到了一些答案,但是您没有跟进。总之,所有这些实际上都是由一个问题引起的:
hibernate.default_catalog=PostgreSQL“替换为属性:"hibernate.default_catalog.null=",以便您的文件看起来如下所示:
..。这是被替换的属性driver.jar=/home/rgoytacaz/postgresql-8.4-701.jdbc4.jar .
之后您应该能够很好地使用seam generate-entities (假设您的配置的其余部分是正确的)。我建议把这代人放到一个干净的文件夹里。PostgreSQL.atom.productsculturedetail,不支持这一点,因此,当表名中有超过一个句点时,PostgreSQL会发出抱怨,因此在PostgreSQL中,粗体部分应该删除。Hibernate在告诉它使用默认目录时添加了这个前缀,我们在上面的步骤1中已经修复了这个前缀(告诉它不要使用目录),所以在重新生成实体之后应该修复这个问题。
(请注意,这实际上与Stuart告诉您的相同,您应该删除实体类的注释中的catalog="PostgreSQL"属性。)postgresql-8.4-701.jdbc4.jar文件时,这并不意味着驱动程序支持JDBC4。尽管文件的名称会说明这一点,但驱动程序的网站清楚地指出“驱动程序提供了JDBC3规范的合理完整的实现”。这对您来说不应该是个问题,因为您没有直接使用驱动程序(或者至少您不应该使用)。驱动程序足以满足Hibernate的需求并提供所需的功能。https://stackoverflow.com/questions/1354446
复制相似问题