zoukankan      html  css  js  c++  java
  • SSH框架环境搭建问题:Line: 230

    只是通过myeclipse搭建一个框架而已

    启动tomcat时报错信息:

    File: SpringObjectFactory.java
    Method: getClassInstance
    Line: 230 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:230:-1
    	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
    	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
    	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4939)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
    	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NullPointerException
    	at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:230)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType(XmlConfigurationProvider.java:604)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:574)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:530)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
    	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
    	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250)
    	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
    	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
    	... 18 more
    

     原因:未添加Spring监听

    配置web.xml

     
      <!-- Spring配置文件位置 -->
      <context-param>
      	<param-name>contextConfigLocation</param-name>
      	<param-value>classpath:applicationContext.xml</param-value>
      </context-param>
     <!--Spring监听器  -->
      	<listener>
      		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      	</listener>
      	
    
  • 相关阅读:
    【原创】InstallSheild使用问题笔记卸载程序之后重新启动,总是报错找不到文件?
    【学习】关于绩效管理的知识
    【原创】Asp.net MVC学习笔记之基于类型来绑定Model的属性
    【学习】如何进行绩效面谈
    【原创】【续】InstallSheild使用问题笔记卸载程序之后重新启动,总是报错找不到文件?
    SharePoint 2010 学习资料索引与注解(2)
    一张很厉害的图
    SharePoint 2010 学习资料索引与注解(1)
    StackOverflow 并不只是一个问答网站
    最近花了点儿时间看书学习
  • 原文地址:https://www.cnblogs.com/sincoolvip/p/6946107.html
Copyright © 2011-2022 走看看