org.apache.coyote.http2.Http2Protocol的Http2Protocol.jar包在哪里下载
时间: 2024-09-18 07:10:04 浏览: 50
Apache Coyote的HTTP/2协议实现通常包含在Tomcat服务器本身之中,而不是作为单独的jar包提供下载。如果你需要使用Java HTTP/2 API,可以直接从Jakarta EE (以前的Java Servlet和JSP规范维护者)项目下载jakarta.http2-api或者jakarta.http2-client库。
对于Tomcat,你需要确保它的版本包含了HTTP/2功能,比如Tomcat 9及以上版本默认就集成了HTTP/2支持。如果需要手动添加,可以在`$CATALINA_HOME/lib`目录下查找名为类似`http-nio-<version>.jar`或`http2-nio-<version>.jar`的文件,其中`<version>`代表Tomcat的具体版本号。
如果你确实需要将HTTP/2作为一个独立的库使用,可以访问Oracle的Maven仓库或Jakarta EE的官方Maven仓库下载对应的依赖。例如,在Maven的pom.xml文件中添加如下依赖:
```xml
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.platform.jakarta.http2-api</artifactId>
<version>17.0.2</version> <!-- 替换为实际版本 -->
</dependency>
```
相关问题
java.lang.ClassNotFoundException: org.apache.coyote.http11.Http11Protocol
This error message is usually displayed when the Java Virtual Machine (JVM) is unable to find the required class file for the Http11Protocol class. This class is part of the Apache Coyote HTTP/1.1 Connector component, which is used by the Apache Tomcat web server.
The error can occur due to several reasons, including:
1. The class file is not present in the classpath of the application or server.
2. The class file is present but not accessible due to incorrect permissions.
3. The required JAR file containing the class is not included in the classpath.
4. The version of the JAR file containing the class is incompatible with the version of the application or server.
To resolve the issue, try the following steps:
1. Check if the required JAR file containing the class is present in the classpath.
2. Ensure that the permissions are set correctly for the JAR file and the class file.
3. If the JAR file is not present, download and include it in the classpath.
4. If the version of the JAR file is incompatible, download the correct version and include it in the classpath.
If none of the above steps work, it may be necessary to reinstall or upgrade the affected software component.
Initializing Spring DispatcherServlet 'dispatcherServlet' 2023-06-09 19:57:51.583 INFO 1 --- [nio-9211-exec-3] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2023-06-09 19:57:51.604 INFO 1 --- [nio-9211-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 21 ms 2023-06-09 19:57:58.676 INFO 1 --- [nio-9211-exec-5] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol [RTSP/1.00x0d0x0a0x0d...] at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:560) ~[tomcat-embed-core-9.0.37.jar!/:9.0.37] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:260) ~[tomcat-embed-core-9.0.37.jar!/:9.0.37] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.37.jar!/:9.0.37] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.37.jar!/:9.0.37] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) [tomcat-embed-core-9.0.37.jar!/:9.0.37] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.37.jar!/:9.0.37] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_312] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_312] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.37.jar!/:9.0.37] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_312]
这个日志是 Tomcat 记录的错误信息,错误信息的大致意思是在解析 HTTP 请求头部时发生了错误,因为在 HTTP 请求的第一行中发现了无效的字符,具体是 RTSP/1.00x0d0x0a0x0d。
可能的原因有:
1. 客户端发送的请求格式不正确,例如使用了错误的协议类型(RTSP 不是 HTTP)。
2. 客户端发送的请求头部中包含了非法字符,例如在请求行或请求头部中包含回车、换行等控制字符。
3. 网络传输过程中发生了错误,导致请求被截断或出现乱码。
解决方法:
1. 检查客户端发送的请求格式是否正确,确保使用的是正确的协议类型。
2. 检查客户端发送的请求头部是否包含了非法字符,如果有,需要将其去除或替换。
3. 检查网络连接是否正常,如果存在网络传输问题,需要修复网络故障。
另外,该错误只是一个警告,不一定会导致应用程序崩溃,如果应用程序能够正常工作,可以忽略这个错误。如果该错误频繁发生,可以通过调整 Tomcat 的日志级别来减少其输出。
阅读全文
相关推荐
















