MVN Package failed
Running com.iota.iri.TransactionValidatorTest
11/23 16:54:56.846 [main] INFO c.i.i.s.r.RocksDBPersistenceProvider - Initializing Database Backend...
11/23 16:54:56.932 [main] INFO c.i.i.s.r.RocksDBPersistenceProvider - RocksDB persistence provider initialized.
11/23 16:54:57.453 [main] INFO com.iota.iri.storage.Tangle - Shutting down Tangle Persistence Providers...
Assertion failed: (refs_.load(std::memory_order_relaxed) == 0), function ~ColumnFamilyData, file db/column_family.cc, line 425.
/bin/sh: line 1: 25099 Abort trap: 6 /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -jar /iota/iri/target/surefire/surefirebooter3918872786451318269.jar /iota/iri/target/surefire/surefire16745384227843165499tmp /iota/iri/target/surefire/surefire_010315493262344342366tmp
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project iri: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
Please provide system information for context.
slightly related:

Building on MacOS Sierra, version 10.12.6,
java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
I tried the README.txt instructions, mvn clean compile and mvn package, if there's another step to obtain deps. or what not, perhaps the README.txt needs some loving.
hmm, looks like the whole hamcrest library is only used in once spot, for a single method
import static org.hamcrest.Matchers.containsString
seems like overkill for a containsString check.
Adding this dependency to pom.xml seems to help:
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-integration</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>

However, now I get this issue:

the API integration test shouldn't run/compile when packing IRI (it requires an active local node). it doesn't do so on ubuntu 16.04, w/ maven 3.3.9
This seems to be the same issue as #355 (see mvn version comment) @gubatron can you try downgrading maven to see if issue resolves?
$ brew install [email protected]
==> Downloading https://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.3.9/binaries/apache-maven-3.
==> Best Mirror http://mirrors.sonic.net/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar
######################################################################## 100.0%
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/mvn
Target /usr/local/bin/mvn
is a symlink belonging to maven. You can unlink it:
brew unlink maven
To force the link and overwrite all conflicting files:
brew link --overwrite [email protected]
To list all files that would be deleted:
brew link --overwrite --dry-run [email protected]
Possible conflicting files are:
/usr/local/bin/mvn -> /usr/local/Cellar/maven/3.5.2/bin/mvn
/usr/local/bin/mvnDebug -> /usr/local/Cellar/maven/3.5.2/bin/mvnDebug
/usr/local/bin/mvnyjp -> /usr/local/Cellar/maven/3.5.2/bin/mvnyjp
==> Summary
🍺 /usr/local/Cellar/[email protected]/3.3.9: 91 files, 9.6MB, built in 5 seconds
...
Angels-MacBook-Pro:iri gubatron$ brew unlink maven; brew link --verwrite [email protected]
Angels-MacBook-Pro:iri gubatron$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T09:41:47-07:00)
Maven home: /usr/local/Cellar/[email protected]/3.3.9/libexec
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
Angels-MacBook-Pro:iri gubatron$ mvn clean compile; mvn package
...
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.709 s
[INFO] Finished at: 2017-11-27T13:30:02-07:00
[INFO] Final Memory: 22M/317M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project iri: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Looks like it's not maven @alon-e, same issue with mvn 3.3.9
I have resolved this issue here https://github.com/iotaledger/iri/pull/379 You should have it once it is merged.
The patch in #379 worked for me. Thanks @nayanmshah
My pleasure @ktorn . :)
@nayanmshah can you explain why your patch solve the issue? thanks
While shutting down the DB connection, we did not dispose the ColumnFamilyHandles which is expected by RockDB. I just ensured that it does that correctly now. That is why one of the tests failed when it tried to shut down DB during building the jar. @hotienvu
@nayanmshah the patch fixed the build for me too! (OSX Sierra 10.12.16) thanks a bunch!
Same issue here
@0x13a add @nayanmshah 's remote tracking branch to your repo, then merge in the changes from the dev branch.
(git checkout dev) # base branch in this repo
git remote add nayanmshah [email protected]:nayanmshah/iri
git fetch nayanmshah dev
git merge nayanmshah/dev --no-ff
Then, try running the build again! Should fix up this issue if you're running on OSX Sierra.
Hi @unenglishable, thanks for the suggestion, but I just downgraded to maven 3.0 to make it work. Anyway I just added the comment to make a bit of more noise, since the PR is not merged yet https://github.com/iotaledger/iri/pull/379. Hope someone will take this up
@0x13a yes build succeeds in Maven 3.0.5 https://archive.apache.org/dist/maven/maven-3/3.0.5/binaries/