zoukankan      html  css  js  c++  java
  • java 错误 classes路径配置错误

    1. 错误显示页

    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。但是现在没有找到,也可以反过来解决,就是配置没有配对。

  • 相关阅读:
    android ndk 调试问题
    音频
    文件分割与c语言文件结
    本机抓包
    rtm匹 转
    mac 工具等效率
    【MySQL】Explain Tutorial
    Sed基本入门[5] Sed Hold and Pattern Space Commands
    Sed基本入门[3] Regular Expressions
    Protocol Buffer Basics
  • 原文地址:https://www.cnblogs.com/SimonGao/p/4960928.html
Copyright © 2011-2022 走看看