Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9094

java.lang.LinkageError: loader constraint violation using SSL in camel-aws S3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-6.x-GA
    • jboss-fuse-6.3
    • Camel
    • None
    • % %
    • Hide

      Please find the attached reproducer application.

      You need to modify the reproducer to include your AWS credentials as well as path to the keystore file, which is installed under, FUSE_HOME/etc/

      Prior to deploying the bundle in Fuse 6.3, you will have to installed,

      • features:install camel-aws
      • Deploy, org.apache.servicemix.bundles.aws-java-sdk-1.10.52_1.jar
      • Deploy, httpclient-4.5.2.jar
      • Deploy, httpcore-4.4.2.jar

      camel-aws component excludes the HttpClient dependencies, so i think we can probably use any version of httpClient jars. However, better we use the shipped ones.

      Show
      Please find the attached reproducer application. You need to modify the reproducer to include your AWS credentials as well as path to the keystore file, which is installed under, FUSE_HOME/etc/ Prior to deploying the bundle in Fuse 6.3, you will have to installed, features:install camel-aws Deploy, org.apache.servicemix.bundles.aws-java-sdk-1.10.52_1.jar Deploy, httpclient-4.5.2.jar Deploy, httpcore-4.4.2.jar camel-aws component excludes the HttpClient dependencies, so i think we can probably use any version of httpClient jars. However, better we use the shipped ones.

    Description

      There are no test cases we have on camel-aws S3 component with SSL. I am unsure if SSL is supported.
      Technically, i do not see any issue with enabling SSL though.

      Attached is a reproducer application, example-camel-aws-s3-redhat-vgohel-reproducer.tar.gz, which on deployment has the below exception logged,

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "com.amazonaws.ApacheHttpClientConfig.withSslSocketFactory(Lorg/apache/http/conn/ssl/SSLSocketFactory;)Lcom/amazonaws/ApacheHttpClientConfig;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, com/redhat/SSLConfiguration, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for the method's defining class, com/amazonaws/ApacheHttpClientConfig, have different Class objects for the type org/apache/http/conn/ssl/SSLSocketFactory used in the signature
      	at com.redhat.SSLConfiguration.setSSLConfig(SSLConfiguration.java:33)
      

      The issue seems to be coming when the internal Apache HttpClient's SSLSocketFactory trying to instantiated by the JRE/JDK which is used on aws component for making the request.

      Attachments

        Activity

          People

            acosenti Andrea Cosentino
            rhn-support-vgohel Viral Gohel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: