java.lang.classnotfoundexception:javax.el.elresolver spring web mvc出现hibernate错误

axr492tv  于 2021-07-16  发布在  Java
关注(0)|答案(0)|浏览(231)

我错了getting:-

  1. org.apache.catalina.core.ApplicationDispatcher invoke
  2. SEVERE: Servlet.service() for servlet [jsp] threw exception
  3. java.lang.ClassNotFoundException: javax.el.ELResolver

我刚接触过SpringWebMVC和hibernate,我试图用jstl核心标记显示从数据库中获取的记录,但是我遇到了这个错误,我尝试手动添加外部jar,尝试添加jar作为依赖项,我重新安装了tomcat并尝试了不同的版本,我基本上在stackoverflow上尝试了与此问题相关的所有解决方案,我尝试了stackoverflow和其他网站上提到的大约20个解决方案,但都不起作用,请帮助我解决问题。我是在严重的最后期限,我一直试图解决,因为过去几天,但我不能。
我试过的tomcat版本:8.5、9.0.34、9.0.44
我的pom.xmlfile:-

  1. <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">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>Cyclothon</groupId>
  4. <artifactId>Cyclothon</artifactId>
  5. <version>0.0.1-SNAPSHOT</version>
  6. <packaging>war</packaging>
  7. <build>
  8. <sourceDirectory>src</sourceDirectory>
  9. <plugins>
  10. <plugin>
  11. <artifactId>maven-compiler-plugin</artifactId>
  12. <version>3.5.1</version>
  13. <configuration>
  14. <source>1.8</source>
  15. <target>1.8</target>
  16. </configuration>
  17. </plugin>
  18. <plugin>
  19. <artifactId>maven-war-plugin</artifactId>
  20. <version>3.0.0</version>
  21. <configuration>
  22. <warSourceDirectory>WebContent</warSourceDirectory>
  23. </configuration>
  24. </plugin>
  25. </plugins>
  26. </build>
  27. <properties>
  28. <failOnMissingWebXml>false</failOnMissingWebXml>
  29. <spring.version>5.2.0.RELEASE</spring.version>
  30. <hibernate.version>5.2.11.Final</hibernate.version>
  31. <hibernate.validator>5.4.1.Final</hibernate.validator>
  32. <c3p0.version>0.9.5.2</c3p0.version>
  33. <jstl.version>1.2.1</jstl.version>
  34. <tld.version>1.1.2</tld.version>
  35. <servlets.version>3.1.0</servlets.version>
  36. <jsp.version>2.3.1</jsp.version>
  37. <hsqldb.version>1.8.0.10</hsqldb.version>
  38. </properties>
  39. <dependencies>
  40. <!-- Spring MVC Dependency -->
  41. <dependency>
  42. <groupId>org.springframework</groupId>
  43. <artifactId>spring-webmvc</artifactId>
  44. <version>4.0.1.RELEASE</version>
  45. </dependency>
  46. <!-- Spring ORM -->
  47. <dependency>
  48. <groupId>org.springframework</groupId>
  49. <artifactId>spring-orm</artifactId>
  50. <version>4.0.1.RELEASE</version>
  51. </dependency>
  52. <dependency>
  53. <groupId>javax.el</groupId>
  54. <artifactId>javax.el-api</artifactId>
  55. <version>3.0.0</version>
  56. </dependency>
  57. <!-- Hibernate Core -->
  58. <dependency>
  59. <groupId>org.hibernate</groupId>
  60. <artifactId>hibernate-core</artifactId>
  61. <version>4.3.5.Final</version>
  62. </dependency>
  63. <!-- JSTL Dependency -->
  64. <dependency>
  65. <groupId>javax.servlet.jsp.jstl</groupId>
  66. <artifactId>javax.servlet.jsp.jstl-api</artifactId>
  67. <version>${jstl.version}</version>
  68. </dependency>
  69. <dependency>
  70. <groupId>taglibs</groupId>
  71. <artifactId>standard</artifactId>
  72. <version>${tld.version}</version>
  73. </dependency>
  74. <!-- Servlet Dependency -->
  75. <dependency>
  76. <groupId>javax.servlet</groupId>
  77. <artifactId>javax.servlet-api</artifactId>
  78. <version>${servlets.version}</version>
  79. <scope>provided</scope>
  80. </dependency>
  81. <!-- JSP Dependency -->
  82. <dependency>
  83. <groupId>javax.servlet.jsp</groupId>
  84. <artifactId>javax.servlet.jsp-api</artifactId>
  85. <version>${jsp.version}</version>
  86. <scope>provided</scope>
  87. </dependency>
  88. <!-- HSQL Dependency -->
  89. <dependency>
  90. <groupId>hsqldb</groupId>
  91. <artifactId>hsqldb</artifactId>
  92. <version>${hsqldb.version}</version>
  93. </dependency>
  94. <dependency>
  95. <groupId>mysql</groupId>
  96. <artifactId>mysql-connector-java</artifactId>
  97. <version>8.0.15</version>
  98. </dependency>
  99. <dependency>
  100. <groupId>com.razorpay</groupId>
  101. <artifactId>razorpay-java</artifactId>
  102. <version>1.3.7</version>
  103. </dependency>
  104. <dependency>
  105. <groupId>com.instamojo</groupId>
  106. <artifactId>instamojo-java</artifactId>
  107. <version>2.0.2</version>
  108. </dependency>
  109. </dependencies>
  110. </project>

出现错误的页面:viewpage.jsp:-

  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@page import="com.razorpay.RazorpayException"%>
  3. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  4. <!DOCTYPE html>
  5. <html>
  6. <head><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=yes">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <link rel="stylesheet" href="css/index_css.css" />
  9. <link rel="stylesheet" href="css/header_css.css" />
  10. <link rel="stylesheet" href="css/footer_css.css" />
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. <title>JSP Page</title>
  13. <style type="text/css">
  14. h2{
  15. text-align: center;
  16. }
  17. .table{
  18. border-color:#404040;
  19. width:50%;
  20. background-color: rgb(255, 230, 204);
  21. margin-top:20px;
  22. margin-left: 25%;
  23. }
  24. /* Tabled Portrait */
  25. @media screen and (max-height: 950px){
  26. @media screen and (max-width: 800px) {
  27. #primary { width:100%; }
  28. #secondary { width:100%; margin:0; border:none; }
  29. h2{
  30. text-align: center;
  31. }
  32. .table{
  33. border-color:#404040;
  34. width:35%;
  35. font-size:7.5px;
  36. background-color: rgb(255, 230, 204);
  37. margin-top:20px;
  38. margin-left: 15%;
  39. }
  40. }
  41. }
  42. /* Tabled Portrait */
  43. @media screen and (max-height: 750px){
  44. @media screen and (max-width: 550px) {
  45. #primary { width:100%; }
  46. #secondary { width:100%; margin:0; border:none; }
  47. h2{
  48. text-align: center;
  49. }
  50. .table{
  51. border-color:#404040;
  52. width:5%;
  53. font-size:7.5px;
  54. background-color: rgb(255, 230, 204);
  55. margin-top:20px;
  56. margin-left: .5%;
  57. }
  58. }
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <%@ include file="header.jsp" %>
  64. <div class="context"></div>
  65. <h2>participants Data</h2><br>
  66. <table border="2" class="table">
  67. <th>Name</th>
  68. <th>Contact number</th>
  69. <th>Age</th>
  70. <th>Sex</th>
  71. <th>Address</th>
  72. <th>Email id</th>
  73. <th>Occupation</th>
  74. <th>T-shirt size</th>
  75. <th>Emergency contact name</th>
  76. <th>Emergency contact Number</th>
  77. <th>Blood group</th>
  78. <c:forEach items="${participantList}" var="plist">
  79. <tr>
  80. <td>${plist.id}</td>
  81. <td>${plist.name}</td>
  82. <td>${plist.age}</td>
  83. <td>${plist.sex}</td>
  84. <td>${plist.address}</td>
  85. <td>${plist.email}</td>
  86. <td>${plist.occupation}</td>
  87. <td>${plist.fee}</td>
  88. <td>${plist.nocovid}</td>
  89. <td>${plist.nocontact}</td>
  90. <td>${plist.nohealthissue}</td>
  91. <td>${plist.myresp}</td>
  92. <td>${plist.contactno}</td>
  93. <td>${plist.paymentId}</td>
  94. <td>${plist.transactionId}</td>
  95. </tr>
  96. </c:forEach>
  97. </table>
  98. <%@ include file="footer.jsp" %>
  99. </body>
  100. </html>

非常感谢您的帮助,请帮我解决。我使用的是jdk1.8.0,仅供参考,我的tomcat主目录中有以下jar:el-api.jar、jasper.jar、jasper-el.jar、jsp-api.jar、jaspic-api.jar、servlet-api.jar。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题