Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streamparse wordcount example

I have been wanting to use Apache Storm to stream from Kafka. I am more comfortable with Python, so I decided to use streamparse (https://github.com/Parsely/streamparse). The word count example is the introductory example. I have been trying to get it to work on my local machine. I have the following version of JDK, lein and storm installed:

Leiningen 2.6.1 on Java 1.8.0_73 Java HotSpot(TM) 64-Bit Server VM

I run the following steps after following streamparse:

sparse quick start wordcount
cd wordcount
sparse run

I get the following error:


Retrieving org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.pom from central
Retrieving org/apache/storm/storm/0.10.1/storm-0.10.1.pom from central
Retrieving org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.jar from central
Could not transfer artifact com.parsely:streamparse:pom:0.0.4-SNAPSHOT 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
Could not transfer artifact clojure-complete:clojure-complete:pom:0.2.4 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
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

My project.clj file reads like this :


    (defproject wordcount "0.0.1-SNAPSHOT"
      :source-paths ["topologies"]
      :resource-paths ["_resources"]
      :target-path "_build"
      :min-lein-version "2.6.1"
      :jvm-opts ["-client"]
      :dependencies  [[org.apache.storm/storm-core "0.10.1"]
                  [com.parsely/streamparse "0.0.4-SNAPSHOT"]
                  ]
      :jar-exclusions     [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
      :uberjar-exclusions [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
  )

So, my lein and storm core versions are set correctly. I'm not sure where I am going wrong . Could somebody help me out?

-Thanks

like image 262
red_devil Avatar asked May 23 '16 18:05

red_devil


2 Answers

This is because java is not recognizing root certificate authority (CA) SSL certificate of https://clojars.org/repo.

Solution is to add that certificate to java cacerts file so that it got permanently accepted.

Step 1 : Get root certificate of https://clojars.org

  1. Open https://clojars.org in a chrome browser.
  2. locate Lock symbol just besides your address bar and click on it.
  3. view Details
  4. Click on top most certificate on hierarchy and confirm it is tailed with Root CA phrase.
  5. drag and drop that image which you saw written certificate on desktop.

Thats it! you got your root certificate!

Step 2 : Get that certificate added to java cacerts file.

  1. use keytool.exe inside your jre bin folder.
  2. fire following command to place your certificate inside cacerts file

keytool –import –noprompt –trustcacerts –alias ALIASNAME -file /PATH/TO/YOUR/DESKTOP/CertificateName.cer -keystore /PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit

That is it! you got your problem resolved.

PLEASE NOTE

  1. Do confirm that the jre which is giving you this PKIX error(JRE used by KAFKA) that is where you are performing STEP 2. If you would try with another jre problem would be as it is.

  2. Do use only one jre which is inside JDK it decreases chance to have issues.

like image 168
positivecrux Avatar answered Nov 16 '22 03:11

positivecrux


If you are using debian or ubuntu you can execute:

$ sudo update-ca-certificates -f
like image 26
jpalanco Avatar answered Nov 16 '22 03:11

jpalanco