使用 Tomcat 在 Eclipse 中运行 Web 服务时出现多个具有相同路径错误的上下文 [英] Multiple contexts with the same path error running web service in Eclipse using Tomcat
问题描述
这是我使用 Eclipse 创建第一个 Axis2 Web 服务时遇到的错误.在我写完这个类之后,我用 Apache Axis2 创建了 Web 服务.当我在 Eclipse 中单击启动服务器按钮时,它会给出一条错误消息:
This is the error that I got when I created my first Axis2 web service using Eclipse. After I wrote the class, I created the web service with Apache Axis2. When I click the start server button in eclipse it gives an error message:
无法在 Tomcat v6.0 Server 上发布服务器配置本地主机.
多个上下文的路径为/FirstApache".
Could not publish server configuration for Tomcat v6.0 Server at localhost.
Multiple contexts have a path of "/FirstApache".
FirstApache 是我之前创建的动态 Web 项目.我从 Web 服务向导的配置部分选择了正确的 Web 项目.
FirstApache is the dynamic web project that I created before. I selected the correct web project from the configuration part in the web service wizard.
我该如何解决这个问题?
How can I fix this?
推荐答案
搜索 server.xml
文件并检查你的
标签,可能有同一路径的多个定义.删除重复项,它应该适合您.
Search for the server.xml
file and check your <Context>
tags, probably there are multiple definitions for the same path. Remove the duplicates and it should work for you.
查看这里的答案.
自动格式化 xml 文件 (control + shift + f) 自第二个
标签可能在同一条线上,但在视口之外并且离可见的很远.
Auto-format the xml file (control + shift + f) since the second <Context>
tag may be on the same line, but outside the viewport and really far away from the visible one.
这篇关于使用 Tomcat 在 Eclipse 中运行 Web 服务时出现多个具有相同路径错误的上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!