mirror of
https://github.com/corda/corda.git
synced 2025-02-21 09:51:57 +00:00
Document -parameters compiler arg for Java CorDapps. (#1712)
This commit is contained in:
parent
fedc875370
commit
c0b59ef4f0
@ -61,6 +61,14 @@ one node as running the network map service, by putting their name in the ``netw
|
||||
|
||||
.. warning:: When adding nodes, make sure that there are no port clashes!
|
||||
|
||||
If your CorDapp is written in Java, you should also add the following Gradle snippet so that you can pass named arguments to your flows via the Corda shell:
|
||||
|
||||
.. sourcecode:: groovy
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-parameters"
|
||||
}
|
||||
|
||||
Any CorDapps defined in the project's source folders are also automatically registered with all the nodes defined in
|
||||
``deployNodes``, even if the CorDapps are not listed in each node's ``cordapps`` entry.
|
||||
|
||||
@ -86,4 +94,4 @@ run all the nodes at once. Each node in the ``nodes`` folder has the following s
|
||||
|
||||
.. note:: Outside of development environments, do not store your node directories in the build folder.
|
||||
|
||||
If you make any changes to your ``deployNodes`` task, you will need to re-run the task to see the changes take effect.
|
||||
If you make any changes to your ``deployNodes`` task, you will need to re-run the task to see the changes take effect.
|
||||
|
@ -99,6 +99,10 @@ Nested objects can be created using curly braces, as in ``{ a: 1, b: 2}``. This
|
||||
parser is defined for the type you need, for instance, if an API requires a ``Pair<String, Int>``
|
||||
which could be represented as ``{ first: foo, second: 123 }``.
|
||||
|
||||
.. note:: If your CorDapp is written in Java,
|
||||
named arguments won't work unless you compiled using the ``-parameters`` argument to javac.
|
||||
See :doc:`deploying-a-node` for how to specify it via Gradle.
|
||||
|
||||
The same syntax is also used to specify the parameters for RPCs, accessed via the ``run`` command, like this:
|
||||
|
||||
``run registeredFlows``
|
||||
|
@ -30,6 +30,11 @@ Some of the unit tests, and our serialization framework in general, rely on the
|
||||
to Java reflection. Make sure you have specified the ``-parameters`` option to the Java compiler. We attempt to set this globally
|
||||
for gradle and IntelliJ, but it's possible this option is not present in your environment for some reason.
|
||||
|
||||
"No matching constructor found: - [arg0: int, arg1: Party]: missing parameter arg0"
|
||||
***********************************************************************************
|
||||
|
||||
Your CorDapp is written in Java and you haven't specified the ``-parameters`` compiler argument. See :doc:`deploying-a-node` for how it can be done using Gradle.
|
||||
|
||||
IDEA issues
|
||||
-----------
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user