Cannot find class [com.fh.interceptor.shiro.ShiroRealm]

li_rt4 2017-05-21 09:54:36
我在编译项目时,总是报错:
017-05-21 21:49:55 -955 [localhost-startStop-1] INFO - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-05-21 21:49:56 -1112 [localhost-startStop-1] ERROR - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/ApplicationContext.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/ApplicationContext.xml]: Cannot resolve reference to bean 'ShiroRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.fh.interceptor.shiro.ShiroRealm] for bean with name 'ShiroRealm' defined in class path resource [spring/ApplicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.fh.interceptor.shiro.ShiroRealm

大概就是说没有找到com.fh.interceptor.shiro.ShiroRealm这个类,可是这个类明明是在src里有的呀
...全文
502 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
li_rt4 2017-05-28
  • 打赏
  • 举报
回复
有可能是如4楼所说,具体原因还不太清楚。现在让同事把引用的类库删除后,再重新添加一次就可以编译了。
  • 打赏
  • 举报
回复
spring/ApplicationContext.xml 你的配置文件配置的 扫描路径是否包含这个class 另外,你看下编译目录下面是否有这个ShiroRealm.class
半遮面 2017-05-22
  • 打赏
  • 举报
回复
看看本地文件有没有生成ShiroRealm.java这个文件,如果有的话,那再看看配置文件是不是有问题,没有把这个类包含进去
  • 打赏
  • 举报
回复
引用 3 楼 li_rt4 的回复:
编译应该有包含这个文件所有目录,另外编译目录下有这个class文件
我是说你看下你的spring扫描的那个配置 ,是否有吧ShiroRealm 扫描到
li_rt4 2017-05-22
  • 打赏
  • 举报
回复
编译应该有包含这个文件所有目录,另外编译目录下有这个class文件

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧