skinme java 路径错误_java 错误 classes路径配置错误

1. 错误显示页

08fbf8d47de9abd2140194e8a4da22bd.png

2. 解决步骤

2.1. 查看 root cause 信息

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.myweb.IndexAction] for bean with name 'IndexAction' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.myweb.IndexAction

Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.myweb.IndexAction] for bean with name 'IndexAction' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.myweb.IndexAction

2.2. 分析信息点

很明显是找不到 IndexAction,也就是IndexAction.java生成的IndexAction.class。

2.3. 问题路径分析

2.3.1. 路径不对

指的是Classes路径不对,应该是在 myweb/webapp/WEB-INF/classes/。这是本次错误的原因,这个路径配置错误。

2.3.2. 文件没有生成

是否在2.3.1 下有对应的文件生成

2.3.3. 其它原因

除了上述两个原因,还可能有别的衍生问题。执行Index.do时,要根据配置找到对应的IndexAction.class。但是现在没有找到,也可以反过来解决,就是配置没有配对。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值