zoukankan      html  css  js  c++  java
  • javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation:

    javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/apache/jasper/runtime/InstanceManagerFactory, have different Class objects for the type org/apache/tomcat/InstanceManager used in the signature
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:349)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


    root cause
    java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/apache/jasper/runtime/InstanceManagerFactory, have different Class objects for the type org/apache/tomcat/InstanceManager used in the signature
    org.apache.jsp.index_jsp._jspInit(index_jsp.java:53)
    org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:179)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    做项目过程中遇到上述错误,将项目的pom.xml文件中的Dependencies中依赖的Scope: compile改为Scope: provided即可

  • 相关阅读:
    ubuntu(linux)虚拟主机部署桌面,使用window链接
    扫描shader
    Android Studio快捷键
    eclipse取消空格、等号、分号自动录入
    Libgdx学习记录28——创建Desktop程序
    设计模式19——代理模式
    设计模式18——模板方法
    设计模式17——解释器模式
    设计模式16——工厂模式
    设计模式15——外观模式
  • 原文地址:https://www.cnblogs.com/jackiehe/p/4703053.html
Copyright © 2011-2022 走看看