hibernateSearch被始化监听报错

添加hibernateSearch应用启动报以下错
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not init listeners
Caused by: org.hibernate.HibernateException: could not init listeners
	at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
	at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1352)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)	

而删除以下配置启动正常
		<property name="eventListeners">
			<map>
				<entry key="post-update">
					<bean class="org.hibernate.search.event.FullTextIndexEventListener" />
				</entry>
				<entry key="post-insert">
					<bean class="org.hibernate.search.event.FullTextIndexEventListener" />
				</entry>
				<entry key="post-delete">
					<bean class="org.hibernate.search.event.FullTextIndexEventListener" />
				</entry>
			</map>
		</property>

那么可以说是javabean的配置有问题了,注意类前
@Indexed(index = "XXXX")是否配好,是否在主键配置@DocumentId

你可能感兴趣的:(Hibernate)