Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sudhakar Tadepalli
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it in WEB-INF or WEB-INF/classes?
 
sudhakar Tadepalli
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File path is : WEB-INF/hibernate.properties

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

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic