当前位置: 首页 > 知识库问答 >
问题:

当我尝试显示JSP页面时,如何解决错误?

窦宏旷
2023-03-14

我尝试在JSP页面上显示一些数据库记录。在我的项目中,我必须使用index.html和studentdeatils.jsp这样的页面。我将requestDispather设置为从索引页转到studentDetails页。

当我试图显示JSP时,我的浏览器页面中出现了以下错误。

HTTP Status 500 - Servlet execution threw an exception

type Exception report

message Servlet execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/servlet/RequestDispatcher"
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClass(Unknown Source)
    java.security.SecureClassLoader.defineClass(Unknown Source)
    java.net.URLClassLoader.defineClass(Unknown Source)
    java.net.URLClassLoader.access$100(Unknown Source)
    java.net.URLClassLoader$1.run(Unknown Source)
    java.net.URLClassLoader$1.run(Unknown Source)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findClass(Unknown Source)
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:894)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1298)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1175)
    com.mine.servlet.TestClass.doGet(TestClass.java:23)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.5 logs.
2015-03-03 12:17:10 Commons Daemon procrun stdout initialized
reqType = next
Inside if() reqType = next
ID :: 101 First Name :: Kavi Last Name :: Arasu
ID :: 102 First Name :: Sathis Last Name :: Kumar
ArrayList = [com.min.variableobject.StudentVO@45a690]
2015-03-03 12:17:10 Commons Daemon procrun stderr initialized
03-Mar-2015 12:17:14.535 INFO [main] org.apache.catalina.core.AprLifecycleListener.init The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\egurkha\bin;C:\egurkha\lib;C:\egurkha\JAVA\JDK\bin;C:\egurkha\lib\tt;C:\egurkha\bin\tt;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\apache-ant-1.9.4\bin;C:\Program Files\Java\jdk1.7.0_17\bin ;C:\egurkha\manager\tomcat\bin;.
03-Mar-2015 12:17:15.941 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Mar-2015 12:17:16.113 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Mar-2015 12:17:16.129 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
03-Mar-2015 12:17:16.145 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Mar-2015 12:17:16.145 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2763 ms
03-Mar-2015 12:17:16.270 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
03-Mar-2015 12:17:16.270 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.5
03-Mar-2015 12:17:16.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\egtomcat.war
03-Mar-2015 12:17:17.004 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
03-Mar-2015 12:17:17.238 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\Learning.war
03-Mar-2015 12:17:17.410 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
03-Mar-2015 12:17:17.410 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\docs
03-Mar-2015 12:17:17.457 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\manager
03-Mar-2015 12:17:17.551 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\ROOT
03-Mar-2015 12:17:17.598 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Mar-2015 12:17:17.598 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
03-Mar-2015 12:17:17.613 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1468 ms

请分享你的想法。

共有1个答案

东郭腾
2023-03-14

WAR文件中的JAR包含servlet-api.jarjavaee-api.jar。它绑定在tomcat安装中。如果要用这些jar添加任何lib,它们会产生冲突

 类似资料:
  • 将“然后向我显示页面”这一行添加到cucumber场景中,在我同事的计算机上使用相同的设置,但在我的计算机上则不然。实际上,添加暂停步骤定义并调用它似乎被完全忽略了。 步骤定义: 功能: 命令行: 使用Firefox 16.02(避免17中的错误) 两台机器都有git-fetch'd,拉取,捆绑安装,所以所有的宝石都是相同的,都使用Rbenv版本* 1.9.3-p327-perf。我可能错过了一些

  • bean名称'user'的BindingResult和普通目标对象都不能作为请求属性使用 Apr 05 2019 9:18:13 AM org.apache.catalina.core.StandardWrapperValve调用严重:在路径[/DataVisualization]的上下文中servlet[SpringController]的servlet.service()引发异常[处理JSP

  • 我发现了一个问题,即数据在控制器中正确编码并编译,但在alert语句中(或页面上)没有正确显示。请看下面的配置。 Tomcat服务器属性 null null null null null null null server.xml配置 我在这里缺少了什么样的简单配置?

  • 我已经在后端计算了表单提交总量,现在我需要在JSP页面上的“total submission”标记旁边显示它。我尝试了各种方法,但似乎都不管用。在jsp页面上显示长值的最佳方法是什么?

  • 错误:任务“:app:processDebugManifest”的执行失败。 清单合并失败:属性元数据#android。支持VERSION@value值=(25.3.1)来自[com.android.support:appcompat-v7:25.3.1]AndroidManifest。xml:27:9-31也出现在[com.android.support:cardview-v7:26.0.0-a