-->
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.  [ 11 posts ] 
Author Message
 Post subject: Console - Can't create SessionFactory because mapping ...
PostPosted: Wed Jun 08, 2005 7:00 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
Hi,

I wanna create a SessionFactory from the Console-View (like its described in the docs). But I always get an error that the mapping-files are missing. The mapping-files are in the same path, as they are mapped in the hibernate.cfg.xml. So I don't know, what I'm doing wrong.

Any suggestions, what would cause such an error?

Thanks
Jonny


Hibernate version: 3.0.2


Full stack trace of any exception that occurs:
Problem while executing Create SessionFactory (org.hibernate.MappingException: Resource: de/model/Item.hbm.xml not found)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 8:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Have you added the build path to your console configuration ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 9:05 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
Hi,

Quote:
Have you added the build path to your console configuration ?

build path == where my POJOS and Mapping-Files are?
I added this path to "Classpath (only add POJO and driver - No Hibernate jars!)". Didn't change anythig. Same errors.

Adding the mapping files manually to "Mapping Files" didn't change anything either.

Thanks
Jonny


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 9:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
build path = where .class and mapping files are + drivers

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 9:49 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
Hi,

still can't get it running.

Here some configuration-facts of mine:

Name: HibernateTest
Property file:
Configuration file: \Test\hibernate.cfg.xml

Classpath:
/Test/de/hibernate/test/ (here are my .class and .hbm.xml files)
/Test/mysql-connector-java-3.1.8-bin.jar


My hibernate.cfg.xml:
<hibernate-configuration>
<session-factory name="sessionFactory">
...
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="de/hibernate/test/Spfli.hbm.xml" />
<mapping resource="de/hibernate/test/Saplane.hbm.xml" />
...

Still the same error "mapping file not found".

(When I comment the mapping files in the hibernate.cfg.xml out and add the mapping-files manually, I get the error, that the corresponding class isn't found.)

Thanks
Jonny


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 9:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Please show the stacktrace and verify that the hbernate/test directory indeed contains the .class and .hbm.xml as indicated (meaning hibernate/test/de/hibernate/test/Spfli.hbm.xml exists!)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 10:17 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
Probably dumb question:
Where can I lookup the stacktrace (in eclipse)?
You mean the stacktrace that comes up in the window?

Jonny


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 10:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
its in the Error Log window - but I think you should check that file location as I don't think you have pointed to the rigth root of your classes/mapping files.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 10:56 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
Hi,

I get the error:
Problem while executing Create SessionFactory(org.hibernate.MappingException: Resource: de/hibernate/test/Spfli.hbm.xml not found)


The files are mapped in the hibernate.cfg.xml like this: "<mapping resource="de/hibernate/test/Spfli.hbm.xml" />"


The problem is that I don't know from which path the console is looking (relatively) for the files. So this error doesn't help me much.
Is the console looking for the files from the root (my projekt folder) or relativley from the hibernate.cfg.xml?

Thanks
Jonny


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it looks for that path relatively to the classpath you have specified in your console configuration

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 11:09 am 
Beginner
Beginner

Joined: Wed Nov 17, 2004 11:15 am
Posts: 25
And suddenly it works just fine!!!!!


Thank you very much (for your patience)!!

Cheers
Jonny


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