I have such code:
public static void main(String[] args) throws Exception {
System.out.println("ALPN class: " + ALPN.class);
HelloWorldClient client = new HelloWorldClient("localhost", 10009);
}
This gives such output:
ALPN class: class org.eclipse.jetty.alpn.ALPN
Exception in thread "main" java.lang.IllegalArgumentException: ALPN is not configured properly. See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting for more information.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:163)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:136)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:124)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:94)
at btcduke.node.ln.HelloWorldClient.<init>(HelloWorldClient.java:35)
at btcduke.node.ln.HelloWorldClient.main(HelloWorldClient.java:76)
Caused by: java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:34)
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
... 5 more
HelloWorldClient uses grpc, and it looks grpc is trying to load ALPN class dynamically. Am I right? This class can't be find, so I have error message. But please take a look,that I have access to this class (I print this class in first line). Do anyone knows why it happens this way? I have no idea :/
I toretically solved this issue by adding VM argument "-Xbootclasspath/p:" to run configuration option, but I don't understand why I needed to do this and also I don't think this is elegant method.