Streamparse wordcount example

46.5k Views Asked by At

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

2

There are 2 best solutions below

2
On

This is because Java doesn't recognize the 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.

Steps:

  1. Open https://clojars.org in Chrome
  2. In address bar, click on the lock icon
  3. Click on Connection is secure
  4. Click on Certificate is valid
  5. Go to the Details tab
  6. In the Certificate Hierarchy box, the root certificate is the one, you need to work with
  7. Export this root certificate via the mmc tool:
    1. Call the mmc tool via console
    2. Click File -> Add/Remove Snap-In..., select Certificates - Current User, press OK
    3. In Certificates - Current User -> Trusted Root Certification Authorities -> Certificates, find your root certificate from the step #6, double click on it
    4. Go to Details tab
    5. Click on Copy to File...
    6. Follow the wizard, select DER encoded binary X.509 (.CER) and export it
  8. In the console, run the JRE/JDK keytool.exe from the bin folder:
keytool -importcert –noprompt -file %PATH_TO_EXPORTED_CERTIFICATE% -keystore %PATH_TO_SAVE_CACERTS% -alias "%CACERTS_ALIAS%"
  1. In Eclipse folder, open eclipse.ini
  2. Below the line -vmargs, adjust the values of -Djavax.net.ssl.trustStore and -Djavax.net.ssl.trustStoreType, which define the path to the exported CACERTS
  3. Restart Eclipse
0
On

If you are using debian or ubuntu you can execute:

$ sudo update-ca-certificates -f