Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS S3 SDK support #5

Open
6 of 9 tasks
maizy opened this issue Jul 8, 2018 · 2 comments
Open
6 of 9 tasks

AWS S3 SDK support #5

maizy opened this issue Jul 8, 2018 · 2 comments

Comments

@maizy
Copy link
Owner

maizy commented Jul 8, 2018


Exception with unsupported TLS
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.lang.Throwable.<init>(Throwable.java:310)
	at java.lang.Exception.<init>(Exception.java:102)
	at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89)
	at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72)
	at com.oracle.svm.reflect.proxies.Proxy_13_AwsTestApp_main.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:173)
Caused by: org.apache.http.conn.ssl.SSLInitializationException: TLS SSLContext not available
	at java.lang.Throwable.<init>(Throwable.java:287)
	at java.lang.Exception.<init>(Exception.java:84)
	at java.lang.RuntimeException.<init>(RuntimeException.java:80)
	at java.lang.IllegalStateException.<init>(IllegalStateException.java:75)
	at org.apache.http.conn.ssl.SSLInitializationException.<init>(SSLInitializationException.java:34)
	at com.amazonaws.internal.SdkSSLContext.getPreferredSSLContext(SdkSSLContext.java:37)
	at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:91)
	at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
	at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
	at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:50)
	at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:38)
	at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:315)
	at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:299)
	at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:177)
	at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:644)
	at com.amazonaws.services.s3.AmazonS3Builder$1.apply(AmazonS3Builder.java:35)
	at com.amazonaws.services.s3.AmazonS3Builder$1.apply(AmazonS3Builder.java:32)
	at com.amazonaws.services.s3.AmazonS3ClientBuilder.build(AmazonS3ClientBuilder.java:64)
	at com.amazonaws.services.s3.AmazonS3ClientBuilder.build(AmazonS3ClientBuilder.java:28)
	at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
	at com.amazonaws.services.s3.AmazonS3ClientBuilder.defaultClient(AmazonS3ClientBuilder.java:54)
	at space.maizy.skalka.AwsTestApp$.testS3Listing(AwsTestApp.scala:31)
	at space.maizy.skalka.AwsTestApp$.main(AwsTestApp.scala:19)
	at space.maizy.skalka.AwsTestApp.main(AwsTestApp.scala)
	... 3 more
Caused by: java.security.NoSuchAlgorithmException: TLS SSLContext not available
	at java.lang.Throwable.<init>(Throwable.java:265)
	at java.lang.Exception.<init>(Exception.java:66)
	at java.security.GeneralSecurityException.<init>(GeneralSecurityException.java:56)
	at java.security.NoSuchAlgorithmException.<init>(NoSuchAlgorithmException.java:57)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
	at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
	at com.amazonaws.internal.SdkSSLContext.getPreferredSSLContext(SdkSSLContext.java:32)
	... 21 more

because of https://github.com/aws/aws-sdk-java/blob/4734de6fb0f80fe5768a6587aad3b9d0eaec388f/aws-java-sdk-core/src/main/java/com/amazonaws/internal/SdkSSLContext.java#L32

Exception on logging adapter misses some classes
WARNING: The sunec native library could not be loaded.
Exception in thread "main" org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl)
    at java.lang.Throwable.<init>(Throwable.java:265)
    at java.lang.Exception.<init>(Exception.java:66)
    at java.lang.RuntimeException.<init>(RuntimeException.java:62)
    at org.apache.commons.logging.LogConfigurationException.<init>(LogConfigurationException.java:65)
    at org.apache.commons.logging.LogConfigurationException.<init>(LogConfigurationException.java:55)
    at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1158)
    at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:960)
    at com.oracle.svm.core.jdk.Target_java_security_AccessController.doPrivileged(SecuritySubstitutions.java:62)
    at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:957)
    at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:624)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(SSLConnectionSocketFactory.java:157)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(SSLConnectionSocketFactory.java:263)
    at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:92)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
    at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:50)
    at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:38)
    at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:315)
    at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:299)
    at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:177)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:644)
    at com.amazonaws.services.s3.AmazonS3Builder$1.apply(AmazonS3Builder.java:35)
    at com.amazonaws.services.s3.AmazonS3Builder$1.apply(AmazonS3Builder.java:32)
    at com.amazonaws.services.s3.AmazonS3ClientBuilder.build(AmazonS3ClientBuilder.java:64)
    at com.amazonaws.services.s3.AmazonS3ClientBuilder.build(AmazonS3ClientBuilder.java:28)
    at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
    at com.amazonaws.services.s3.AmazonS3ClientBuilder.defaultClient(AmazonS3ClientBuilder.java:54)
    at space.maizy.skalka.AwsTestApp$.testS3Listing(AwsTestApp.scala:33)
    at space.maizy.skalka.AwsTestApp$.main(AwsTestApp.scala:19)
    at space.maizy.skalka.AwsTestApp.main(AwsTestApp.scala)
    at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:163)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl
    at java.lang.Throwable.<init>(Throwable.java:287)
    at java.lang.Exception.<init>(Exception.java:84)
    at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:75)
    at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:82)
    at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:51)
    at com.oracle.svm.core.jdk.Target_java_lang_ClassLoader.loadClass(Target_java_lang_ClassLoader.java:126)
    at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1020)
    ... 27 more
Exception with SSLFactory
Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at java.lang.Throwable.<init>(Throwable.java:265)
	at java.lang.Exception.<init>(Exception.java:66)
	at java.io.IOException.<init>(IOException.java:58)
	at javax.net.ssl.SSLException.<init>(SSLException.java:52)
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1903)
	at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1886)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1402)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at space.maizy.skalka.ahctest.AhcTestApp$.main(AhcTestApp.scala:22)
	at space.maizy.skalka.ahctest.AhcTestApp.main(AhcTestApp.scala)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:164)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at java.lang.Throwable.<init>(Throwable.java:287)
	at java.lang.Exception.<init>(Exception.java:84)
	at java.lang.RuntimeException.<init>(RuntimeException.java:80)
	at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:91)
	at sun.security.validator.Validator.getInstance(Validator.java:181)
	at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
	at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
	... 16 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at java.lang.Throwable.<init>(Throwable.java:265)
	at java.lang.Exception.<init>(Exception.java:66)
	at java.security.GeneralSecurityException.<init>(GeneralSecurityException.java:56)
	at java.security.InvalidAlgorithmParameterException.<init>(InvalidAlgorithmParameterException.java:64)
	at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
	at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
	at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
	at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:89)
	... 28 more
maizy added a commit that referenced this issue Jul 9, 2018
maizy added a commit that referenced this issue Jul 9, 2018
maizy added a commit that referenced this issue Nov 6, 2018
maizy added a commit that referenced this issue Nov 6, 2018
maizy added a commit that referenced this issue Nov 7, 2018
@maizy
Copy link
Owner Author

maizy commented Nov 8, 2018

issue about AHC: oracle/graal#768

@plutext
Copy link

plutext commented Jan 6, 2019

Regarding Exception with SSLFactory, please find workaround at oracle/graal#768 (comment)

(I haven't needed any @substitution stuff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants