Failed to introspect annotations: interface com.xxx

在使用maven打包发布项目时发现在tomcat容器中正常启动!后来需要DEUG调试程序,在eclipse中使用了插件在Jetty中启动报错,当时纳闷了一下,why!?

错误信息:
2016-07-16 16:25:08 ERROR org.springframework.web.context.ContextLoader[307] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroSecurityFilter' defined in URL [file:/E:/ipharmacare/git/ipharmacare_platform/platform-service/target/classes/ctx-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in URL [file:/E:/ipharmacare/git/ipharmacare_platform/platform-service/target/classes/ctx-shiro.xml]: Cannot resolve reference to bean 'jdbcAuthenticationRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcAuthenticationRealm': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ipharmacare.platform.auth.service.AccountManager com.ipharmacare.platform.auth.service.AuthorizationRealm.accountManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ipharmacare.platform.auth.dao.UserMapper com.ipharmacare.platform.auth.service.AccountManager.userDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations: interface com.ipharmacare.platform.auth.dao.UserMapper
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
.
.
.


查看了jetty容器启动过程输出的日志,发现它在加载一个依赖项目时,spring版本和其它项目的版本不一致,发现后将其版本改成统一版本,重新启动,正常了!

所以,在使用maven构建项目时,应该建立父子项目,所有子项目的jar包都应交给父项目管理,即能保证jar包统一,同时方便升级!

以下问题也是版本(xerces)不统一造成:
java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z

猜你喜欢

转载自songjianyong.iteye.com/blog/2311658