authenteq-zz / java-bigchaindb-driver

Official BigchainDB Java driver
https://www.bigchaindb.com
Apache License 2.0
32 stars 22 forks source link

Installed .jar is missing some classes #6

Closed tzclucian closed 7 years ago

tzclucian commented 7 years ago

Steps.

  1. I've checked out this repo.
  2. I've done a ./gradlew install
  3. I can see the installed dependency: .m2/repository/com/authenteq/java-crypto-conditions/0.1/java-crypto-conditions-0.1.jar

Shouldn't this be called java-bigchaindb-driver? I saw this.

I import the dependency in a maven project:

        <dependency>
            <groupId>com.authenteq</groupId>
            <artifactId>java-crypto-conditions</artifactId>
            <version>0.1</version>
        </dependency>

I'm not able to create a transaction, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/interledger/cryptoconditions/types/Ed25519Sha256Condition
    at com.authenteq.BigchaindbTransaction.buildTransactionJson(BigchaindbTransaction.java:83)
    at com.authenteq.BigchaindbTransaction.<init>(BigchaindbTransaction.java:59)
    at com.rezzonade.persistence.bigchaindb.Example.main(Example.java:52)
Caused by: java.lang.ClassNotFoundException: org.interledger.cryptoconditions.types.Ed25519Sha256Condition
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 3 more

I can solve this by manually installing java-crypto-conditions-2.0.0-SNAPSHOT.jar by using:

mvn install:install-file -Dfile=yourClonedRepo/libs/java-crypto-conditions-2.0.0-SNAPSHOT.jar -DgroupId=org.interledger -DartifactId=java-crypto-conditions -Dversion=2.0.0-SNAPSHOT -Dpackaging=jar

Am I missing something or are these actual bugs?

bohdanbezp commented 7 years ago

Yeah, thanks for noting, another typo.

bohdanbezp commented 7 years ago

java crypto conditions lib is bundled in *.jar form, because it changed quite a lot in version 3 and these changes are not compatible with the current driver. This eases the handling, but yes, not a very clean way.

tzclucian commented 7 years ago

Thanks for clarifying. Looking forward for a stable version that will be added as a dependency.