Java 在Tomcat中部署Web应用时出错
我有一个名为“authmantra”的java web应用程序。 当我尝试在tomcat7上部署时,它给出了以下错误Java 在Tomcat中部署Web应用时出错,java,xml,apache,web,Java,Xml,Apache,Web,我有一个名为“authmantra”的java web应用程序。 当我尝试在tomcat7上部署时,它给出了以下错误 Feb 4, 2014 1:08:11 PM org.apache.catalina.startup.ContextConfig parseWebXml **SEVERE: Parse error in application web.xml file at file:/D:/Apache/conf/web.xml** org.xml.sax.SAXParseException:
Feb 4, 2014 1:08:11 PM org.apache.catalina.startup.ContextConfig parseWebXml
**SEVERE: Parse error in application web.xml file at file:/D:/Apache/conf/web.xml**
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at **org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1875)**
at org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1472)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1250)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Feb 4, 2014 1:08:11 PM **org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 4285 column 2**
Feb 4, 2014 1:08:11 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Feb 4, 2014 1:08:11 PM org.apache.catalina.core.StandardContext startInternal
**SEVERE: Error getConfigured**
Feb 4, 2014 1:08:11 PM org.apache.catalina.core.StandardContext startInternal
**SEVERE: Context [/authmantra] startup failed due to previous errors**
web app元素中的分号导致了问题。删除它们并尝试一下您的web应用程序标签应如下所示:
<web-app version="3.0"
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_3_0.xsd">
...
...
</web-app>
...
...
下面是我的web.xml 5 GetAuth.jsp,我的xml与您在这里定义的相同。但是当我发布这个网站时,它已经删除了http和www单词。所以我的web.xml与您在这里定义的相同。还有其他解决方案吗?@MaheshPatel您的xml中有分号。删除它并重试。如果没有添加分号,此站点将自动添加分号。我的站点在我的旧服务器上运行良好。但当我尝试在新服务器上部署它时,它给出了一个错误。请注意,在我的新服务器上,另外两个站点运行良好。请参阅此链接了解更多我没有添加分号,此站点已自动添加分号。我的站点在我的旧服务器上运行良好。但当我尝试在新服务器上部署它时,它给出了一个错误。请注意,在我的新服务器上,另外两个站点工作正常。