googleapis / google-cloud-java

Google Cloud Client Library for Java
https://cloud.google.com/java/docs/reference
Apache License 2.0
1.9k stars 1.07k forks source link

java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN #3256

Closed praveenreactdev closed 5 years ago

praveenreactdev commented 6 years ago

Can anyone please help me with this. Getting this exception when deploying in Jboss

Application error message:

16:27:39,275 ERROR [org.hyperledger.fabric.sdk.Channel] (ServerService Thread Pool -- 146) Jetty ALPN/NPN has not been properly configured.: java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:162) [grpc-netty-1.7.0.jar:1.7.0]
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:136) [grpc-netty-1.7.0.jar:1.7.0]
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:124) [grpc-netty-1.7.0.jar:1.7.0]
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:94) [grpc-netty-1.7.0.jar:1.7.0]
at org.hyperledger.fabric.sdk.Endpoint.(Endpoint.java:143) [fabric-sdk-java-1.0.0.jar:]
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:159) [fabric-sdk-java-1.0.0.jar:]
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074) [fabric-sdk-java-1.0.0.jar:]
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898) [fabric-sdk-java-1.0.0.jar:]
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826) [fabric-sdk-java-1.0.0.jar:]
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526) [fabric-sdk-java-1.0.0.jar:]
at com.solartis.hyperledger.ejb.HyperLedgerSingleton.loadChannel(HyperLedgerSingleton.java:159) [classes:]
at com.solartis.hyperledger.ejb.HyperLedgerSingleton.init(HyperLedgerSingleton.java:73) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_92]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_92]
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:109)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ee.component.ComponentInstantiatorInterceptor.processInvocation(ComponentInstantiatorInterceptor.java:76)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:278) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:352) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:70)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:162)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:135)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:90)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:122) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:137) [jboss-as-ejb3-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_92]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_92]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_92]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_92]
at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_92]
at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:34) [grpc-netty-1.7.0.jar:1.7.0]
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153) [grpc-netty-1.7.0.jar:1.7.0]
... 52 more

My maven dependency tree

+- org.slf4j:slf4j-api:jar:1.7.3:compile
+- com.google.protobuf:protobuf-java:jar:3.1.0:compile
+- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:provided
+- org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar:1.0.2.Final:provided
+- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:jar:1.0.1.Final:provided
+- com.solartis.commons:commons-questionhashmap:jar:3.3-SNAPSHOT:compile
+- io.netty:netty-common:jar:4.1.14.Final:compile
+- io.netty:netty-tcnative-boringssl-static:jar:2.0.5.Final:compile
+- org.hyperledger.fabric-sdk-java:fabric-sdk-java:jar:1.0.0:compile
+- org.apache.commons:commons-compress:jar:1.8:compile
+- commons-cli:commons-cli:jar:1.4:compile
+- org.bouncycastle:bcprov-jdk15on:jar:1.55:compile
+- com.solartis.dataretriever:DataRetriever:jar:0.0.1-SNAPSHOT:compile
| +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile
| | - log4j:log4j:jar:1.2.17:compile
| - mysql:mysql-connector-java:jar:5.1.25:compile
+- org.bouncycastle:bcpkix-jdk15on:jar:1.55:compile
+- com.solartis.hyperledger:HyperLedgerIntegrationService-sd:jar:1.0:compile
| +- com.solartis.commons:commons-sd:jar:1.1-SNAPSHOT:compile
| +- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.0:compile
| | +- org.glassfish.jersey.core:jersey-common:jar:2.0:compile
| | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
| | | - org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
| | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.11:compile
| | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.11:compile
| | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.11:compile
| | - org.codehaus.jackson:jackson-xc:jar:1.9.11:compile
| +- org.glassfish.jersey.core:jersey-client:jar:2.0:compile
| | +- javax.ws.rs:javax.ws.rs-api:jar:2.0:compile
| | +- org.glassfish.hk2:hk2-api:jar:2.1.88:compile
| | | - org.glassfish.hk2:hk2-utils:jar:2.1.88:compile
| | +- org.glassfish.hk2.external:javax.inject:jar:2.1.88:compile
| | - org.glassfish.hk2:hk2-locator:jar:2.1.88:compile
| | +- org.glassfish.hk2.external:asm-all-repackaged:jar:2.1.88:compile
| | - org.glassfish.hk2.external:cglib:jar:2.1.88:compile
| +- org.glassfish.jersey.media:jersey-media-json-processing:jar:2.0:compile
| | +- javax.json:javax.json-api:jar:1.0:compile
| | +- org.glassfish:javax.json:jar:1.0:compile
| | - org.glassfish:jsonp-jaxrs:jar:1.0:compile
| - org.slf4j:slf4j-simple:jar:1.6.4:compile
+- commons-codec:commons-codec:jar:1.9:compile
+- com.solartis.datasaver:DataSaver:jar:0.0.1-SNAPSHOT:compile
+- com.solartis.ruleUtil:gateway:jar:2.0:compile
| +- com.solartis.knowledge.entity:knowledgebase-ed:jar:2.1.0-Final:compile
| +- org.drools:drools-core:jar:5.5.0.Final:compile
| | +- org.mvel:mvel2:jar:2.1.3.Final:compile
| | - org.drools:knowledge-internal-api:jar:5.5.0.Final:compile
| +- org.drools:drools-compiler:jar:5.5.0.Final:compile
| | +- org.antlr:antlr-runtime:jar:3.3:compile
| | +- org.antlr:antlr:jar:3.3:compile
| | +- org.antlr:stringtemplate:jar:3.2.1:compile
| | +- antlr:antlr:jar:2.7.7:compile
| | +- org.eclipse.jdt.core.compiler:ecj:jar:3.5.1:compile
| | - com.thoughtworks.xstream:xstream:jar:1.4.1:compile
| | +- xmlpull:xmlpull:jar:1.1.3.1:compile
| | - xpp3:xpp3_min:jar:1.1.4c:compile
| +- org.jbpm:jbpm-flow-builder:jar:5.4.0.Final:compile
| +- org.jbpm:jbpm-bpmn2:jar:5.4.0.Final:compile
| +- org.jbpm:jbpm-flow:jar:5.4.0.Final:compile
| +- org.drools:drools-decisiontables:jar:5.5.0.Final:compile
| | +- org.drools:drools-templates:jar:5.5.0.Final:compile
| | - net.sourceforge.jexcelapi:jxl:jar:2.6.10:compile
| +- org.drools:knowledge-api:jar:5.5.0.Final:compile
| +- commons-io:commons-io:jar:1.3.2:compile
| +- org.apache.httpcomponents:httpclient:jar:4.0-beta1:compile
| | - org.apache.httpcomponents:httpcore:jar:4.0-beta2:compile
| - com.solartis.drools:drools-sd:jar:3.0:compile
+- org.jboss.spec:jboss-javaee-6.0:pom:3.0.1.Final:compile
| +- javax.activation:activation:jar:1.1.1:compile
| +- javax.enterprise:cdi-api:jar:1.0-SP4:compile
| +- javax.inject:javax.inject:jar:1:compile
| +- javax.jws:jsr181-api:jar:1.0-MR1:compile
| +- javax.mail:mail:jar:1.4.4:compile
| +- javax.validation:validation-api:jar:1.0.0.GA:compile
| +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.el:jboss-el-api_2.2_spec:jar:1.0.2.Final:compile
| +- org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec:jar:2.0.9.Final:compile
| +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.management.j2ee:jboss-j2eemgmt-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.resource:jboss-connector-api_1.6_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:jar:1.0.2.Final:compile
| +- org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:jar:1.0.2.Final:compile
| +- org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec:jar:1.0.3.Final:compile
| | - xalan:xalan:jar:2.7.1.jbossorg-2:compile
| | - xalan:serializer:jar:2.7.1.jbossorg-2:compile
| +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar:1.0.4.Final:compile
| +- org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:jar:1.0.1.Final:compile
| +- org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:jar:1.0.2.Final:compile
| - org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:jar:2.0.1.Final:compile
+- org.jboss.resteasy:resteasy-jaxrs:jar:3.0-beta-3:test
| +- org.jboss.resteasy:jaxrs-api:jar:3.0-beta-3:test
| +- org.scannotation:scannotation:jar:1.0.3:test
| | - javassist:javassist:jar:3.12.1.GA:test
| +- javax.annotation:jsr250-api:jar:1.0:test
| +- net.jcip:jcip-annotations:jar:1.0:test
| - org.hibernate:hibernate-validator:jar:4.2.0.Final:test
+- com.solartis.insconfig:insconfig-ed:jar:0.3.7-SNAPSHOT:compile
| - com.google.code.gson:gson:jar:1.7.1:compile
+- io.grpc:grpc-all:jar:1.7.0:compile
| +- io.grpc:grpc-auth:jar:1.7.0:compile
| | - com.google.auth:google-auth-library-credentials:jar:0.4.0:compile
| +- io.grpc:grpc-core:jar:1.7.0:compile (version selected from constraint [1.7.0,1.7.0])
| | +- com.google.errorprone:error_prone_annotations:jar:2.0.19:compile
| | +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
| | +- com.google.instrumentation:instrumentation-api:jar:0.4.3:compile
| | - io.opencensus:opencensus-api:jar:0.6.0:compile
| +- io.grpc:grpc-context:jar:1.7.0:compile
| +- io.grpc:grpc-netty:jar:1.7.0:compile
| | +- io.netty:netty-codec-http2:jar:4.1.16.Final:compile (version selected from constraint [4.1.16.Final,4.1.16.Final])
| | | +- io.netty:netty-codec-http:jar:4.1.16.Final:compile
| | | | - io.netty:netty-codec:jar:4.1.16.Final:compile
| | | - io.netty:netty-handler:jar:4.1.16.Final:compile
| | | - io.netty:netty-buffer:jar:4.1.16.Final:compile
| | - io.netty:netty-handler-proxy:jar:4.1.16.Final:compile
| | +- io.netty:netty-transport:jar:4.1.16.Final:compile
| | | - io.netty:netty-resolver:jar:4.1.16.Final:compile
| | - io.netty:netty-codec-socks:jar:4.1.16.Final:compile
| +- io.grpc:grpc-okhttp:jar:1.7.0:compile
| | +- com.squareup.okhttp:okhttp:jar:2.5.0:compile
| | - com.squareup.okio:okio:jar:1.6.0:compile
| +- io.grpc:grpc-protobuf:jar:1.7.0:compile
| | +- com.google.protobuf:protobuf-java-util:jar:3.4.0:compile
| | +- com.google.api.grpc:proto-google-common-protos:jar:0.1.9:compile
| | - io.grpc:grpc-protobuf-lite:jar:1.7.0:compile
| +- io.grpc:grpc-protobuf-nano:jar:1.7.0:compile
| | - com.google.protobuf.nano:protobuf-javanano:jar:3.0.0-alpha-5:compile
| - io.grpc:grpc-stub:jar:1.7.0:compile
+- com.solartis.commons:commons-util:jar:1.4-SNAPSHOT:compile
| +- com.sun.crypto:sun-jce:jar:1.0:compile
| - org.hibernate:hibernate-core:jar:4.2.0.Final:compile
| +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
| +- dom4j:dom4j:jar:1.6.1:compile
| +- org.javassist:javassist:jar:3.15.0-GA:compile
| - org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
+- com.solartis.eclipse:alpn-api:jar:1.0.1:compile
+- com.google.guava:guava:jar:19.0:compile
- commons-httpclient:commons-httpclient:jar:3.1:compile
- commons-logging:commons-logging:jar:1.0.4:compile

My Compat checker result:

OS details:
os.detected.name: linux
os.detected.arch: x86_64
os.detected.classifier: linux-x86_64
os.detected.release: centos
os.detected.release.version: null
JVM details:
Java version: 1.8.0_92
Java specification version: 1.8
JVM bit mode: 64
OpenSSL details:
open ssl is available: false
ALPN is supported: false
Checking compatibility...
[PASS] This OS + architecture is supported.
[PASS] 64-bit JVM is supported.
[FAIL] Open SSL is NOT available
Open SSL Unavailability cause:
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-linux-x86_64, netty-tcnative-linux-x86_64-fedora, netty-tcnative]
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:178)
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:403)
at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:85)
at com.google.cloud.compatchecker.GoogleCloudCompatChecker.check(GoogleCloudCompatChecker.java:58)
at com.google.cloud.compatchecker.GoogleCloudCompatChecker.main(GoogleCloudCompatChecker.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:745)
[FAIL] Open SSL ALPN is NOT supported
Result: FAIL
Your environment is not supported by Forked Tomcat Native.
See http://netty.io/wiki/forked-tomcat-native.html for details.
This means that you won't be able to use grpc-based APIs, but
http1-based APIs should still work.
renannprado commented 6 years ago

Are you running inside of alpine? This is how I fixed the issue:

https://github.com/spring-cloud/spring-cloud-gcp/issues/327#issuecomment-409006879

chingor13 commented 5 years ago

netty-tcnative is not available out of the box on alpine. You can try the workaround above.