因web.xml配置问题而无法启动Tomcat—(SSH整合)
来源:互联网 发布:java utf-8转gbk乱码 编辑:程序博客网 时间:2024/06/05 14:33
环境IntelliJ IDEA+jdk1.8+tomcat8.5.23;
使用maven整合struts2.5.2+spring4.3.7+hibernate5.2.12。
启动Tomcat报以下严重,Tomcat服务无作用,localhost:8080找不到网页。
[2017-11-21 02:14:39,351] Artifact home1:Web exploded: Artifact is being deployed, please wait...21-Nov-2017 14:14:39.741 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file21-Nov-2017 14:14:39.741 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors[2017-11-21 02:14:39,751] Artifact home1:Web exploded: Error during artifact deployment. See server log for details.21-Nov-2017 14:14:49.204 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Java\apache-tomcat-8.5.23\webapps\manager]21-Nov-2017 14:14:49.310 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Java\apache-tomcat-8.5.23\webapps\manager] has finished in [106] ms
以下是项目的配置文件↓
以下贴出web代码↓
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <display-name>Archetype Created Web Application</display-name> <!-- 拦截器 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping></web-app>
明显看出这是没有添加spring配置造成的;
正确的web文件为:
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 配置Spring的监听 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 指定spring初始化文件路径位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- 配置Spring的过滤器,解决乱码问题 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 解决懒加载问题 --> <filter> <filter-name>openSessionInView</filter-name> <filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>flushMode</param-name> <param-value>AUTO</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSessionInView</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> <!-- 拦截器 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping></web-app>
阅读全文
0 0
- 因web.xml配置问题而无法启动Tomcat—(SSH整合)
- tomcat 因 JDK 改变而导致无法启动
- Servlet配置web.xml后 tomcat无法启动
- Servlet配置web.xml后导致无法启动Tomcat
- ssh框架整合 web.xml配置
- ssh整合web.xml的配置
- SSH整合中web.xml的配置
- ssh整合后web.xml的配置
- ssh整合中web.xml配置模版
- 使用SpringMVC时添加了web.xml中的DispatchServlet配置后出现Tomcat服务器无法启动的问题
- SSH 整合 web.xml
- SSH整合web.xml
- 安装Tomcat时候提示因无法写入服务而导致无法安装问题的解决方法
- Tomcat web.xml配置问题
- 无法在web服务器上启动调试。服务器因语法无效而未能处理调试请求。
- 无法在web服务器上启动调试。服务器因语法无效而未能处理调试请求。
- 整合ssh——web.xml
- SSh整合启动问题
- NOIP2017提高组 Day2T2宝藏 状压DP
- 【1】在Ubuntu上为Android系统编写Linux内核驱动程序
- Python 运算符
- 物联网不是趋势,是发展关键?
- 【鸟哥的Linux私房菜】vim程序编辑器
- 因web.xml配置问题而无法启动Tomcat—(SSH整合)
- ubuntu参数的形式
- JavaScript 变量作用域和声明提升
- js实现上移、下移置顶
- python Flask-login
- 数据分析之《菜鸟侦探挑战数据分析》-2-R语言-列联表-卡方检验
- 微信公众号如何运营?公众平台推广技巧
- random.shuffle的使用
- vue + webpack 构建项目