beaninstantiationException无法实例化org.springframework.data.elasticsearch.repository.support.simpleelasticsearchrepository
在将Spring Boot版本从2.4.2升级到2.6.8之后获得问题。当启动服务器以下时,出现错误:
14:38:38:38:38:38:38:38:38:38:jboss.msc.msc.service.fail](ServerService线程池-92)MSC000001 :无法启动服务jboss.deployment.unit。“ abc.war”。 lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XYZESRepository' defined in com.xyelastic.repository.XYZESRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed;嵌套异常是org.springframework.beans.BeanStantiationException:无法实例化[org.springframework.data.data.elasticsearch.repository.supportoritory.support.simpleelasticsearchrepository]:constructor trrew excepred exception;嵌套异常是org.springframework.spel.spel.spel.spelevaluationException:el1011e:方法呼叫:尝试在null上下文对象xyzesrepository上调用方法substring(java.lang.integer)
:
类似 ;
公共接口xyzesrepository扩展了ElasticsearchRepository< MyObject,String> {
}
Getting issue after upgrading Spring boot version from 2.4.2 to 2.6.8 .When starting the server getting below error:
14:38:38,461 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 92) MSC000001: Failed to start service jboss.deployment.unit."abc.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."abc.war".undertow-deployment: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XYZESRepository' defined in com.x.y.elastic.repository.XYZESRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method substring(java.lang.Integer) on null context object
XYZESRepository is like:
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
public interface XYZESRepository extends ElasticsearchRepository<MyObject, String> {
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论