-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: ClassCastException when calling Session.save()
PostPosted: Fri Apr 08, 2005 10:17 am 
Newbie

Joined: Fri Apr 08, 2005 9:51 am
Posts: 3
Hello,
I have a simple java class I am using to try to learn how to use hibernate shown below. I get this ClassCastException with any class I try to persist using hibernate. I think it is probably a configuration issue but I'm stumped. Anyone know what I am doing wrong?

public class Widget{
private String comments;
private int id;
public Widget(){
}

public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
}


Hibernate version:
3
Mapping document:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class entity-name="Widget">
<id name="id" type="int">
<generator class="native"/>
</id>
<property name="comments" type="string"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
tl.set(session);
Transaction tx = session.beginTransaction();
Widget w = new Widget();
w.setComments("mycomment");
session.save(w);
tx.commit();


Full stack trace of any exception that occurs:
java.lang.ClassCastException
at org.hibernate.property.MapAccessor$MapSetter.set(MapAccessor.java:45)
at org.hibernate.tuple.AbstractTuplizer.setIdentifier(AbstractTuplizer.java:130)
at org.hibernate.persister.entity.BasicEntityPersister.setIdentifier(BasicEntityPersister.java:2952)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:145)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424)
Name and version of the database:
postgresql 8, I also tried with mysql and had the same problem


Debug level Hibernate log excerpt:
09:03:25,906 INFO Environment:460 - Hibernate 3.0
09:03:25,906 INFO Environment:473 - hibernate.properties not found
09:03:25,916 INFO Environment:506 - using CGLIB reflection optimizer
09:03:25,916 INFO Environment:536 - using JDK 1.4 java.sql.Timestamp handling
09:03:25,977 INFO Configuration:1159 - configuring from resource: /hibernate.cfg.xml
09:03:25,977 INFO Configuration:1130 - Configuration resource: /hibernate.cfg.xml
09:03:26,227 DEBUG DTDEntityResolver:42 - trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
09:03:26,237 DEBUG DTDEntityResolver:53 - found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
09:03:26,297 DEBUG Configuration:1116 - show_sql=true
09:03:26,297 DEBUG Configuration:1116 - hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
09:03:26,297 DEBUG Configuration:1116 - hibernate.connection.driver_class=org.postgresql.Driver
09:03:26,297 DEBUG Configuration:1116 - hibernate.connection.url=jdbc:postgresql://10.7.3.22/testresults
09:03:26,297 DEBUG Configuration:1116 - hibernate.connection.username=postgres
09:03:26,297 DEBUG Configuration:1116 - hibernate.connection.password=postgres
09:03:26,297 DEBUG Configuration:1311 - null<-org.dom4j.tree.DefaultAttribute@79717e [Attribute: name resource value "Widget.hbm.xml"]
09:03:26,297 INFO Configuration:440 - Mapping resource: Widget.hbm.xml
09:03:26,297 DEBUG DTDEntityResolver:42 - trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
09:03:26,297 DEBUG DTDEntityResolver:53 - found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
09:03:26,417 INFO HbmBinder:258 - Mapping class: Widget -> Widget
09:03:26,427 DEBUG HbmBinder:1089 - Mapped property: id -> id
09:03:26,427 DEBUG HbmBinder:1089 - Mapped property: comments -> comments
09:03:26,427 INFO Configuration:1271 - Configured SessionFactory: null
09:03:26,437 DEBUG Configuration:1272 - properties: {hibernate.connection.password=postgres, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\j2re1.4.2_03\bin, java.vm.version=1.4.2_03-b02, hibernate.connection.username=postgres, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\work\eclipse\workspace\tmp-work, java.runtime.version=1.4.2_03-b02, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\Java\j2re1.4.2_03\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\MCLEVE~1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Program Files\Java\j2re1.4.2_03\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\work\eclipse\workspace\BuildTools\ant\bin;C:\j2sdk1.4.2_07\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, user.home=C:\Documents and Settings\mcleveland, user.timezone=America/Chicago, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=org.postgresql.Driver, show_sql=true, user.name=mcleveland, java.class.path=C:\work\eclipse\workspace\tmp-work;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\servlet.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\gnujaxp.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\jcommon-1.0.0-pre2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-collections-2.1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-logging-1.0.4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\concurrent-1.3.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\connector.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\hibernate3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\log4j-1.2.9.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\oscache-2.1.jar;C:\work\eclipse\workspace\nBBS\tests\lib\postgresql-8.0-310.jdbc2.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\jfreechart-1.0.0-pre2.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\junit.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\dom4j-1.5.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-antlr-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-junit-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-launcher-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\antlr-2.7.5H3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-swing-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\asm.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\asm-attrs.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\c3p0-0.8.5.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\cglib-2.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\cleanimports.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-collections-2.1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-logging-1.0.4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\concurrent-1.3.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\connector.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\dom4j-1.5.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ehcache-1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\hibernate3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jaas.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jacc-1_0-fr.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jaxen-1.1-beta-4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-cache.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-common.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-jmx.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-system.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jdbc2_0-stdext.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jgroups-2.2.7.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jta.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\junit-3.8.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\log4j-1.2.9.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\oscache-2.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\proxool-0.8.3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\swarmcache-1.0rc2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\versioncheck.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\xerces-2.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\xml-apis.jar;C:\work\eclipse\workspace\nBBS\tests\lib\mysql-connector-java-3.0.16-ga-bin.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\j2re1.4.2_03, sun.arch.data.model=32, hibernate.connection.url=jdbc:postgresql://10.7.3.22/testresults, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_03, java.ext.dirs=C:\Program Files\Java\j2re1.4.2_03\lib\ext, sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_03\lib\rt.jar;C:\Program Files\Java\j2re1.4.2_03\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_03\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2_03\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2_03\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_03\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2_03\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.cpu.isalist=pentium i486 i386}
09:03:26,437 DEBUG Configuration:1047 - Preparing to build session factory with filters : {}
09:03:26,437 INFO Configuration:851 - processing extends queue
09:03:26,437 INFO Configuration:855 - processing collection mappings
09:03:26,437 INFO Configuration:864 - processing association property references
09:03:26,437 INFO Configuration:893 - processing foreign key constraints
09:03:26,547 INFO Dialect:91 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
09:03:26,557 DEBUG SQLExceptionConverterFactory:52 - Using dialect defined converter
09:03:26,557 INFO SettingsFactory:90 - Default batch fetch size: 1
09:03:26,557 INFO SettingsFactory:94 - Generate SQL with comments: disabled
09:03:26,557 INFO SettingsFactory:98 - Order SQL updates by primary key: disabled
09:03:26,557 INFO SettingsFactory:273 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
09:03:26,567 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
09:03:26,567 INFO SettingsFactory:106 - Query language substitutions: {}
09:03:26,567 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
09:03:26,567 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
09:03:26,567 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
09:03:26,567 INFO DriverManagerConnectionProvider:80 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://10.7.3.22/testresults
09:03:26,567 INFO DriverManagerConnectionProvider:83 - connection properties: {user=postgres, password=postgres}
09:03:26,567 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
09:03:26,567 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
09:03:26,688 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:postgresql://10.7.3.22/testresults, Isolation Level: 2
09:03:26,698 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
09:03:26,698 INFO SettingsFactory:148 - JDBC batch size: 15
09:03:26,698 INFO SettingsFactory:151 - JDBC batch updates for versioned data: disabled
09:03:26,698 INFO SettingsFactory:156 - Scrollable result sets: enabled
09:03:26,698 DEBUG SettingsFactory:160 - Wrap result sets: disabled
09:03:26,698 INFO SettingsFactory:164 - JDBC3 getGeneratedKeys(): disabled
09:03:26,708 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
09:03:26,708 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
09:03:26,708 INFO SettingsFactory:176 - Automatic flush during beforeCompletion(): disabled
09:03:26,708 INFO SettingsFactory:179 - Automatic session close at end of transaction: disabled
09:03:26,708 INFO SettingsFactory:260 - Cache provider: org.hibernate.cache.EhCacheProvider
09:03:26,708 INFO SettingsFactory:187 - Second-level cache: enabled
09:03:26,708 INFO SettingsFactory:192 - Optimize cache for minimal puts: disabled
09:03:26,708 INFO SettingsFactory:199 - Structured second-level cache entries: enabled
09:03:26,708 INFO SettingsFactory:203 - Query cache: disabled
09:03:26,708 INFO SettingsFactory:210 - Echoing all SQL to stdout
09:03:26,708 INFO SettingsFactory:214 - Statistics: disabled
09:03:26,718 INFO SettingsFactory:218 - Deleted entity synthetic identifier rollback: disabled
09:03:26,718 INFO SettingsFactory:232 - Default entity-mode: pojo
09:03:26,838 INFO SessionFactoryImpl:140 - building session factory
09:03:26,838 DEBUG SessionFactoryImpl:149 - Session factory constructed with filter configurations : {}
09:03:26,838 DEBUG SessionFactoryImpl:152 - instantiating session factory with properties: {hibernate.connection.password=postgres, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\j2re1.4.2_03\bin, java.vm.version=1.4.2_03-b02, hibernate.connection.username=postgres, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\work\eclipse\workspace\tmp-work, java.runtime.version=1.4.2_03-b02, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\Java\j2re1.4.2_03\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\MCLEVE~1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Program Files\Java\j2re1.4.2_03\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\work\eclipse\workspace\BuildTools\ant\bin;C:\j2sdk1.4.2_07\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, user.home=C:\Documents and Settings\mcleveland, user.timezone=America/Chicago, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=org.postgresql.Driver, show_sql=true, user.name=mcleveland, java.class.path=C:\work\eclipse\workspace\tmp-work;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\servlet.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\gnujaxp.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\jcommon-1.0.0-pre2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-collections-2.1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-logging-1.0.4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\concurrent-1.3.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\connector.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\hibernate3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\log4j-1.2.9.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\oscache-2.1.jar;C:\work\eclipse\workspace\nBBS\tests\lib\postgresql-8.0-310.jdbc2.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\jfreechart-1.0.0-pre2.jar;C:\work\eclipse\workspace\tmp-work\lib\jfreechart\junit.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\dom4j-1.5.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-antlr-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-junit-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-launcher-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\antlr-2.7.5H3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ant-swing-1.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\asm.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\asm-attrs.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\c3p0-0.8.5.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\cglib-2.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\cleanimports.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-collections-2.1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\commons-logging-1.0.4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\concurrent-1.3.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\connector.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\dom4j-1.5.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\ehcache-1.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\hibernate3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jaas.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jacc-1_0-fr.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jaxen-1.1-beta-4.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-cache.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-common.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-jmx.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jboss-system.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jdbc2_0-stdext.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jgroups-2.2.7.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\jta.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\junit-3.8.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\log4j-1.2.9.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\oscache-2.1.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\proxool-0.8.3.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\swarmcache-1.0rc2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\versioncheck.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\xerces-2.6.2.jar;C:\work\eclipse\workspace\tmp-work\lib\hibernate\xml-apis.jar;C:\work\eclipse\workspace\nBBS\tests\lib\mysql-connector-java-3.0.16-ga-bin.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\j2re1.4.2_03, sun.arch.data.model=32, hibernate.connection.url=jdbc:postgresql://10.7.3.22/testresults, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_03, java.ext.dirs=C:\Program Files\Java\j2re1.4.2_03\lib\ext, sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_03\lib\rt.jar;C:\Program Files\Java\j2re1.4.2_03\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_03\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2_03\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2_03\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_03\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2_03\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.cpu.isalist=pentium i486 i386}
09:03:26,848 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/work/eclipse/workspace/tmp-work/lib/hibernate/ehcache-1.1.jar!/ehcache-failsafe.xml
09:03:27,028 DEBUG BasicEntityPersister:2234 - Static SQL for entity: Widget
09:03:27,028 DEBUG BasicEntityPersister:2236 - Version select: select id from Widget where id =?
09:03:27,028 DEBUG BasicEntityPersister:2237 - Snapshot select: select widget_.id, widget_.comments as comments0_ from Widget widget_ where widget_.id=?
09:03:27,028 DEBUG BasicEntityPersister:2239 - Insert 0: insert into Widget (comments, id) values (?, ?)
09:03:27,028 DEBUG BasicEntityPersister:2240 - Update 0: update Widget set comments=? where id=?
09:03:27,038 DEBUG BasicEntityPersister:2241 - Delete 0: delete from Widget where id=?
09:03:27,058 DEBUG EntityLoader:120 - Static select for entity Widget: select widget0_.id as id0_, widget0_.comments as comments0_0_ from Widget widget0_ where widget0_.id=?
09:03:27,068 DEBUG EntityLoader:120 - Static select for entity Widget: select widget0_.id as id0_, widget0_.comments as comments0_0_ from Widget widget0_ where widget0_.id=?
09:03:27,068 DEBUG EntityLoader:120 - Static select for entity Widget: select widget0_.id as id0_, widget0_.comments as comments0_0_ from Widget widget0_ where widget0_.id=? for update
09:03:27,068 DEBUG EntityLoader:120 - Static select for entity Widget: select widget0_.id as id0_, widget0_.comments as comments0_0_ from Widget widget0_ where widget0_.id=? for update
09:03:27,068 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
09:03:27,068 DEBUG SessionFactoryObjectFactory:76 - registered: 8a87826b03221f4e0103221f4fdc0000 (unnamed)
09:03:27,068 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
09:03:27,068 DEBUG SessionFactoryImpl:249 - instantiated session factory
09:03:27,078 INFO SessionFactoryImpl:366 - Checking 0 named queries
09:03:27,098 DEBUG SessionImpl:229 - opened session at timestamp: 4558721052991488
09:03:27,108 DEBUG JDBCTransaction:46 - begin
09:03:27,108 DEBUG AbstractBatcher:408 - opening JDBC connection
09:03:27,108 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
09:03:27,108 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
09:03:27,108 DEBUG JDBCTransaction:50 - current autocommit status: false
09:03:27,108 DEBUG DefaultSaveOrUpdateEventListener:159 - saving transient instance
09:03:27,108 DEBUG AbstractBatcher:276 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
09:03:27,108 DEBUG SQL:310 - select nextval ('hibernate_sequence')
Hibernate: select nextval ('hibernate_sequence')
09:03:27,108 DEBUG AbstractBatcher:364 - preparing statement
09:03:27,108 DEBUG SequenceGenerator:87 - Sequence identifier generated: 2
09:03:27,118 DEBUG AbstractBatcher:284 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
09:03:27,118 DEBUG AbstractBatcher:392 - closing statement
09:03:27,118 DEBUG AbstractSaveEventListener:89 - generated identifier: 2, using strategy: org.hibernate.id.SequenceGenerator
09:03:27,118 DEBUG AbstractSaveEventListener:132 - saving [Widget#2]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 10:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Code:
<class entity-name="Widget">
...


should be
Code:
<class name="Widget">
...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 11:33 am 
Newbie

Joined: Fri Apr 08, 2005 9:51 am
Posts: 3
Thank you! Thank you! Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.