Quarkus本机编译错误:“映像堆中不允许任何sun.security.provider.NativePRNG实例”

时间:2020-01-28 23:14:38

标签: aws-lambda quarkus graalvm graalvm-native-image

我正在尝试编译一个AWS Lambda Quarkus Native项目。

当我尝试添加和使用HTTP客户端时,编译会中断。

错误如下:

Error: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
Detailed message:
Trace:  object java.security.SecureRandom
    object sun.security.ssl.SSLContextImpl$TLSContext
    object sun.security.ssl.SSLSocketFactoryImpl
    object org.apache.http.conn.ssl.SSLConnectionSocketFactory
    object java.util.concurrent.ConcurrentHashMap$Node
    object java.util.concurrent.ConcurrentHashMap$Node[]
    object java.util.concurrent.ConcurrentHashMap
    object org.apache.http.config.Registry
    object org.apache.http.impl.conn.DefaultHttpClientConnectionOperator
    object org.apache.http.impl.conn.PoolingHttpClientConnectionManager
    object org.apache.http.impl.client.HttpClientBuilder$2
    object java.lang.Object[]
    object java.util.ArrayList
    object org.apache.http.impl.client.InternalHttpClient
    method io.mirko.alexa.home.raspberry.impl.DynamoDBDeviceRepository.getAWSId(String)

我尝试使用OkHTTP和Apache HTTP Client失败。

我还尝试了选项--initialize-at-run-time,但与以下任一类均无相关结果:

  1. io.mirko.alexa.home.raspberry.impl.DynamoDBDeviceRepository_ClientProxy
  2. io.mirko.alexa.home.raspberry.impl.DynamoDBDeviceRepository
  3. org.apache.http.impl.client
  4. java.security.SecureRandom
  5. org.apache.http.impl.client.InternalHttpClient
  6. sun.security.provider.NativePRNG

我对使用哪个HTTP客户端没有限制。仅仅在Quarkus Native中可用就足够了。

谢谢。

0 个答案:

没有答案