1

I am trying to build "stream simulator" from "REALTIME EVENT PROCESSING IN HADOOP WITH NIFI, KAFKA AND STORM" Hortonworks tutorial in particular from its "LAB 0: INGEST, ROUTE AND LAND REAL TIME EVENTS WITH APACHE NIFI".

http://hortonworks.com/hadoop-tutorial/realtime-event-processing-nifi-kafka-storm/#stream-simulator-lab0

To give you the rough idea what is this, here is description from Hortoworks page: "The stream simulator is a lightweight framework that generates truck event data. The simulator uses New York City Truck Routes (kml) which defines driver road paths with Latitude and Longitude information. The simulator uses Akka to simplify concurrency, messaging and inheritance. It has two Plain Old Java Objects (POJOS), one for Trucks and another for Drivers that generate the events."

When I try to build simulator as directed from latest Hortonworks Sandbox (HDP 2.4) by the end of the build Maven reports this error:

[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

More detailed (maven -e) reveals these error details:

...
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

And here is pom.xml resulting in the build error:

<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>

Any ideas how to solve this? Please help!

Update: Next build error

After fixing certificate problem, I now have next error:

[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 
dokondr
  • 3,389
  • 12
  • 38
  • 62

1 Answers1

0

Your maven plugin is trying to connect to an https remote repository, i.e., https://clojars.org/repo/

you can use one of the solution from this post:

Problems using Maven and SSL behind proxy

My recommended solution is:

(Steps may vary between browsers)

  • Use a browser (using chrome) to go to https://clojars.org/repo/
  • Click on lock icon and choose "Details" and click "View certificate"
  • Go to the "Details" tab and choose "Copy to File"
  • Choose type "Base 64 X.509 (.CER)" and save it somewhere
  • Now open a command prompt and type (use your own paths):

    keytool -import -file C:\temp\mavenCert.cer -keystore C:\temp\mavenKeystore

  • Now you can run the command again with the parameter

    -Djavax.net.ssl.trustStore=C:\temp\mavenKeystore

  • Under linux use absolute path

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

Now you can run maven build as:

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

Community
  • 1
  • 1
Ronak Patel
  • 3,819
  • 1
  • 16
  • 29
  • Did everything as you suggest, still the same error. On linux, when creating keystore, keytool makes you to set password for this new keystore. May this password be a problem for maven? – dokondr Jul 26 '16 at 13:40
  • 1
    if you have created password for keysotre than pass one more param to `mvn` command : `javax.net.ssl.keyStorePassword=yourpwd` -useful link: http://maven.apache.org/guides/mini/guide-repository-ssl.html - Not all the properties must be set depending of your precise settings: type of store may left to default, password may be empty. – Ronak Patel Jul 26 '16 at 13:58
  • Keystore password was not the problem. Build failed because I used certificate of https://clojars.org/repo/ instead of https://clojars.org/repo/clj-time/. Now I have another maven error: [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. Please see details in my updated post. – dokondr Jul 26 '16 at 14:20
  • Finally built. The last problem was of the same kind as the first one. Maven could not access https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/ because of the certificate. After manually installing with a keytool cert of plugin repository into local keystore, maven managed to complete the build. Many thanks for your help! – dokondr Jul 26 '16 at 15:11