项目中使用PostConstruct注解,发布到服务器中能正常运行,当将所有class打包成jar后放到lib下后,运行服务器就会提示错误
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataInputCreateService': Invocation of init method failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1
到源码中删除@PostConstruct,打包后再发布错误就消失了,正常启动
大家有没有遇到过这种情况啊?怎么解决呢? |
|