scylladb / scylla-migrator

Migrate data extract using Spark to Scylla, normally from Cassandra/parquet files. Alt. from DynamoDB to Scylla Alternator.
https://migrator.docs.scylladb.com/stable/
Apache License 2.0
55 stars 34 forks source link

Null Pointer Exception when trying to run build command #22

Closed worldofprasanna closed 4 years ago

worldofprasanna commented 4 years ago

I am trying to build the Scylla Migrator project using the command ./build.sh But I am getting the below error,

[info] Loading project definition from <path>/scylla-migrator/spark-cassandra-connector/project
java.lang.NullPointerException
    at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
    at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
    at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
    at java.base/java.util.regex.Pattern.matcher(Pattern.java:1135)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1263)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1336)
...
[error] (compile:compileIncremental) java.lang.NullPointerException

This is my environment,

➜  scala -version
Scala code runner version 2.13.3 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.

➜  java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)

➜  sbt --version
sbt version in this project: 1.3.3
sbt script version: 1.3.13

Please let me know if I am missing something. I have asked for help in the slack channel and I was redirected to creating an issue in Github. Thanks in advance.

tarzanek commented 4 years ago

per https://travis-ci.org/github/scylladb/scylla-migrator/branches the builds work on master, e.g. https://travis-ci.org/github/scylladb/scylla-migrator/builds/708254582 scala used is however 2.11 which might be the prob let me retry in my env

tarzanek commented 4 years ago

btw. note that the full clean way to build is in https://github.com/scylladb/scylla-migrator/issues/8#issuecomment-552019596 so you can try that in the mean time @worldofprasanna

iravid commented 4 years ago

@worldofprasanna Can you verify you have JAVA_HOME exported? This looks like https://github.com/sbt/sbt/issues/5452. If that solves the problem we'll add that to the build script.

tarzanek commented 4 years ago

so for me sbt clean before running build.sh worked I run it on same sbt version as you have, java "1.8.0_265" and scala should be picked by sbt from project properties automatically as 2.11 (I am on Ubuntu 20.04)

so can you please try this or any of the mentioned clean full way steps? and as Itamar suggests - if you are on Mac the missing JAVA_HOME might be a problem

worldofprasanna commented 4 years ago

Hey sorry for the late reply. I could able to do this & get it worked 👍

  1. Set the JAVA_HOME - export JAVA_HOME=$(/usr/libexec/java_home)
  2. Run sbt clean - In the log it mentioned that it started using scala 2.11
  3. Run ./build.sh and it worked.

Thanks guys !!