Hortonworks教程生成失败,出现sun.security.provider.certpath.SunCertPa



我正试图从Hortonworks的"LAB 0:INGEST,ROUTE AND LAND REAL TIME EVENTS WITH APACHE NIFI"教程中构建"流模拟器"。

http://hortonworks.com/hadoop-tutorial/realtime-event-processing-nifi-kafka-storm/#stream-模拟程序lab0

为了让你大致了解这是什么,下面是Hortoworks页面上的描述:"流模拟器是一个生成卡车事件数据的轻量级框架。该模拟器使用纽约市卡车路线(kml),该路线通过纬度和经度信息定义驾驶员的道路路径。模拟器使用Akka来简化并发、消息传递和继承。它有两个普通的旧Java对象(POJOS),一个用于Trucks,另一个用于生成事件的Drivers。"

当我试图在构建结束时按照最新Hortonworks Sandbox(HDP 2.4)的指示构建模拟器时,Maven报告了这个错误:

[ERROR] Failed to execute goal on project storm-kafka-0.8-plus: 
Could not resolve dependencies for project net.wurstmeister.storm:
storm-kafka-0.8-plus:jar:0.4: Failed to collect dependencies at org.apache.storm:storm-core:jar:
0.9.1-incubating -> clj-time:clj-time:jar:0.4.1: 
Failed to read artifact descriptor for clj-time:clj-time:jar:0.4.1: 
Could not transfer artifact clj-time:clj-time:pom:0.4.1 from/to clojars (https://clojars.org/repo/): 
sun.security.validator.ValidatorException: PKIX path building failed:    
sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target

更详细的(maven-e)揭示了这些错误细节:

...
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454)
    ... 74 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
    ... 80 more

以下是导致构建错误的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                         http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hortonworks</groupId>
<artifactId>storm-demo</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>Storm Demo Parent Project</name>
<modules>
    <module>transport-domain</module>
    <module>stream-simulator</module>
    <module>storm-streaming</module>
    <module>storm-demo-webapp</module>
    <module>storm-kafkaplus</module>
    <!-- <module>iot-integration-tester</module> -->
</modules>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

有什么办法解决这个问题吗?请帮忙!

更新:下一个构建错误

在修复证书问题后,我现在有下一个错误:

[INFO] ------------------------------------------------------------------------
[INFO] Building Storm Demo Parent Project 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] transport-domain ................................... SUCCESS [  2.233 s]
[INFO] stream-simulator ................................... SUCCESS [  3.694 s]
[INFO] storm-streaming .................................... SUCCESS [01:13 min]
[INFO] storm-demo-webapp .................................. SUCCESS [  8.642 s]
[INFO] storm-kafka-0.8-plus ............................... SUCCESS [ 17.440 s]
[INFO] Storm Demo Parent Project .......................... FAILURE [  0.171 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:45 min
[INFO] Finished at: 2016-07-26T14:15:46+00:00
[INFO] Final Memory: 119M/826M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-compiler-plugin' from the repositories [local (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository 

您的maven插件正试图连接到https远程存储库,即https://clojars.org/repo/

你可以使用这篇文章中的一个解决方案:

在代理后面使用Maven和SSL的问题

我推荐的解决方案是:

(步骤可能因浏览器而异)

  • 使用浏览器(使用chrome)转到https://clojars.org/repo/
  • 单击锁定图标并选择"详细信息",然后单击"查看证书"
  • 转到"详细信息"选项卡并选择"复制到文件"
  • 选择类型"Base 64 X.509(.CER)"并将其保存在某个位置
  • 现在打开命令提示符并键入(使用您自己的路径):

    keytool -import -file C:tempmavenCert.cer -keystore C:tempmavenKeystore

  • 现在您可以使用参数再次运行该命令

    -Djavax.net.ssl.trustStore=C:tempmavenKeystore

  • 在linux下使用绝对路径

    -Djavax.net.ssl.trustStore=/tmp/mavenKeystore

现在您可以运行maven构建为:

/root/maven/bin/mvn clean package -Djavax.net.ssl.trustStore=C:tempmavenKeystore

相关内容

  • 没有找到相关文章

最新更新