This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes hibernate execution errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate execution errors" Watch "hibernate execution errors" New topic
Author

hibernate execution errors

oussama jlassi
Greenhorn

Joined: Dec 23, 2011
Posts: 25
i m begenning in hibernate and when i want to execute my code to display and insert date into table test i have a listes of error
how to add update and delete to my code
i use hibernate 4 and mysql 5.5
password in mysql connection is a space not the word space

hibernate.cfg.xml


test.hbm.xml


test.java


manhib4.java


in compilation i have
manhib4.java:10: warning: [deprecation] buildSessionFactory() in Configuration h
as been deprecated
SessionFactory sessionFactory = new Configuration().configure().buildSession
Factory();
^
manhib4.java:22: warning: [rawtypes] found raw type: Iterator
Iterator it = query.iterate();
^
missing type arguments for generic class Iterator<E>
where E is a type-variable:
E extends Object declared in interface Iterator
2 warnings


in execution i have
fÚvr. 24, 2012 10:38:18 AM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
fÚvr. 24, 2012 10:38:18 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.0.Final}
fÚvr. 24, 2012 10:38:18 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
fÚvr. 24, 2012 10:38:18 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
fÚvr. 24, 2012 10:38:18 AM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
fÚvr. 24, 2012 10:38:18 AM org.hibernate.cfg.Configuration getConfigurationInput
Stream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
fÚvr. 24, 2012 10:38:19 AM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: test.hbm.xml
fÚvr. 24, 2012 10:38:19 AM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
fÚvr. 24, 2012 10:38:19 AM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production us
e!)
fÚvr. 24, 2012 10:38:19 AM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 10
fÚvr. 24, 2012 10:38:19 AM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
fÚvr. 24, 2012 10:38:19 AM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://192.1
68.10.13:3306/data]
fÚvr. 24, 2012 10:38:19 AM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=root, password=****}
fÚvr. 24, 2012 10:38:41 AM org.hibernate.engine.jdbc.internal.JdbcServicesImpl c
onfigure
WARN: HHH000342: Could not obtain connection to query metadata : Communications
link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driv
er has not received any packets from the server.
fÚvr. 24, 2012 10:38:41 AM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
fÚvr. 24, 2012 10:38:41 AM org.hibernate.engine.jdbc.internal.LobCreatorBuilder
useContextualLobCreation
INFO: HHH000422: Disabling contextual LOB creation as connection was null
fÚvr. 24, 2012 10:38:41 AM org.hibernate.engine.transaction.internal.Transaction
FactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
fÚvr. 24, 2012 10:38:41 AM org.hibernate.hql.internal.ast.ASTQueryTranslatorFact
ory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Exception in thread "main" org.hibernate.MappingException: Could not get constru
ctor for org.hibernate.persister.entity.SingleTableEntityPersister
at org.hibernate.persister.internal.PersisterFactoryImpl.create(Persiste
rFactoryImpl.java:185)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPer
sister(PersisterFactoryImpl.java:135)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.j
ava:367)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1740)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1778)
at manhib4.main(manhib4.java:10)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tupli
zer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:138)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTupl
izer(EntityTuplizerFactory.java:188)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.jav
a:341)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(Abstrac
tEntityPersister.java:502)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(Sing
leTableEntityPersister.java:144)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.persister.internal.PersisterFactoryImpl.create(Persiste
rFactoryImpl.java:163)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:135)
... 14 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for
t1 in class test
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicProper
tyAccessor.java:316)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyA
ccessor.java:310)
at org.hibernate.mapping.Property.getGetter(Property.java:320)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(Poj
oEntityTuplizer.java:436)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEnti
tyTuplizer.java:200)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTupliz
er.java:82)
... 19 more
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3833

WARN: HHH000342: Could not obtain connection to query metadata : Communications
link failure...

Check your connection to DB and fix it first.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
oussama jlassi
Greenhorn

Joined: Dec 23, 2011
Posts: 25
i changed url connection to jdbc:mysql://localhost:3306/base and password and i get
fÚvr. 25, 2012 10:16:30 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
fÚvr. 25, 2012 10:16:30 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.0.Final}
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Configuration getConfigurationInput
Stream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: test.hbm.xml
fÚvr. 25, 2012 10:16:30 PM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
fÚvr. 25, 2012 10:16:31 PM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production us
e!)
fÚvr. 25, 2012 10:16:31 PM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 10
fÚvr. 25, 2012 10:16:31 PM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
fÚvr. 25, 2012 10:16:31 PM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://local
host:3306/base]
fÚvr. 25, 2012 10:16:31 PM org.hibernate.service.jdbc.connections.internal.Drive
rManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=root, password=****}
fÚvr. 25, 2012 10:16:33 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
fÚvr. 25, 2012 10:16:33 PM org.hibernate.engine.transaction.internal.Transaction
FactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
fÚvr. 25, 2012 10:16:34 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFact
ory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Exception in thread "main" org.hibernate.MappingException: Could not get constru
ctor for org.hibernate.persister.entity.SingleTableEntityPersister
at org.hibernate.persister.internal.PersisterFactoryImpl.create(Persiste
rFactoryImpl.java:185)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPer
sister(PersisterFactoryImpl.java:135)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.j
ava:367)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1740)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1778)
at manhib4.main(manhib4.java:10)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tupli
zer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:138)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTupl
izer(EntityTuplizerFactory.java:188)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.jav
a:341)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(Abstrac
tEntityPersister.java:502)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(Sing
leTableEntityPersister.java:144)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.persister.internal.PersisterFactoryImpl.create(Persiste
rFactoryImpl.java:163)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:135)
... 14 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for
t1 in class test
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicProper
tyAccessor.java:316)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyA
ccessor.java:310)
at org.hibernate.mapping.Property.getGetter(Property.java:320)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(Poj
oEntityTuplizer.java:436)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEnti
tyTuplizer.java:200)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTupliz
er.java:82)
... 19 more
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3833

org.hibernate.PropertyNotFoundException: Could not find a getter for
t1 in class test ...

Check your test class for this error also...
 
 
subject: hibernate execution errors