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.  [ 5 posts ] 
Author Message
 Post subject: mapping error
PostPosted: Tue Mar 06, 2007 12:11 pm 
Newbie

Joined: Fri Mar 02, 2007 11:21 am
Posts: 9
Location: Mali
May someone help find the cause of this problem?
I am using the tutorial.

best regards




16:58:42,704 INFO Environment:500 - Hibernate 3.2.0
16:58:42,782 INFO Environment:518 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.hsqldb.jdbcDriver, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.format_sql=true, hibernate.query.substitutions=yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=sa, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:hsqldb:./build/db/hsqldb/hibernate, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
16:58:42,782 INFO Environment:549 - using java.io streams to persist binary types
16:58:42,782 INFO Environment:667 - Bytecode provider name : cglib
16:58:42,798 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
16:58:42,922 INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml
16:58:42,922 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml
16:58:43,078 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
16:58:43,078 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
16:58:43,078 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
16:58:43,172 DEBUG Configuration:1311 - connection.driver_class=org.postgresql.Driver
16:58:43,172 DEBUG Configuration:1311 - connection.url=jdbc:hsqldb:hsql://192.168.1.28/HibernateTest
16:58:43,172 DEBUG Configuration:1311 - connection.username=postgres
16:58:43,172 DEBUG Configuration:1311 - connection.password=
16:58:43,172 DEBUG Configuration:1311 - connection.pool_size=1
16:58:43,453 DEBUG Configuration:1311 - dialect=org.hibernate.dialect.PostgreSQLDialect
16:58:43,453 DEBUG Configuration:1311 - current_session_context_class=thread
16:58:43,453 DEBUG Configuration:1311 - cache.provider_class=org.hibernate.cache.NoCacheProvider
16:58:43,453 DEBUG Configuration:1311 - show_sql=true
16:58:43,453 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@36eb8241 [Attribute: name resource value "events/Event.hbm.xml"]
16:58:43,468 INFO Configuration:507 - Reading mappings from resource: events/Event.hbm.xml
16:58:43,468 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
16:58:43,468 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
16:58:43,468 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
16:58:43,983 INFO HbmBinder:300 - Mapping class: Event -> EVENTS

Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource events/Event.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at util.HibernateUtil.<clinit>(HibernateUtil.java:28)
at events.EventManager.listEvents(EventManager.java:51)
at events.EventManager.main(EventManager.java:31)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource events/Event.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:523)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1511)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1352)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1338)
at util.HibernateUtil.<clinit>(HibernateUtil.java:24)
... 2 more
Caused by: org.hibernate.MappingException: class Event not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:401)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:334)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:424)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:465)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:520)
... 9 more
Caused by: java.lang.ClassNotFoundException: Event
at java.net.URLClassLoader.findClass(URLClassLoader.java:375)
at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
... 17 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 12:14 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
En français ce serait mieux :-)

Il semble qu'il ne trouve pas la classe Event. Si tu veux plus d'aide soit plus précis

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 12:29 pm 
Newbie

Joined: Fri Mar 02, 2007 11:21 am
Posts: 9
Location: Mali
scesbron wrote:
En français ce serait mieux :-)

Il semble qu'il ne trouve pas la classe Event. Si tu veux plus d'aide soit plus précis


Merci SEB

Pardonnez,
A force de lire les msg d'erreur en Eng, je me suis anglaisé :)

depuis hier ca me donne cette error.
arborescence des repertoires est ceci:
-hibernate2
-src
-events
-Event.java
-EventManager.java
Event.hbm.xml
-util
-hibernate.cfg.xml

et ds le config j'ai:
<mapping resource="events/Event.hbm.xml" />

merci


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 12:38 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Ce ne serait pas dans ton Event.hbm.xml ou tu aurais oublié de mettre events.Event et où tu aurais mis Event ?

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 1:07 pm 
Newbie

Joined: Fri Mar 02, 2007 11:21 am
Posts: 9
Location: Mali
scesbron wrote:
Ce ne serait pas dans ton Event.hbm.xml ou tu aurais oublié de mettre events.Event et où tu aurais mis Event ?


Dear Seb,
vous pointé du doit le pbl. c'etait Event, en mettant events.Event ca passe l'etape.

maintenant, pbl de jdbc, pourtant j'ai chargé le pilote pour pour mon SGBD, postgres.

msg:


Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.beginTransaction(Unknown Source)
at events.EventManager.listEvents(EventManager.java:52)
at events.EventManager.main(EventManager.java:30)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:158)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
... 13 more


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.