如何使用AEM解决org.apache.http.ssl? [英] How do I resolve org.apache.http.ssl with AEM?

查看:160
本文介绍了如何使用AEM解决org.apache.http.ssl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最终,我尝试使用Java代码中的AWS S3库来通过AEM启用服务器端S3上传,但是我遇到了一些问题,就是仅安装了依赖项并被AEM识别.每次添加新的依赖项时,都会弹出另外五个问题.

Ultimately, I'm trying to use AWS S3 libraries in Java code to enable server-side S3 uploads with AEM, but I'm running into problems just getting the dependencies installed and/or recognized by AEM. Every time I add a new dependency, five more issues pop up.

在这个包中,我正在尝试构建,这是我看到的错误:

In this bundle I'm attempting to build, This is the error I'm seeing:

我的pom.xml中的instructions是这样的:

    <instructions>
        <Embed-Transitive>true</Embed-Transitive>
        <Export-Package>
            com.amazonaws.HttpMethod,
            com.amazonaws.services.s3.*
        </Export-Package>
        <Embed-Dependency>
            gson,
            aws-java-sdk-s3,
            aws-java-sdk-core,
            aws-java-sdk-kms,
            jackson-core,
            jackson-databind,
            jackson-annotations,
            jackson-dataformat-cbor,
            ion-java,
            httpclient,
            brooklyn-karaf-httpcomponents-extension
        </Embed-Dependency>
    </instructions>

我做了一些谷歌搜索,发现了: https://mvnrepository.com/artifact/org.apache.brooklyn/brooklyn-karaf-httpcomponents-extension/0.11.0-20170403.1534

I did some googling and found this: https://mvnrepository.com/artifact/org.apache.brooklyn/brooklyn-karaf-httpcomponents-extension/0.11.0-20170403.1534

我认为此依赖关系可以解决我的问题,因此我将其放入依赖关系列表中,但该程序包仍显示为红色.

I thought that this dependency would fix my problem, so I put it into my list of dependencies, but the package still shows up in red.

我所有的依赖项:

<dependencies>
    <!-- OSGi Dependencies -->
    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.scr</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.scr.annotations</artifactId>
    </dependency>
    <dependency>
        <groupId>biz.aQute</groupId>
        <artifactId>bndlib</artifactId>
    </dependency>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
    </dependency>
    <!-- Other Dependencies -->

    <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.7</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.jcr</groupId>
        <artifactId>jcr</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
    </dependency>

    <dependency>
        <groupId>com.adobe.aem</groupId>
        <artifactId>aem-api</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.sling</groupId>
        <artifactId>org.apache.sling.models.api</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3 -->
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>1.11.115</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-core -->
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-core</artifactId>
        <version>1.11.115</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-kms -->
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-kms</artifactId>
        <version>1.11.115</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.9.4</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>junit-addons</groupId>
        <artifactId>junit-addons</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.6.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.6.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.6.3</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor -->
    <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-cbor</artifactId>
        <version>2.6.3</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/software.amazon.ion/ion-java -->
    <dependency>
        <groupId>software.amazon.ion</groupId>
        <artifactId>ion-java</artifactId>
        <version>1.0.2</version>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.brooklyn/brooklyn-karaf-httpcomponents-extension -->
    <dependency>
        <groupId>org.apache.brooklyn</groupId>
        <artifactId>brooklyn-karaf-httpcomponents-extension</artifactId>
        <version>0.11.0-20170403.1534</version>
    </dependency>
</dependencies>

推荐答案

在AEM实例中安装AWS依赖项的最简单方法是使用官方的AEM Oak S3连接器,该连接器可从

The easiest way to install AWS dependencies in your AEM instance is to use the official AEM Oak S3 connector which is available from Adobe's public repository. This is also assuming that you are not using S3 datastore in your instance otherwise all of these files and Jars would already be there. For the sake of this answer, I'll refer to v1.4.8. You can see more details on installing and configuring S3 datastore over here however, this answer is not focusing on S3 data store configuration, it's just there to provide all the libraries in your instance.

建议使用这种方法,因为它可以使您的AEM实例与Adobe的AEM官方修补程序和Service Pack兼容,这些修补程序和Service Pack与从AWS Developer站点提供的版本相比,通常使用旧版的AWS开发工具包.

This approach is recommended as it keeps your AEM instance compatible with Adobe's AEM official hotfixes and service packs which normally use older versions of AWS SDK as compared to ones available from AWS Developer site.

要安装AWS S3库,请执行以下步骤:

To install the AWS S3 libraries, do the following steps:

  1. Download the latest com.adobe.granite.oak.s3connector-.zip from the repository.
  2. Unpack the zip into a temporary folder.
  3. From your temporary folder, copy all the files under jcr_root/libs/system/install to `crx-quickstart/install' folder. You should see some folders named as 1,5,15. If you examine these, they contain several jar files including the AWS SDK.
  4. DO NOT copy the config files as they will setup your AEM instance to connect to S3 data store which is NOT what you want at this stage.
  5. Start/restart your instance and wait for it to complete.

要验证您是否具有所有文件,请执行以下操作:

To verify that you have all the files:

  1. 转到/system/console/bundles.
  2. 检查AWS SDK For Java for OSGicom.amazonaws.aws-java-sdk-osgi是否处于活动状态.
  3. 单击此捆绑包,查看所有导入和导出,其中包括使代码正常工作所需的库.
  1. Goto /system/console/bundles.
  2. Check that AWS SDK For Java for OSGicom.amazonaws.aws-java-sdk-osgi is active.
  3. Click on this bundle and see all the imports and exports which will include the libraries you need for your code to work.

采用这种方法可确保保留现有数据存储区,并在系统中正确安装与AEM兼容的AWS开发工具包.

Following this approach ensures that your existing datastore is preserved and AEM compatible AWS SDK is properly installed in your system.

这篇关于如何使用AEM解决org.apache.http.ssl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆