JAVA maven项目,通过maven打包放在tomcat运行,没有任何问题。在eclipse当中用tomcat运行报错

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/permission/spring-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 class path resource [spring/permission/spring-shiro.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Lcom/ebidding/crm/permission/service/PmsOperatorRoleService;

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring/permission/spring-shiro.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Lcom/ebidding/crm/permission/service/PmsOperatorRoleService;

Caused by: java.lang.NoClassDefFoundError: Lcom/ebidding/crm/permission/service/PmsOperatorRoleService;

Caused by: java.lang.ClassNotFoundException: com.ebidding.crm.permission.service.PmsOperatorRoleService
两边jar都一模一样,没有缺少jar的问题

第1个回答  2017-02-28
在Eclipse里把项目从tomcat里删除了,然后清理一下tomcat,再清理一下工程,把项目重新添加到tomcat里试试,有时候tomcat就是会报莫名其妙的错误,重新试一下吧。
第2个回答  2017-02-28
报错上显示是NoClassDefFoundError,我隐隐觉得还是某些包没有编译到。你先清理一下你的项目重新编译一下,统一编译和发布的环境JDK。再试一下。追问

没有用,都试过了

相似回答