I am following the:
https://github.com/CleverTap/apns-http2
and my code:
FileInputStream cert = new FileInputStream("/path/to/certificate.p12");
final ApnsClient client = new ApnsClientBuilder()
.withProductionGateway()
.inSynchronousMode()
.withCertificate(cert)
.withPassword("")
.withDefaultTopic("
.build();
Notification n = new Notification.Builder("
.alertBody("Hello").build();
client.push(n, new NotificationResponseListener() {
@Override
public void onSuccess(Notification notification) {
System.out.println("success!");
}
@Override
public void onFailure(Notification notification, NotificationResponse nr) {
System.out.println("failure: " + nr);
}
});
after running with command line:
java -jar myapp.jar
it shows error:
{error=null, httpStatusCode=-1, responseBody='null', cause=java.io.IOException: unexpected end of stream on okhttp3.Address@66850ef
Importance note:
my code works fine on
java 1.8_u242
command line: java -javaagent:D:\jetty-alpn-agent-2.0.10.jar -jar myapp.jar
Sorry but this seems to have nothing to do with Jetty?
Why do you think it's a Jetty problem?
You filed the issue about 8u252, but you are actually using 8u242?
Don't delete the template questions when creating an issue, they are there to detail your environment so we understand better what's going on.
What Jetty version?
What JDK vendor and version?
Please detail exactly how this is a Jetty issue.
like my post:
I tested with 2 version of java
1-1.8_u242 it works fine[I wanted to make sure code is good only]
2-
openjdk version "1.8.0_252"
OpenJDK Runtime Environment Corretto-8.252.09.2 (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM Corretto-8.252.09.2 (build 25.252-b09, mixed mode)
it does not work
my issues are on [openjdk version "1.8.0_252"]
any ideas to resolve it?
What Jetty version? how to use jetty version? because you can see on my command line :java -jar myapp.jar
don't have any jetty version, and guide https://webtide.com/jetty-alpn-java-8u252/ don't use jetty version at command line too
You are using OkHttp.
The linked blog details that libraries must be prepared to the changes introduced in 8u252, since the Jetty ALPN Agent won't provide any support for ALPN for 8u252 or later.
Have you verified this with OkHttp?
i am following about link only
you mean, I have to add OkHttp libary on the command line
java -classpath okHttp.jat -jar myapp.jar
?
Jetty ALPN Agent won't provide any support for ALPN for 8u252 or later.
from that 8u252 we don't need add the agent
Changes for libraries/applications directly using Jetty ALPN APIs
what are your mean?
I tried
jetty-alpn-openjdk8-[client|server] to the command line. but it dose not work
@nthung82 you have to verify with OkHttp if they support 8u252.
I will check, then report to you if have result
tks
@sbordet
your suggest is fine
java8u252 works with
https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp/3.3.0
many tks