栈溢出(StackOverflowError)

背景:系统在测试环境中单服务器,运行了两天。之后,切换成了多服务器(2台),运行了小段时间后,报错:

各种bean 创建失败,最后报错StackOverflowError

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.iboxpay.opm.server.ILigentPosRomService': Cannot resolve reference to bean 'ligentPosRomService' while setting bean property 'ref'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ligentPosRomService': Unsatisfied dependency expressed through field 'ligentPosRomDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ligentPosRomDaoImpl': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'opmEntityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.iboxpay.opm.server.ILigentScanService': Cannot resolve reference to bean 'ligentScanService' while setting bean property 'ref'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ligentScanService': Unsatisfied dependency expressed through field 'ligentPosRomDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ligentPosRomDao': Cannot create inner bean '(inner bean)#69fe410a' of type [org.springframework.data.repository.core.support.PropertiesBasedNamedQueries] while setting bean property 'namedQueries'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#69fe410a': Cannot create inner bean '(inner bean)#45d1386a' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#45d1386a': Initialization of bean failed; nested exception is java.lang.StackOverflowError
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129)

日志基本如上。

起初,怀疑是代码的问题,于是注释掉部分new 对象多的代码。还是报该错。

查找的的相关文章链接:

StackOverflowError的分析和理解

StackOverflowError异常处理

深入理解java.lang.StackOverflowError和java.lang.OutOfMemoryError错误

最后是通过运维去修改栈的大小,从256K更改为1M...

具体操作:待定。

你可能感兴趣的:(微服务)