问题描述
- 启动Tomcat7 运行jsp就报错
-
HTTP Status 500 -type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: org.apache.jasper.JasperException: XML parsing error on file org.apache.tomcat.util.scan.MergedWebXml
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:218)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:231)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:290)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:113)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:365)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root causeorg.apache.jasper.JasperException: XML parsing error on file org.apache.tomcat.util.scan.MergedWebXml
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:111)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:83)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:231)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:290)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:113)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:365)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root causecom.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:674)
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:362)
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:487)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2679)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:96)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:83)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:231)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:290)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:113)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:365)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.6 logs.Apache Tomcat/7.0.6
解决方案
Tomcat7 启动报错解决办法
tomcat启动不了,报错!
解决方案二:
500错误,一般也就是服务端错误,可以排查缩小错误范围:
1排除tomcat的问题,访问tomcat,通过浏览器localhost:8080查看是否出错;
2排除工程出错的可能性,测试以往正确运行的工程是否出错;
3本工程下查错,tomcat启动后,浏览器访问localhost:8080/index.jsp导航页是否可以访问,否:检查关于相关jar包,是否完整,一般只要建立的web工程都是完整的,若可以访问,错误可以缩小到你页面本身的编写问题检查~希望对你有所帮助
解决方案三:
先启动toncat看能不能正常运行,能正常运行的话手工写一个jsp看看能不能运行,如果正常就是你的开发工具有问题,在看看你jdk是否正常 包括环境变量配置什么的
还有你在开发工具追踪配置的jdk tomcat是否正确