2017-03-26 84 views

回答

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中,嘗試在spring引導依賴關係(依賴關係的順序)之前放置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中部署時,依賴jar將按照字母數字順序提取到app文件夾。 – Gowda

+0

我看到了,那麼問題可能與我的不同。我正在嘗試Google Cloud ... –

0

最後,回到引導類的類路徑的方法。將jetty-alpn.jar作爲前綴引導類路徑,現在它開始在雲代工廠正常工作。