隨筆-9  評論-168  文章-266  trackbacks-0
          異常:
          com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory). - Class: com.opensymphony.xwork2.inject.ContainerImpl File: ContainerImpl.java
          解決方法:
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
                <init-param>  
                  <param-name>config</param-name>  
                  <param-value>struts-default.xml,struts-plugin.xml,struts2/struts-*.xml</param-value>  
              </init-param>  
           </filter>
          即,必須添加
          struts-default.xml(必須),struts-plugin.xml(可選)二個額外的配置文件.
          原因:
          struts-default.xml是默認配置文件,一些必須的框架參數都默認設置在此.
          posted on 2011-06-22 15:40 紫蝶∏飛揚↗ 閱讀(9040) 評論(3)  編輯  收藏 所屬分類: Struts1/2

          評論:
          # re: struts2 修改配置文件的默認位置報異常的解決方法[未登錄] 2011-11-30 23:59 | Tommy
          謝謝,幫我解決了一個大問題,支持你!  回復  更多評論
            
          # re: struts2 修改配置文件的默認位置報異常的解決方法 2015-06-14 13:42 | 網友
          感謝樓主。。我忘記寫struts-default。xml了  回復  更多評論
            
          # re: struts2 修改配置文件的默認位置報異常的解決方法[未登錄] 2016-03-26 15:40 | 淹死的魚
          確實能解決問題,感謝樓主  回復  更多評論
            
          主站蜘蛛池模板: 江川县| 汾阳市| 盖州市| 中卫市| 库尔勒市| 新蔡县| 常州市| 修文县| 成安县| 蓝山县| 泸定县| 察隅县| 双牌县| 石楼县| 容城县| 林西县| 陈巴尔虎旗| 长寿区| 青河县| 梨树县| 新河县| 新乡市| 桐庐县| 台中市| 两当县| 商水县| 浮梁县| 文化| 康定县| 宁德市| 三江| 西平县| 溧阳市| 黎平县| 三明市| 谷城县| 陆良县| 和田市| 蛟河市| 清徐县| 和林格尔县|