java.lang.ClassNotFoundException: javax.el.E​​LResolver Spring Web MVC with Hibernate error

问题描述

我收到的错误:-

org.apache.catalina.core.Applicationdispatcher invoke
SEVERE: Servlet.service() for servlet [jsp] threw exception
java.lang.classNotFoundException: javax.el.ELResolver

我是使用休眠的 Spring Web MVC 的新手,我正在尝试使用 JSTL 核心标签显示数据库获取的记录,但出现此错误,我尝试手动添加外部 jar,我尝试添加 jar 作为依赖项,我重新安装了 tomcat并尝试了不同的版本,我基本上在stackoverflow上尝试了与此问题相关的所有可用解决方案,我尝试了stackoverflow和其他站点上提到的大约20个解决方案,但没有一个奏效,请帮助我解决问题。我的截止日期很紧迫,过去几天我一直在努力解决它,但我无法解决

我试过的Tomcat版本:8.5、9.0.34、9.0.44

我的 pom.xml 文件:-

<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>Cyclothon</groupId>
  <artifactId>Cyclothon</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <properties>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <spring.version>5.2.0.RELEASE</spring.version>
        <hibernate.version>5.2.11.Final</hibernate.version>
        <hibernate.validator>5.4.1.Final</hibernate.validator>
        <c3p0.version>0.9.5.2</c3p0.version>
        <jstl.version>1.2.1</jstl.version>
        <tld.version>1.1.2</tld.version>
        <servlets.version>3.1.0</servlets.version>
        <jsp.version>2.3.1</jsp.version>
        <hsqldb.version>1.8.0.10</hsqldb.version>
    </properties>
    <dependencies>
        <!-- Spring MVC Dependency -->
        <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.0.1.RELEASE</version>
    </dependency>
 
        <!-- Spring ORM -->
        <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>4.0.1.RELEASE</version>
    </dependency>
     <dependency>
        <groupId>javax.el</groupId>
        <artifactId>javax.el-api</artifactId>
        <version>3.0.0</version>
    </dependency>
        <!-- Hibernate Core -->
        <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.3.5.Final</version>
    </dependency>
 
        <!-- JSTL Dependency -->
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>javax.servlet.jsp.jstl-api</artifactId>
            <version>${jstl.version}</version>
        </dependency>
         
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>${tld.version}</version>
        </dependency>
 
        <!-- Servlet Dependency -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlets.version}</version>
            <scope>provided</scope>
        </dependency>
 
        <!-- JSP Dependency -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>${jsp.version}</version>
            <scope>provided</scope>
        </dependency>
 
        <!-- Hsql Dependency -->
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>${hsqldb.version}</version>
        </dependency>

    <dependency>
        <groupId>MysqL</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.15</version>
    </dependency>
        
    <dependency>
        <groupId>com.razorpay</groupId>
        <artifactId>razorpay-java</artifactId>
        <version>1.3.7</version>
    </dependency>
    <dependency>
        <groupId>com.instamojo</groupId>
        <artifactId>instamojo-java</artifactId>
        <version>2.0.2</version>
    </dependency>
  </dependencies>
</project>

出现错误页面:viewPage.jsp :-

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.razorpay.RazorpayException"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head><Meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=yes">
<Meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
<link rel="stylesheet" href="css/index_css.css" />  
<link rel="stylesheet" href="css/header_css.css" /> 
<link rel="stylesheet" href="css/footer_css.css" />  
        <Meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <style type="text/css">
        
        h2{
        text-align: center;
        }
.table{
    border-color:#404040;
    width:50%;
  background-color:     rgb(255,230,204); 
    margin-top:20px;
    margin-left: 25%;
}


/* Tabled Portrait */
@media   screen and (max-height: 950px){
@media screen and (max-width: 800px) {
    #primary { width:100%; }
    #secondary { width:100%; margin:0; border:none; }
        h2{
        text-align: center;
        }
.table{
    border-color:#404040;
    width:35%;
    font-size:7.5px;
  background-color:     rgb(255,204); 
    margin-top:20px;
    margin-left: 15%;
}

 }
 }

/* Tabled Portrait */
@media   screen and (max-height: 750px){
@media screen and (max-width: 550px) {
    #primary { width:100%; }
    #secondary { width:100%; margin:0; border:none; }
        h2{
        text-align: center;
        }
.table{
    border-color:#404040;
    width:5%;
    font-size:7.5px;
  background-color:     rgb(255,204); 
    margin-top:20px;
    margin-left: .5%;
}

 }
 }
        </style>
    </head>
    <body>
    
    <%@ include file="header.jsp" %>
        <div class="context"></div>
        <h2>participants Data</h2><br>
        <table border="2" class="table">
        <th>Name</th>
        <th>Contact number</th>
        <th>Age</th>
        <th>Sex</th>
        <th>Address</th>
        <th>Email id</th>
        <th>Occupation</th>
        <th>T-shirt size</th>
        <th>Emergency contact name</th>
        <th>Emergency contact Number</th>
        <th>Blood group</th>
        <c:forEach items="${participantList}" var="plist">
            <tr>
            <td>${plist.id}</td>
            <td>${plist.name}</td>
            <td>${plist.age}</td>
            <td>${plist.sex}</td>
            <td>${plist.address}</td>
            <td>${plist.email}</td>
            <td>${plist.occupation}</td>
            <td>${plist.fee}</td>
            <td>${plist.nocovid}</td>
            <td>${plist.nocontact}</td>
            <td>${plist.nohealthissue}</td>
            <td>${plist.myresp}</td>
            <td>${plist.contactno}</td>
            <td>${plist.paymentId}</td>
            <td>${plist.transactionId}</td>
            </tr>
        </c:forEach>
        </table>
  
    <%@ include file="footer.jsp" %>
    </body>
</html>

非常感谢任何帮助,请帮助我解决它。我正在使用 jdk 1.8.0_221 仅供参考,我的 tomcat 主目录中有以下 jar:el-api.jar、jasper.jar、jasper-el.jar、jsp-api.jar、jaspic-api.jar、servlet-api.jar。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)