java.lang.IllegalStateException异常产生的原因及解决办法

问题描述:

在进行ssh框架整合的时候,引入struts测试的action的时候出现的问题

解决办法:

这是因为没有找到WebApplicationContext这个配置文件,no ContextLoaderListener registered缺少监听器,在web.xml配置中配置监听器就可以了

  <!-- 让spring在系统启动时开始工作 -->
  <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

这样就解决这个问题了

猜你喜欢

转载自my.oschina.net/u/3384706/blog/1556755