开发者社区> 问答> 正文

SpringMVC配置component-scan出错?报错

**-servlet.xml配置文件中加入 

<context:component-scan base-package="com.controller"/>

(配置controller扫描包) 这行代码,tomcat启动就会报错,不知道是什么原因。 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\Tomcat7\webapps\SpringMVC\WEB-INF\classes\com\controller\Welcome.class]; nested exception is java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")。。。。。。。。。。。。。。 

Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")。。。。。。。。。

展开
收起
爱吃鱼的程序员 2020-06-22 11:22:09 478 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    折腾半天,问题解决了,以前一直用的myeclipse,今天换到eclipse出了问题,eclipse中配置完tomcat,还要设置项目发布路径,默认不是发布到tomcat下的webapps中,双击server进行配置。还有个默认项去掉<imgsrc="http://static.oschina.net/uploads/space/2014/0323/164620_uI7Z_1412052.png"alt=""/>

    2020-06-22 11:22:25
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载