黑马程序员技术交流社区

标题: spring扫描jar包中的PostConstruct失效 [打印本页]

作者: onlyonewf    时间: 2012-6-10 10:50
标题: spring扫描jar包中的PostConstruct失效
项目中使用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,打包后再发布错误就消失了,正常启动

大家有没有遇到过这种情况啊?怎么解决呢?




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2