cooljava (3) [Avatar] Offline
#1
Hello All,

I am new to the Hibernate Search and I just started working on implementing it into my existing Spring application. I am stuck at the very first step, as I am getting a configuration erorr - "Could not initialize class org.hibernate.cfg.AnnotationConfiguration".

I am using following-
- Spring 2.5.4
- hibernate 3.2.4.GA
- hibernate-search 3.1.0.GA
- hibernate-annotations 3.4.0.GA

And this is how my xml configuration for AnnotationSessionFactoryBean looks-

<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.search.default.indexBase">./lucene/indexes</prop>
<prop key="hibernate.search.default.directory_provider"> org.hibernate.search.store.FSDirectoryProvider</prop>
</props>
</property>

<property name="annotatedClasses">
<list>
<value>demo.myproduct.SearchBean</value>
</list>
</property>

<property name="annotatedPackages">
<list>
<value>demo.myproduct</value>
</list>
</property>

</bean>

Please let me know what could I be missing here. I have already spent a few hours on this, with no success!
s.grinovero (26) [Avatar] Offline
#2
Re: Error with configuring Hibernate Search (AnnotationSessionFactoryBean)
hibernate-search 3.1.0.GA and hibernate-annotations 3.4.0.GA require Hibernate 3.3, I'll suggest upgrading to core 3.3.1.GA

If you have more problems, please post the complete StackTrace, as with this single line we can just guess.
cooljava (3) [Avatar] Offline
#3
Re: Error with configuring Hibernate Search (AnnotationSessionFactoryBean)
I was able to resolve this after verifying POM dependeices and downloading missing jars and incluing them in classpath