天天看點

java 應用 http spdy_java-删除了ALPN回調:禁用了SPDY和HTTP / 2. alpn-boot是否在引導類路徑上?...

嘗試擷取Apple Push通知以與我的Spring Boot項目一起使用.

我正在使用此apns-http2發送推送通知.從他們的github頁面:

Note: Ensure that you have Jetty’s ALPN JAR (OkHttp requires it) in

your boot classpath. See here for more information. This is required

until Java 9 is released,as Java 8 does not have native support for

HTTP/2.

是以我添加了vm選項

Xbootclasspath/p:/Users/sarath/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720//alpn-boot-8.1.9.v20160720.jar

在Intellij中運作配置,一切正常.我收到推送通知.

但是,當我将戰争部署到tomcat并嘗試發送推送通知時,出現了錯誤:

20-Apr-2019 13:08:33.400 INFO [OkHttp https://api.development.push.apple.com/3/device/A704797F6E1E284FB081630184A26755B59593715E1CD543483C2136CE24D4FD] okhttp3.internal.Platform$JdkWithJettyBootPlatform.getSelectedProtocol ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?

20-Apr-2019 13:08:34.935 INFO [OkHttp https://api.development.push.apple.com/3/device/A704797F6E1E284FB081630184A26755B59593715E1CD543483C2136CE24D4FD] okhttp3.internal.Platform$JdkWithJettyBootPlatform.getSelectedProtocol ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?

20-Apr-2019 13:08:36.588 INFO [OkHttp https://api.development.push.apple.com/3/device/A704797F6E1E284FB081630184A26755B59593715E1CD543483C2136CE24D4FD] okhttp3.internal.Platform$JdkWithJettyBootPlatform.getSelectedProtocol ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?

20-Apr-2019 13:08:38.109 INFO [OkHttp https://api.development.push.apple.com/3/device/A704797F6E1E284FB081630184A26755B59593715E1CD543483C2136CE24D4FD] okhttp3.internal.Platform$JdkWithJettyBootPlatform.getSelectedProtocol ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?

failure: NotificationResponse{error=null,httpStatusCode=-1,responseBody='null',cause=java.io.IOException: unexpected end of stream on [email protected]}

我不确定如何在啟動類路徑上設定alpn-boot.我嘗試執行

java -Xbootclasspath/p:/Users/sarath/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar

從指令提示符.但這僅顯示了一些Java幫助指令.不知道jar是否實際上已添加到引導類路徑.

我還嘗試過使用maven-surefire-plugin,就像它說的是here.但是仍然出現相同的錯誤.

這是我的pom.xml

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

com.cinch

gch

2.0.0

../pom.xml

com.cinch.gch

apn

1.0.0

war

apn

Contains push notification services

1.8

8.1.9.v20160720

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-tomcat

org.springframework.boot

spring-boot-starter-security

org.springframework.boot

spring-boot-starter-test

test

org.springframework.boot

spring-boot-starter-activemq

com.cinch.gch

core

1.0.0

org.springframework.boot

spring-boot-starter-data-jpa

MysqL

MysqL-connector-java

com.cinch

gch-cache

org.mortbay.jetty.alpn

alpn-boot

${alpn-boot-version}

runtime

com.clevertap.apns

apns-http2

1.0.3

org.springframework.boot

spring-boot-maven-plugin

org.apache.maven.plugins

maven-compiler-plugin

1.8

1.8

org.apache.maven.plugins

maven-war-plugin

2.6

false

maven-surefire-plugin

-Xbootclasspath/p:/Users/sarath/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/${alpn-boot-version}/alpn-boot-${alpn-boot-version}.jar

gch-apn

我嘗試了許多其他操作,但似乎沒有任何效果.任何幫助表示贊賞.