我查了半天,网上都说是web.xml的问题,下面是我的web.xml:<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 添加Spring Listener支持 -->
<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><!-- struts2 支持 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 提供对hibernate延迟加载的支持 -->
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>lazyLoadingFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping><!-- welcome setting -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
其中问题就出现struts2那一段,只要我把那一段去掉就正常启动,一加上就报错:
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Context [/compass1] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
我的struts是struts2.0.14,导入的lib包是下载包里的Blank.war工程的实例里面的lib,struts.xml中配置的是Spring接管action,应该没问题:
<struts>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="product" extends="struts-default" namespace="/product">
<action name="insert" class="productBean" method="insert">
<result>/product/insertOk.jsp</result>
</action>
</package>
</struts>其中的productBean已经在spring中配置过了。先谢谢各位了,我已经没分了...抱歉了....
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 添加Spring Listener支持 -->
<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><!-- struts2 支持 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 提供对hibernate延迟加载的支持 -->
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>lazyLoadingFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping><!-- welcome setting -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
其中问题就出现struts2那一段,只要我把那一段去掉就正常启动,一加上就报错:
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Context [/compass1] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
我的struts是struts2.0.14,导入的lib包是下载包里的Blank.war工程的实例里面的lib,struts.xml中配置的是Spring接管action,应该没问题:
<struts>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="product" extends="struts-default" namespace="/product">
<action name="insert" class="productBean" method="insert">
<result>/product/insertOk.jsp</result>
</action>
</package>
</struts>其中的productBean已经在spring中配置过了。先谢谢各位了,我已经没分了...抱歉了....
解决方案 »
- 急呀 大家快来帮忙
- java输入输出流问题
- !!!走过路过的看下!!!
- 请教hibernate一对多的问题.
- 在JTree上用Shift和鼠标右键不能多选,是不是还要加Checkbox?
- hibernate 可以配置 入库时,转换大小写么?
- 请问如何在jsp中获取上一个页面的完整URL
- 《精通EJB第二版》此书理论性太强,没有太多的代码,看起来费力,能再为小弟推荐一本例子多些的书来配合此书一起看的吗
- jsp编译时报错
- 编译好的Message Bean class,如何打包成jar文件,以供Deploy到Server上?
- spring的bean工厂加载完找不到bean
- 怎么读取本地的一个Excel表格的数据存入数据库中
<url-pattern>/do/* </url-pattern>