Spring MVC代码-部署时抛出HSEARCH000103异常 [英] Spring MVC code- Throws HSEARCH000103 exception when it is being deployed
问题描述
在我们的springmvc网站中,我们将使用Lucene进行休眠搜索.编译代码时没有问题,但是当我尝试在Ubuntu 14.04 64位服务器上运行的tomcat 7.0.52上部署代码时,出现以下异常
In our springmvc website, we are using hibernate search with lucene. There are no issues when i compile the code, but when i try to deploy the code on a tomcat 7.0.52 running on Ubuntu 14.04 64bit server, i get the following exceptions
INFO:初始化Spring根WebApplicationContext 2015年8月20日 下午1:20:10 org.apache.catalina.core.StandardContext listenerStart 严重:将上下文初始化事件发送给侦听器的异常 类的实例 org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:错误 创建名称为"userService"的bean:无法解析对 设置构造函数参数时使用bean'userManager';嵌套的 异常是org.springframework.beans.factory.BeanCreationException: 创建名称为'userManager'的bean时出错:自动接线的注入 依赖项失败;嵌套的例外是 org.springframework.beans.factory.BeanCreationException:无法 自动装配方法:公共无效 com.atcm.service.impl.UserManagerImpl.setUserDao(com.atcm.dao.UserDao); 嵌套的例外是 org.springframework.beans.factory.BeanCreationException:错误 创建名称为"userDao"的bean:注入资源依赖项 失败的;嵌套的例外是 org.springframework.beans.factory.BeanCreationException:错误 创建在类路径中定义的名称为"sessionFactory"的bean 资源[applicationContext-dao.xml]:初始化方法的调用 失败的;嵌套的异常是org.hibernate.search.SearchException: HSEARCH000103:无法初始化IndexManager com.atcm.model.User 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) 在org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:627) 在org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)处 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)处 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)处 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)处 在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:304) 在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) 在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) 在org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700) 在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760).......
INFO: Initializing Spring root WebApplicationContext Aug 20, 2015 1:20:10 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: 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 'userService': Cannot resolve reference to bean 'userManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.atcm.service.impl.UserManagerImpl.setUserDao(com.atcm.dao.UserDao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.search.SearchException: HSEARCH000103: Unable to initialize IndexManager com.atcm.model.User at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:627) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760).............
休眠属性文件如下,
app.search.index.basedir =目标/索引 hibernate.search.default.directory_provider =文件系统 hibernate.search.default.locking_strategy =简单 hibernate.search.default.exclusive_index_use = true hibernate.search.lucene_version = LUCENE_35 hibernate.search.analyzer = org.apache.lucene.analysis.zh.EnglishAnalyzer hibernate.search.worker.batch_size = 100
app.search.index.basedir=target/index hibernate.search.default.directory_provider=filesystem hibernate.search.default.locking_strategy=simple hibernate.search.default.exclusive_index_use=true hibernate.search.lucene_version=LUCENE_35 hibernate.search.analyzer=org.apache.lucene.analysis.en.EnglishAnalyzer hibernate.search.worker.batch_size=100
任何帮助,将不胜感激.
Any help , will be much appreciated.
推荐答案
我怀疑此属性适用于开发:
I suspect this property is intended for development:
app.search.index.basedir=target/index
尝试将target/index
更改为tomcat可以读取和写入的目录.
Try changing target/index
for a directory that tomcat can read and write.
这篇关于Spring MVC代码-部署时抛出HSEARCH000103异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!