美文网首页
eclipse 启动tomcat 时 java.lang.No

eclipse 启动tomcat 时 java.lang.No

作者: ZalleDay | 来源:发表于2021-03-04 14:39 被阅读0次

    工作的时候接受老项目蓝凌v13,在使用eclipse 的tomcat 启动 ssh 项目的时候,启动遇到相关错误:

      java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
    

    反手百度,大部分是 答案是在tomcat/conf/context.xml 加上一句配置,

    <Loader delegate="true"/>
    

    整个配置是

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
      Licensed to the Apache Software Foundation (ASF) under one or more
      contributor license agreements.  See the NOTICE file distributed with
      this work for additional information regarding copyright ownership.
      The ASF licenses this file to You under the Apache License, Version 2.0
      (the "License"); you may not use this file except in compliance with
      the License.  You may obtain a copy of the License at
    
          http://www.apache.org/licenses/LICENSE-2.0
    
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    --><!-- The contents of this file will be loaded for each web application --><Context>
    
        <!-- Default set of monitored resources -->
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <Loader delegate="true"/>
        <!-- Uncomment this to disable session persistence across Tomcat restarts -->
        <!--
        <Manager pathname="" />
        -->
    
        <!-- Uncomment this to enable Comet connection tacking (provides events
             on session expiration as well as webapp lifecycle) -->
        <!--
        <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
        -->
    
    </Context>
    

    加入之后项目正常运行,但是如果关闭tomcat 之后的话,该文件会恢复默认值,重启启动需要继续添加这一段话,不知道为啥。

    相关文章

      网友评论

          本文标题:eclipse 启动tomcat 时 java.lang.No

          本文链接:https://www.haomeiwen.com/subject/ohlkqltx.html