zoukankan      html  css  js  c++  java
  • org.apache.catalina.core.DefaultInstanceManager cannot be cast to org.apache.tomcat.InstanceManager

    1、控制台报错信息

    严重: Servlet.service() for servlet [jsp] in context with path [/Resource] threw exception [java.lang.ClassCastException: org.apache.catalina.core.DefaultInstanceManager cannot be cast to org.apache.tomcat.InstanceManager] with root cause
    java.lang.ClassCastException: org.apache.catalina.core.DefaultInstanceManager cannot be cast to org.apache.tomcat.InstanceManager
    

    2、浏览器报错信息

    HTTP Status 500 - java.lang.ClassCastException: org.apache.catalina.core.DefaultInstanceManager cannot be cast to org.apache.tomcat.InstanceManager
    

    3、解决方法

    原因是 Tomcat 的 catalina.jar 包冲突了。

    网上许多人说是修改 tomcat 中 conf 下的 context.xml 配置文件 在 <context></context> 之间加下面的代码 <Loader delegate="true" />

    然而我的修改完后还是不行,于是想着要不更换 apache-tomcat 的版本试一试:(结果还是不行
    [Apache Tomcat 各版本下载]

    最后把加上去的代码 <Loader delegate="true" /> 给撤回了,修改了 pom.xml 配置得以解决!!

    <?xml version="1.0" encoding="UTF-8"?>
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
      http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      
      <groupId>org.xxx.yyy</groupId>
      <artifactId>XXX</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.11</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    
      <build>
        <finalName>XXX</finalName>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-clean-plugin</artifactId>
              <version>3.0.0</version>
            </plugin>
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>3.0.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.7.0</version>
            </plugin>
            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.20.1</version>
            </plugin>
            <plugin>
              <artifactId>maven-war-plugin</artifactId>
              <version>3.2.0</version>
            </plugin>
            <plugin>
              <artifactId>maven-install-plugin</artifactId>
              <version>2.5.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.2</version>
            </plugin>
            
            <!-- 配置 tomcat7-maven-plugin 插件 -->
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat7-maven-plugin</artifactId>
              <version>2.2</version>
              <configuration>
                <server>tomcat7</server>
                <username>xxxx</username>
                <password>xxxx</password>
                <uriEncoding>UTF-8</uriEncoding>
                <url>http://localhost:8080/manager/text</url>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </project>
    
  • 相关阅读:
    iOS 键盘回收实现步骤
    Xcode 向6.0以后版本添加iOS开发空白模板
    popViewControllerAnimated 后,对页面内UITableView 内数据刷新
    指针,数组,字符串
    求解 s = (1*1)!+(2*2)! + (3*3)!+...+(n*n)! (C语言)
    sqlserver分页;mysql分页;orcale分页 的sql 查询语句
    实现strlen,strcpy,strcat,strcmp同功能的函数stringLength,stringCopy,stringCatch,stringCompare
    对字符串(英文)从小到大排序
    二维数组名作为实参或者形参
    联合与枚举 、 高级指针 、 C语言标准库(一)
  • 原文地址:https://www.cnblogs.com/wumz/p/9914973.html
Copyright © 2011-2022 走看看