Unresolved reference: bind when building Corda - corda

In Corda, I was trying to build the network bootstrapper by running the following command:
./gradlew buildBootstrapperJar
But I got the following error:
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/ByteArrays.kt: (11, 18): Unresolved reference: bind
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/ByteArrays.kt: (179, 39): Unresolved reference: DatatypeConverter
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/ByteArrays.kt: (185, 38): Unresolved reference: DatatypeConverter
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/EncodingUtils.kt: (11, 18): Unresolved reference: bind
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/EncodingUtils.kt: (32, 33): Unresolved reference: DatatypeConverter
e: /Users/anon/Documents/corda/core/src/main/kotlin/net/corda/core/utilities/EncodingUtils.kt: (50, 42): Unresolved reference: DatatypeConverter
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileKotlin'.
> Compilation error. See log for more details
How can I fix this?

This is normally caused by running the wrong JDK version. See the requirements here: https://docs.corda.net/getting-set-up.html#software-requirements.

Related

How to install sbt on Google Cloud compute engine VM?

I go through the steps mentioned in the debian package installation procedure on the official sbt website. These steps work locally on my Ubuntu machine, however the same steps do not work in a Google Cloud Compute Engine VM. When I run sbt, I get the following error:
Getting org.scala-sbt sbt 0.13.8 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;0.13.8
==== local: tried
/home/<homedir>/.ivy2/local/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:
/home/<homedir>/.ivy2/local/org.scala-sbt/sbt/0.13.8/jars/sbt.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom
-- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.8: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.8: not found
Error during sbt execution: Error retrieving required libraries
(see /home/<homedir>/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.8

How to create a new project with activator for Lagom

Just downloaded and installed the last version of the activator (1.3.10) following this guide.
The location where I installed the activator distro is writable and activator-1.3.10/bin was added to my $PATH.
Then, I tried to create a new project like this:
activator new test-project lagom-scala
... but I always get the following errors:
j3d#gonzo:~/Projects$ activator new test-project lagom-scala
Getting com.typesafe.activator activator-launcher 1.3.10 ...
:: problems summary ::
:::: WARNINGS
module not found: com.typesafe.activator#activator-launcher;1.3.10
==== local: tried
/home/j3d/.ivy2/local/com.typesafe.activator/activator-launcher/1.3.10/ivys/ivy.xml
-- artifact com.typesafe.activator#activator-launcher;1.3.10!activator-launcher.jar:
/home/j3d/.ivy2/local/com.typesafe.activator/activator-launcher/1.3.10/jars/activator-launcher.jar
==== activator-launcher-local: tried
file:/opt/activator-1.3.10-minimal/repository/com.typesafe.activator/activator-launcher/1.3.10/ivys/ivy.xml
==== Maven Central: tried
https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.pom
-- artifact com.typesafe.activator#activator-launcher;1.3.10!activator-launcher.jar:
https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.jar
==== typesafe-releases: tried
https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.pom
-- artifact com.typesafe.activator#activator-launcher;1.3.10!activator-launcher.jar:
https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.jar
==== typesafe-ivy-releasez: tried
https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.activator/activator-launcher/1.3.10/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: com.typesafe.activator#activator-launcher;1.3.10: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.3.10/activator-launcher-1.3.10.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.activator/activator-launcher/1.3.10/ivys/ivy.xml
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: com.typesafe.activator#activator-launcher;1.3.10: not found
Error during sbt execution: Error retrieving required libraries
(see /home/j3d/.sbt/boot/update.log for complete log)
Error: Could not retrieve activator-launcher 1.3.10
Any help would be really appreciaded.
Googling further I've found there is an issue on Ubuntu that can be solved as described here. I hope it helps.

sbt inconsistent module descriptor file found

I have some errors in sbt:
[error] (system/*:update) sbt.ResolveException: unresolved dependency: org.apache.ant#ant-compress;1.4: java.text.ParseException: inconsistent module descriptor file found in 'http://central.maven.org/maven2/org/apache/ant/ant-compress/1.4/ant-compress-1.4.pom': bad module name: expected='ant-compress' found='compress-antlib';
the artifact id of ant-compress not same as the module name
how can i figure out this?
does sbt has some configuration to suppress the consistency check?
I have using the method refer to unresolved dependency org.mongodb#bson#2.5, bad organisation in sbt
"com.example.utils" % "example-lang" % "0.0.3-SNAPSHOT" exclude("org.apache.ant", "ant-compress"),
"org.apache.ant" % "ant-compress" % "1.4" from "http://central.maven.org/maven2/org/apache/ant/ant-compress/1.4/ant-compress-1.4.jar",
but some other errors occured:
[error] (system/*:update) sbt.ResolveException: unresolved dependency: org.apache.ant#ant-compress;1.4: configuration not found in org.apache.ant#ant-compress;1.4: 'master(compile)'. Missing configuration: 'comp
ile'. It was required from com.example.utils#example-lang;0.0.2-SNAPSHOT runtime

Where is the origin for the sbt error below?

The problem looks like below:
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;0.13.7
==== local: tried
/home/jiakui/.ivy2/local/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:
/home/jiakui/.ivy2/local/org.scala-sbt/sbt/0.13.7/jars/sbt.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom
-- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.7: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml
Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom
Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.7: not found
Error during sbt execution: Error retrieving required libraries
(see /home/jiakui/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.7
+ exit 1
I finally found a workaround.
Run this at command line:
sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
The issue seems to be related to this one: https://github.com/docker-library/openjdk/issues/19 (at least for me).
It seem, as far as I understand, that this bug can get back at JDK9 =/

Qt based program linked in debug mode but not in release mode

I'm writing a Qt based project using Visual Studio 2008 Compiler . In the debug mode every thing is OK and the program compiled and linked successfully but when I switch to release mode and I start to compile I get this error during linking :
1>Linking...
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
1>release\\MobnaPC.exe : fatal error LNK1120: 1 unresolved externals
But main function has defined!
Thank you in advance

Resources