• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can an application have both hibernate.properties file and hibernate.cfg.xml

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In java hibernate can an application have both hibernate.properties file an hibernate.cfg.xml??
I am trying to implement lucene search but when i add the following code to my cfg.xml file i get an error


<property name="hibernate.search.default.directory_provider"
value="filesystem"/>
<property name="hibernate.search.default.indexBase"
value="D:\dojupload\index>
 
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Miranda Mosby wrote:In java hibernate can an application have both hibernate.properties file an hibernate.cfg.xml??




Yes, if you just look for both files in initSessionFactory() I would assume. Why can't you put all configs in the same file?

Please post more details about your setup and especially the details of the error you get like a stacktrace if you have one.

Here is a typical initSessionFactory() where you would to check for both files:

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Miranda Mosby,

First of all, a warm welcome to CodeRanch!

Miranda Mosby wrote:I am trying to implement lucene search but when i add the following code to my cfg.xml file i get an error


Which error do you get? Most people here at the ranch are not clairvoyant, so if you do not TellTheDetails it's hard to know which error you got and to give some proper advice.

Kind regards,
Roel

PS. And you should also UseAMeaningfulSubjectLine as well. I updated the subject line using a much more meaningful one. Hope that's ok for you!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic