0

您好 GWT+Hibernate+Gilead 不工作我已经从这个链接 https://developers.google.com/web-toolkit/articles/using_gwt_with_hibernate下载了示例代码。

我不知道出了什么问题,我不断收到此错误参数 0 的类型未知“com.google.musicstore.domain.Account/3669536145”

 [java] 16 [btpool0-0] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
 [java] 20 [btpool0-0] INFO org.hibernate.cfg.Environment - hibernate.properties not found
 [java] 24 [btpool0-0] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
 [java] 30 [btpool0-0] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
 [java] 105 [btpool0-0] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
 [java] 105 [btpool0-0] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
 [java] 192 [btpool0-0] INFO org.hibernate.cfg.Configuration - Reading mappings from resource :com/google/musicstore/domain/Record.hbm.xml
 [java] 286 [btpool0-0] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.google.musicstore.domain.Record -> PUBLIC.RECORD
 [java] 359 [btpool0-0] INFO org.hibernate.cfg.Configuration - Reading mappings from resource :com/google/musicstore/domain/Account.hbm.xml
 [java] 391 [btpool0-0] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.google.musicstore.domain.Account -> PUBLIC.ACCOUNT
 [java] 468 [btpool0-0] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.google.musicstore.domain.Account.records -> PUBLIC.ACCOUNT_RECORD
 [java] 490 [btpool0-0] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
 [java] 569 [btpool0-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
 [java] 569 [btpool0-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 2
 [java] 569 [btpool0-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
 [java] 577 [btpool0-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost/
 [java] 578 [btpool0-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=sa, password=****}
 [java] 866 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - RDBMS: HSQL Database Engine, version: 2.2.8
 [java] 866 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: HSQL Database Engine Driver, version: 2.2.8
 [java] 886 [btpool0-0] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.HSQLDialect
 [java] 899 [btpool0-0] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
 [java] 903 [btpool0-0] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
 [java] 903 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
 [java] 903 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at endof transaction: disabled
 [java] 903 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
 [java] 903 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
 [java] 904 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
 [java] 904 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
 [java] 905 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Default schema: PUBLIC
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
 [java] 906 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
 [java] 910 [btpool0-0] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
 [java] 910 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
 [java] 910 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
 [java] 910 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
 [java] 910 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
 [java] 944 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
 [java] 945 [btpool0-0] INFO org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge -Cache provider: org.hibernate.cache.NoCacheProvider
 [java] 945 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
 [java] 945 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
 [java] 951 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
 [java] 952 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
 [java] 952 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
 [java] 952 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
 [java] 952 [btpool0-0] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
 [java] 1067 [btpool0-0] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
 [java] 1500 [btpool0-0] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
 [java] 1510 [btpool0-0] INFO org.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
 [java] 1511 [btpool0-0] INFO org.hibernate.tool.hbm2ddl.SchemaExport - exporting generated schema to database
 [java] GWT15
 [java] 1583 [btpool0-0] INFO org.hibernate.tool.hbm2ddl.SchemaExport - schema export complete 

这是我正在使用的 jar 文件

适配器4gwt-1.2.3.823.jar

适配器核心 1.2.3.823.jar

antlr-2.7.6.jar

asm-3.2.jar

beanlib-hibernate-3.2.1.jar

cglib-2.2.jar

commons-collections-3.1.jar

commons-lang-2.4.jar

commons-logging-1.1.1.jar

dom4j-1.6.1.jar

hibernate-core-3.3.1.GA.jar

hibernate-jpa-2.0-api-1.0.0.Final.jar

hibernate-util-1.2.3.823.jar

hsqldb.jar

javassist-3.4.GA.jar

jboss-serialization.jar

jta-1.1.jar

log4j-1.2.15.jar

slf4j-api-1.5.2.jar

slf4j-simple-1.5.2.jar

trove-2.0.4.jar

请帮我解决这个问题,告诉我我错在哪里,提前谢谢

4

1 回答 1

1

那么,对于“较新”版本的 GWT(即我认为比 1.7 更新),您将需要使用更新版本的 Gilead。AFAIK,你描述的问题早就解决了。最后一个版本是2010 年 5 月 22 日的1.3.2 版

是的,这个版本已经过时了,Gilead 也不再更新了。但是,即使使用最新的 GWT 版本(当前为 2.5 rc),只要您使用的是 Hibernate <= 3.5.x,它仍然有效。

我真的不建议现在与 Gilead 开始一个项目,请参阅http://sourceforge.net/projects/gilead/forums/forum/868076/topic/4525959

于 2012-07-27T18:30:09.120 回答