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>
    
  • 相关阅读:
    启动ASM 数据库的步骤
    ora15031 DBCA找不到ASM磁盘组
    ORA12514 解决方法
    Rhel Linux 5.1 (32 位)上安装 Oracle ASM数据库 11g 第 1 版
    Oracle ASM for linx as 4 x8664 创建过程
    在安腾AI64 RHEL3 U3服务器上安装ORACLE10G
    ora12528 : message 12528 not found; product=RDBMS ; facility=ora
    linux下启动oracle服务和监听程序
    linux内核升级RPM包安装问题!!!!
    AS4 下安装Oracle 10g(ASM & RAW)
  • 原文地址:https://www.cnblogs.com/wumz/p/9914973.html
Copyright © 2011-2022 走看看