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

  • 相关阅读:
    NOIP2011 D1T1 铺地毯
    NOIP2013 D1T3 货车运输 倍增LCA OR 并查集按秩合并
    POJ 2513 trie树+并查集判断无向图的欧拉路
    599. Minimum Index Sum of Two Lists
    594. Longest Harmonious Subsequence
    575. Distribute Candies
    554. Brick Wall
    535. Encode and Decode TinyURL(rand and srand)
    525. Contiguous Array
    500. Keyboard Row
  • 原文地址:https://www.cnblogs.com/SimonGao/p/4960928.html
Copyright © 2011-2022 走看看