zoukankan      html  css  js  c++  java
  • Eclipse中复制项目重命名后重新发布,项目名在地址栏仍然是原来的项目名”的问题

    转载自: http://www.cnblogs.com/chenxueling/p/5474717.html

    将20170331-JavaEE-SSH项目复制一份,重命名为20170407-JavaEE-SSH。

    运行20170407-JavaEE-SSH项目里的jsp,结果报错如下:

    严重: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/20170331-JavaEE-SSH]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@524abdbf]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4969)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 10 more
    Caused by: java.lang.IllegalArgumentException: The main resource set specified [E:apache-tomcat-8.0.37webapps20170331-JavaEE-SSH] is not valid
    at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:727)
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:688)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 13 more

    页面信息如下:

    可以看到复制之后的项目的运行路径仍然是之前的那个项目。

     解决办法:

    第一步,单击新的项目,右键-->properties-->Web Project Settings-->Context root,改成目标名称。

    第二步:通过以上方式修改完毕后,运行项目,会发现地址栏中仍是老项目名,这时需通过以下设置去改变:

    进入工程的workspace,打开.settting文件夹,用记事本打开org.eclipse.wst.common.component文件,将该文件的三处改成目标名称:

    第三步:在Servers目录下的Tomcat..config目录下找到server.xml,找到Context节点,将docBase,path的项目名都修改成目标名:

    至此,修改工作完毕,但还是请你耐心看完接下来的“特别说明”吧,因为如果你此时直接运行项目十之八九会有“彩蛋”:

    当你重新发布项目时,会发现根本发布不了,出现以下错误:

    Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.

    特别说明:

    针对你所遇到的“彩蛋”,解决方式很简单,即删除当前的Servers,刷新当前项目,然后发布即可。

  • 相关阅读:
    Failed to load resource: the server responded with a status of 404 (Not Found) favicon.ico文件找不到
    合并排序
    python爬虫入门笔记--爬取垃圾分类查询【还有待改善】
    快速排序、合并排序和分治策略的基本思想
    动态规划的基本要素
    【转载】算法时间复杂度分析方法
    python爬虫入门笔记--知乎发现(爬取失败了)
    管理主界面的两个刷新操作
    把Excel选手名单信息导入到评委计分软件Access数据库的步骤
    评委打分回避功能的详细操作步骤
  • 原文地址:https://www.cnblogs.com/TTTTT/p/6678250.html
Copyright © 2011-2022 走看看