我正在尝试编译一个 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 客户端但没有成功。
我也尝试了 option --initialize-at-run-time
,但与以下任何类都没有相关结果:
- io.mirko.alexa.home.raspberry.impl.DynamoDBDeviceRepository_ClientProxy
- io.mirko.alexa.home.raspberry.impl.DynamoDBDeviceRepository
- org.apache.http.impl.client
- java.security.SecureRandom
- org.apache.http.impl.client.InternalHttpClient
- sun.security.provider.NativePRNG
我对使用哪个 HTTP 客户端没有任何限制。仅仅在 Quarkus Native 中一个可用的就绰绰有余了。
谢谢。