• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Can Any one help Hibernate.properties not found

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i have run the basic hibernate sample that have been give in the net but its giving
Hibernate.properties not found

And i have double checked hibernate.cfg.xml nothing wrong in that

can any one help me how to resolve this issue

Configuration file is


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration>

<session-factory>
<!-- properties -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="show_sql">true</property>

<!-- mapping files -->
<mapping resource="com/test/contact.hbm.xml"/>

</session-factory>

</hibernate-configuration>

 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UseCodeTags
You may get help from this
 
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hibernate.cfg.xml should be placed in the source directory of your project.
If you are using package structure, it should be out of packages, not beside your class file.
If you want to place beside your class file, you have to mention the path.

SessionFactory sessionFactory = new Configuration().configure("path").buildSessionFactory();
 
ksrk mahidhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prabhakar Bokka wrote:hibernate.cfg.xml should be placed in the source directory of your project.
If you are using package structure, it should be out of packages, not beside your class file.
If you want to place beside your class file, you have to mention the path.

SessionFactory sessionFactory = new Configuration().configure("path").buildSessionFactory();




hi thanks for your reply

but i have placed that inside src directory still its showing the same error

my directory structure is

src
inside src i have config file and packges inside those package i have java files and contact.hbm.xml file
 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ideally it should work. But why dont you try with the absolute path and relative path of the hibernate.cfg.xml?

SessionFactory sessionFactory = new Configuration().configure("path").buildSessionFactory();



If still not working post your code.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey We defined the class as

<mapping class="gov.aaa.domain.Assignment" />

Also our file is copied to the WEB-INF folder when we are deploying it to server.

Sarma
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sarmaP lolla wrote:Hey We defined the class as

<mapping class="gov.aaa.domain.Assignment" />

Also our file is copied to the WEB-INF folder when we are deploying it to server.

Sarma



Paste the complete error stacktrace you are getting at console
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what people mean when they say source directory of your project is the route of your application's classpath (assuming you are using the default configuration opetion). Is it there?
 
reply
    Bookmark Topic Watch Topic
  • New Topic