2017-03-26 7 views
1

를 구성되지 않았습니다.java.lang.IllegalArgumentException가 : 카프카</strong>을 게시/<strong>에서 메시지를 사용하는 <code>gRPC(google pub/sub)</code>를 사용하는 동안 부두 ALPN은/NPN 제대로, <code>java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured</code> 얻기

+0

가 [mcve] 주시기 바랍니다. – zett42

+0

서식을 지정하고 새 태그 – HRgiger

+0

을 (를) 사용 하시겠습니까? – saturnism

답변

0

netty-tcnative-boringssl-static에 런타임 종속성을 추가하십시오. gRPC의 SECURITY.md을 참조하십시오. netty-tcnative의 버전은 시간이 지남에 따라 변경됩니다. 특정 출시 버전의 문서 버전을 확인해야합니다 (예 : this is for 1.2.0).

+0

이 옵션을 오래 전에 사용해 보았습니다. – Gowda

0

다음 방법으로 시도했습니다.

1.  As suggested by google, use jetty container instead of tomcat, this solution works, but in our production, applications deployed on tomcat container. – No from team 
2.  On debugging the gRPC code, found that guava version causing the issue, updated the guava version 18.0, (where in some classes missed in previous versions) , solved the problem , but failed while deploying in CF 
3.  Customized emebed-tomcat-core, and it works fine consistently – but team say no to custom tomcat container. 
4.  Java –jar apm-asset-xxxx.jar – works fine locally, but need to provide a custom command to CF start, didn’t have luxury to change the CF start process. 
5.  Finally, trick, the class loader to use tcnative-boring-ssl, library instead of tomcat-core library at runtime, by providing the following dependency in pom.xml. From past 3 days, this solution is working CF. 

    <dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-web</artifactId> 
    <exclusions> 
     <exclusion> 
      <groupId>org.hibernate</groupId> 
      <artifactId>*</artifactId> 
     </exclusion> 
     <exclusion> 
      <groupId>org.apache.tomcat.embed</groupId> 
      <artifactId>tomcat-embed-core</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.tomcat.embed</groupId> 
    <artifactId>tomcat-embed-core</artifactId> 
    <scope>provided</scope> 
</dependency> 

6. Maven manifest plugin to promote the tc-native library to the top in the classloader. 
+0

젠장, 질문에 추가하십시오. 이것은 포럼이 아니다. –

-1

POM에서는 스프링 부트 종속성 (의존성 순서가 중요 함) 이전에 gRPC 종속성을 배치하려고 시도합니다. 나는 그것을했고 문제는 해결되었다. 예를 들면 다음과 같습니다.

<dependency> 
    <groupId>com.google.cloud</groupId> 
    <artifactId>google-cloud-language</artifactId> 
    <version>0.13.0-beta</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-web</artifactId> 
</dependency> 
+0

종속 관계의 순서는 중요하지 않으며, 로컬에서 작동하며, 봄 부팅 전에 gRPC/tc-native를 갖는다. Cloud Foundry에 배포하면 종속 항아리가 응용 프로그램 폴더에 알파 숫자 순으로 추출됩니다. – Gowda

+0

나는이 문제가 내 것과 다를 수 있음을 알았다. Google Cloud에서 시도 중이었습니다 ... –

0

마지막으로 부트 클래스 클래스 경로 접근 방식으로 되돌아갔습니다. bootty 경로에 jetty-alpn.jar를 접두사로 붙였습니다. 이제 클라우드 파운드리에서 제대로 작동합니다.