我想通過spring事務將事務支持添加到現有的webapp。AnnotationSessionFactoryBean需要lucene類
我最近將會話工廠類從LocalSessionFactoryBean更改爲AnnotationSessionFactoryBean。
現在我得到以下錯誤,當web應用程序啓動:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in class path resource [context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
這樣的根本原因是
nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
我不明白爲什麼現在我需要在我的web應用程序的Lucene。我不打算將它用於搜索,而且我發現這個錯誤似乎非常錯誤。
我們可以看到堆棧跟蹤 – skaffman 2010-10-26 21:48:12