aspose file tools*
The moose likes Object Relational Mapping and the fly likes hibernate.properties not found error , But I have the file in classpath 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.properties not found error , But I have the file in classpath" Watch "hibernate.properties not found error , But I have the file in classpath" New topic
Author

hibernate.properties not found error , But I have the file in classpath

sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
Hi, I an trying this "http://homepage.mac.com/edahand/projects/java/example1.html" example . I am using WSAD5.1.1,hibernate3.jar and created hibernate.propertiesfile manually and kept it in WEB-INF directory.
As i am using DB2 database i have changed MySQL configuration to DB2 Configuration like this.

## DB2

hibernate.connection.driver_class = COM.ibm.db2.jdbc.app.DB2Driver
hibernate.connection.url = jdbc b2:test
hibernate.connection.username = db2admin
hibernate.connection.password = db2admin
hibernate.dialect = org.hibernate.dialect.DB2Dialect

When I run the application I am getting following exception. "hibernate.properties not found" and "Hibernate ExceptionThe dialect was not set. Set the property "

Can some one help me what i am doing wrong ? Do i have to create hibernate.cfg.xml ? Is there any tool or plugin perspective for WSAD to crate this ?

[4/15/05 9:45:39:941 PDT] 5676b2b9 Environment I org.hibernate.cfg.Environment Hibernate 3.0
[4/15/05 9:45:39:941 PDT] 5676b2b9 Environment I org.hibernate.cfg.Environment hibernate.properties not found
[4/15/05 9:45:39:961 PDT] 5676b2b9 Environment I org.hibernate.cfg.Environment using CGLIB reflection optimizer
[4/15/05 9:45:39:971 PDT] 5676b2b9 Environment I org.hibernate.cfg.Environment using JDK 1.4 java.sql.Timestamp handling
[4/15/05 9:45:40:903 PDT] 5676b2b9 Configuration I org.hibernate.cfg.Configuration Mapping resource: com/edhand/example1/Item.hbm.xml
[4/15/05 9:45:42:685 PDT] 5676b2b9 HbmBinder I org.hibernate.cfg.HbmBinder Mapping class: com.edhand.example1.Item -> item
[4/15/05 9:45:42:845 PDT] 5676b2b9 Configuration I org.hibernate.cfg.Configuration processing extends queue
[4/15/05 9:45:42:845 PDT] 5676b2b9 Configuration I org.hibernate.cfg.Configuration processing collection mappings
[4/15/05 9:45:42:856 PDT] 5676b2b9 Configuration I org.hibernate.cfg.Configuration processing association property references
[4/15/05 9:45:42:856 PDT] 5676b2b9 Configuration I org.hibernate.cfg.Configuration processing foreign key constraints
Hibernate ExceptionThe dialect was not set. Set the property hibernate.dialect.
[4/15/05 9:45:44:488 PDT] 5676b2b9 WebGroup E SRVE0026E: [Servlet Error]-[The dialect was not set. Set the property hibernate.dialect.]: java.lang.RuntimeException: The dialect was not set. Set the property hibernate.dialect.
at com.edhand.example1.ConnectionFactory.<init>(ConnectionFactory.java:79)


Thanks
Sudhakar
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Is it in WEB-INF or WEB-INF/classes?


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
File path is : WEB-INF/hibernate.properties

I think I must include Item.hbm.xml into hiberante.cfg.xml right ?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate.properties not found error , But I have the file in classpath