Giter Club home page Giter Club logo

cordapp-template-java's Introduction

cordapp-template-java (Corda v5.2)

This template repository provides:

  • A pre-setup Cordapp Project which you can use as a starting point to develop your own prototypes.

  • A base Gradle configuration which brings in the dependencies you need to write and test a Corda 5 Cordapp.

  • A set of Gradle helper tasks, provided by the Corda runtime gradle plugin, which speed up and simplify the development and deployment process.

  • Debug configuration for debugging a local Corda cluster.

  • The MyFirstFlow code which forms the basis of this getting started documentation, this is located in package com.r3.developers.cordapptemplate.flowexample

  • A UTXO example in package com.r3.developers.cordapptemplate.utxoexample packages

  • Ability to configure the Members of the Local Corda Network.

To find out how to use the template, please refer to the CorDapp Template subsection within the Developing Applications section in the latest Corda 5 documentation at https://docs.r3.com/

Prerequisite

  1. Java 17
  2. Corda-cli (v5.2), Download here. You need to install Java 17 first.
  3. Docker Desktop

Setting up

  1. We will begin our test deployment with clicking the startCorda. This task will load up the combined Corda workers in docker. A successful deployment will allow you to open the REST APIs at: https://localhost:8888/api/v5_2/swagger#. You can test out some of the functions to check connectivity. (GET /cpi function call should return an empty list as for now.)
  2. We will now deploy the cordapp with a click of vNodeSetup task. Upon successful deployment of the CPI, the GET /cpi function call should now return the meta data of the cpi you just upload

Flow Management Tool[Optional]

We had developed a simple GUI for you to interact with the cordapp. You can access the website by using https://localhost:5000 or https://127.0.0.1:5000. The Flow Management Tool will automatically connect with the CorDapp running locally from your Corda cluster. You can test the connection by click on the dropdown list at the Flow Initiator section. You should be able to see the vNodes of your started CorDapp. You can easily trigger and query a Corda flow.

image

Running the Chat app

We have built a simple one to one chat app to demo some functionalities of the next gen Corda platform.

In this app you can:

  1. Create a new chat with a counterparty. CreateNewChatFlow
  2. List out the chat entries you had. ListChatsFlow
  3. Individually query out the history of one chat entry. GetChatFlowArgs
  4. Continue chatting within the chat entry with the counterparty. UpdateChatFlow

Running the chat app

In Corda 5, flows will be triggered via POST /flow/{holdingidentityshorthash} and flow result will need to be view at GET /flow/{holdingidentityshorthash}/{clientrequestid}

  • holdingidentityshorthash: the id of the network participants, ie Bob, Alice, Charlie. You can view all the short hashes of the network member with another gradle task called listVNodes
  • clientrequestid: the id you specify in the flow requestBody when you trigger a flow.

Step 1: Create Chat Entry

Pick a VNode identity to initiate the chat, and get its short hash. (Let's pick Alice. Dont pick Bob because Bob is the person who we will have the chat with).

Go to POST /flow/{holdingidentityshorthash}, enter the identity short hash(Alice's hash) and request body:

{
    "clientRequestId": "create-1",
    "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.CreateNewChatFlow",
    "requestBody": {
        "chatName":"Chat with Bob",
        "otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB",
        "message": "Hello Bob"
        }
}

After trigger the create-chat flow, hop to GET /flow/{holdingidentityshorthash}/{clientrequestid} and enter the short hash(Alice's hash) and clientrequestid to view the flow result

Step 2: List the chat

In order to continue the chat, we would need the chat ID. This step will bring out all the chat entries this entity (Alice) has. Go to POST /flow/{holdingidentityshorthash}, enter the identity short hash(Alice's hash) and request body:

{
    "clientRequestId": "list-1",
    "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.ListChatsFlow",
    "requestBody": {}
}

After trigger the list-chats flow, again, we need to hop to GET /flow/{holdingidentityshorthash}/{clientrequestid} and check the result. As the screenshot shows, in the response body, we will see a list of chat entries, but it currently only has one entry. And we can see the id of the chat entry. Let's record that id.

Step 3: Continue the chat with UpdateChatFlow

In this step, we will continue the chat between Alice and Bob. Goto POST /flow/{holdingidentityshorthash}, enter the identity short hash and request body. Note that here we can have either Alice or Bob's short hash. If you enter Alice's hash, this message will be recorded as a message from Alice, vice versa. And the id field is the chat entry id we got from the previous step.

{
    "clientRequestId": "update-1",
    "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.UpdateChatFlow",
    "requestBody": {
        "id":" ** fill in id **",
        "message": "How are you today?"
        }
}

And as for the result of this flow, go to GET /flow/{holdingidentityshorthash}/{clientrequestid} and enter the required fields.

Step 4: See the whole chat history of one chat entry

After a few back and forth of the messaging, you can view entire chat history by calling GetChatFlow.

{
    "clientRequestId": "get-1",
    "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.GetChatFlow",
    "requestBody": {
        "id":" ** fill in id **",
        "numberOfRecords":"4"
    }
}

And as for the result, you need to go to the Get API again and enter the short hash and client request ID.

Thus, we have concluded a full run through of the chat app.

cordapp-template-java's People

Contributors

adagys avatar agoldvarg avatar andr3ej avatar anixon604 avatar anthonykeenan avatar anton-subbotin avatar ashutoshmeher-r3 avatar chrisr3 avatar clintonio avatar cxyzhang0 avatar davidawad avatar davidleeuk avatar elenduuche avatar exfalso avatar florian-f avatar igornitto avatar jxilt avatar kasiastreich avatar mikehearn avatar pavelnenov-r3 avatar peterli-r3 avatar relyafi avatar rick-r3 avatar rogersanick avatar shamsasari avatar suhas-srivastava avatar szymonsztuka avatar tb-pq avatar wzur-r3 avatar zkiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordapp-template-java's Issues

System hangs when running nodes

Below is the configuration of my system on which am trying to run Cordapp:
RAM: 8 GB
OS: Ubuntu 18.04.1 LTS
Processor: Intel® Core™ i3-3220 CPU @ 3.30GHz × 4
Graphics: Intel® Ivybridge Desktop
OS Type: 64-bit

I am following the steps to run Cordapp from Below:
Cordapp Java Template

My computer system hangs when I try to run below command.

./runnodes

What is the recommended system requirement to run a Cordapp?
If my system should be fine running a Cordapp, then what might be getting wrong which is hanging my system?

Please help as am new to Cordapp and running it for very first time.

Cordapp net.corda:corda-finance-contracts:4.1-RC01 not found in cordapps configuration.

Cleared all the compilation errors and now am stuck with the following errors when using both 4.0 and 4.1.RC01 as corda release version in the build.gradle file. Can someone please help?

Cordapp net.corda:corda-finance-contracts:4.1-RC01 not found in cordapps configuration

Cordapp net.corda:corda-finance-contracts:4.0 not found in cordapps configuration

Error: Could not find or load main class net.corda.node.Corda

Running the command on windows 10 - .\gradlew clean deployNodes throws an error - Error: Could not find or load main class net.corda.node.Corda
Logs are shared below, I tried to find any resolution on some blogs but all get in vain.

PS C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\templates\cordapp-template-java> .
\gradlew clean deployNodes

> Task :jar
Cordapp metadata not defined for this gradle build file. See https://docs.corda.net/head/cordapp-build-sys
tems.html#separation-of-cordapp-contracts-flows-and-services

> Task :deployNodes  
Running Cordform task
Deleting C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\templates\cordapp-template-j
ava\build\nodes
Bootstrapping local test network in C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\t
emplates\cordapp-template-java\build\nodes
Generating node directory for Notary
Generating node directory for PartyA
Generating node directory for PartyB
Waiting for all nodes to generate their node-info files...

#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\PartyA\logs ####
Error: Could not find or load main class net.corda.node.Corda
#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\Notary\logs ####
Error: Could not find or load main class net.corda.node.Corda     
#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\PartyB\logs ####
Error: Could not find or load main class net.corda.node.Corda     

> Task :deployNodes FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':deployNodes'.
> Error while generating node info file. Please check the logs in C:\Users\48013\Desktop\Backup\Tarun\TSG\
Sample Apps\Blockchain\Corda\templates\cordapp-template-java\build\nodes\PartyA\logs.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log out
put. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 24s
15 actionable tasks: 14 executed, 1 up-to-date

token-template branch: Gradle could not resolve 1.1-SNAPSHOT

I cloned this repo and switched to the token-template branch; when I open the project with IntelliJ and Gradle runs; it shows this:

Could not resolve: com.r3.corda.lib.tokens:tokens-contracts:1.1-SNAPSHOT
Could not resolve: com.r3.corda.lib.tokens:tokens-workflows:1.1-SNAPSHOT
Could not resolve: com.r3.corda.lib.tokens:tokens-money:1.1-SNAPSHOT

I can resolve it by switching to 1.0-RC03 inside build.gradle:

tokens_release_version = '1.0-RC03'

Incorrect mainClassName in build.gradle

Hi,

It seems that the value of mainClassName in subproject "clients" build.gradle(line 29) is incorrect. I think it should be "com.template.webserver.Starter" instead of "com.template.webserver.Server", right?

Thanks.

Git Repository path mentioned under How to Use Token SDK is not correct.

GIT repository path mentioned under How to use the SDK Section is not correct.

The Mentioned path is for kotlin cordapp template repository rather than java cordapp template repository.

Mentioned Git Clone Command:-

git clone http://github.com/corda/cordapp-template-kotlin
cd cordapp-template-java

Should be Changed to:-

git clone http://github.com/corda/cordapp-template-java
cd cordapp-template-java

Error: net.corda.core.contracts.AttachmentResolutionException

To reproduce the error:

  1. Clone this repository.
  2. Checkout the token-template branch
  3. Run the below test using ./gradlew test
public class FlowTests {
    private final MockNetwork network = new MockNetwork(ImmutableList.of(
            "com.template.contracts", "com.template.flows",
            "com.r3.corda.lib.tokens.money",
            "com.r3.corda.lib.tokens.contracts",
            "com.r3.corda.lib.tokens.workflows",
            "com.r3.corda.lib.tokens.testing"));
    private final StartedMockNode exchangeNode = network.createNode();
    private final Party exchange = exchangeNode.getInfo().getLegalIdentities().get(0);

    @Before
    public void setup() {
        network.runNetwork();
    }

    @After
    public void tearDown() {
        network.stopNodes();
    }

    @Test
    public void dummyTest() throws ExecutionException, InterruptedException {
        ExampleFlowWithFixedToken issueFlow = new ExampleFlowWithFixedToken("USD", 1000L, exchange);
        Future<SignedTransaction> future = exchangeNode.startFlow(issueFlow);
        network.runNetwork();
        SignedTransaction tx = future.get();
        System.out.print(tx);
    }
}

AMQ119031: Unable to validate user error

I am trying to create a CordApp using the cordapp-template-java as a base project. When I run the template server I get the following exception:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller' defined in file [/Users/jphillips/git/coastal-waste-smart-contract/cordapp/clients/build/classes/java/main/com/template/webserver/Controller.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeRPCConnection': Invocation of init method failed; nested exception is ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user from /127.0.0.1:62172. Username: user1; SSL certificate subject DN: unavailable]

Below are the commands and output I get leading up to this:
Deploying the Nodes

./gradlew deployNodes

> Task :deployNodes
Running Cordform task
Deleting /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes
Bootstrapping local test network in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes
Generating node directory for Notary
Generating node directory for Membership
Generating node directory for WasteRecycler
Generating node directory for WasteCollector
Waiting for all nodes to generate their node-info files...

... still waiting. If this is taking longer than usual, check the node logs.

> Task :deployNodes
Distributing all node-info files to all nodes
Loading existing network parameters... none found
Gathering notary identities
Generating contract implementations whitelist
New NetworkParameters {
      minimumPlatformVersion=6
      notaries=[NotaryInfo(identity=O=Notary, L=London, C=GB, validating=false)]
      maxMessageSize=10485760
      maxTransactionSize=524288000
      whitelistedContractImplementations {
        
      }
      eventHorizon=PT720H
      packageOwnership {
        
      }
      modifiedTime=2020-05-24T21:17:50.057Z
      epoch=1
  }
Bootstrapping complete!

BUILD SUCCESSFUL in 47s
11 actionable tasks: 4 executed, 7 up-to-date

Building the Nodes

./build/nodes/runnodes --headless
Starting nodes in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes
Starting corda.jar in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteCollector on debug port 5005
Node will expose jolokia monitoring port on 7005
Running command: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/bin/java -Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7005,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter -Dname=WasteCollector -jar /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteCollector/corda.jar
Starting corda.jar in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Notary on debug port 5006
Node will expose jolokia monitoring port on 7006
Running command: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/bin/java -Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7006,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter -Dname=Notary -jar /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Notary/corda.jar
Starting corda.jar in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteRecycler on debug port 5007
Node will expose jolokia monitoring port on 7007
Running command: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/bin/java -Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5007 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7007,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter -Dname=WasteRecycler -jar /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteRecycler/corda.jar
No file corda.jar found in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/.cache
Starting corda.jar in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Membership on debug port 5008
Node will expose jolokia monitoring port on 7008
Running command: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/bin/java -Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7008,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter -Dname=Membership -jar /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Membership/corda.jar
Started 4 processes
Finished starting nodes
Listening for transport dt_socket at address: 5005
➜  cordapp git:(master) ✗ Jolokia: Agent started with URL http://127.0.0.1:7005/jolokia/

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/         Change is inevitable, except
/ /___  /_/ / /  / /_/ / /_/ /          from a vending machine.
\____/     /_/   \__,_/\__,_/

--- Corda Open Source 4.4 (21e8c4f) -------------------------------------------------------------


Logs can be found in                    : /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteCollector/logs
Listening for transport dt_socket at address: 5006
Listening for transport dt_socket at address: 5008
Listening for transport dt_socket at address: 5007
Jolokia: Agent started with URL http://127.0.0.1:7007/jolokia/
Jolokia: Agent started with URL http://127.0.0.1:7006/jolokia/
Jolokia: Agent started with URL http://127.0.0.1:7008/jolokia/
⚠️   ATTENTION: This node is running in development mode! 👩‍💻   This is not safe for production deployment.

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/         A bus stops at a bus station. A train stops at a
/ /___  /_/ / /  / /_/ / /_/ /          train station. What happens at a workstation?
\____/     /_/   \__,_/\__,_/

--- Corda Open Source 4.4 (21e8c4f) -------------------------------------------------------------


Logs can be found in                    : /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Notary/logs

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/         Old bankers never die, they
/ /___  /_/ / /  / /_/ / /_/ /          just... pass the buck
\____/     /_/   \__,_/\__,_/

--- Corda Open Source 4.4 (21e8c4f) -------------------------------------------------------------


Logs can be found in                    : /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/Membership/logs

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/         I named my dog 'Six Miles' so I can tell
/ /___  /_/ / /  / /_/ / /_/ /          people I walk Six Miles every day.
\____/     /_/   \__,_/\__,_/

--- Corda Open Source 4.4 (21e8c4f) -------------------------------------------------------------


Logs can be found in                    : /Users/jphillips/git/coastal-waste-smart-contract/cordapp/build/nodes/WasteRecycler/logs
⚠️   ATTENTION: This node is running in development mode! 👩‍💻   This is not safe for production deployment.
⚠️   ATTENTION: This node is running in development mode! 👩‍💻   This is not safe for production deployment.
⚠️   ATTENTION: This node is running in development mode! 👩‍💻   This is not safe for production deployment.
Advertised P2P messaging addresses      : localhost:10040
RPC connection address                  : localhost:10041
RPC admin connection address            : localhost:10044
Advertised P2P messaging addresses      : localhost:10030
RPC connection address                  : localhost:10031
RPC admin connection address            : localhost:10043
Advertised P2P messaging addresses      : localhost:10050
RPC connection address                  : localhost:10051
RPC admin connection address            : localhost:10045
Advertised P2P messaging addresses      : localhost:10020
RPC connection address                  : localhost:10021
RPC admin connection address            : localhost:10042
Loaded 2 CorDapp(s)                     : Contract CorDapp: Template CorDapp version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, Workflow CorDapp: Template Flows version 1 by vendor Corda Open Source with licence Apache License, Version 2.0
Node for "WasteCollector" started up and registered in 43.01 sec
Running P2PMessaging loop
Loaded 2 CorDapp(s)                     : Contract CorDapp: Template CorDapp version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, Workflow CorDapp: Template Flows version 1 by vendor Corda Open Source with licence Apache License, Version 2.0
Node for "Membership" started up and registered in 41.84 sec
Running P2PMessaging loop
Loaded 2 CorDapp(s)                     : Contract CorDapp: Template CorDapp version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, Workflow CorDapp: Template Flows version 1 by vendor Corda Open Source with licence Apache License, Version 2.0
Node for "WasteRecycler" started up and registered in 41.89 sec
Running P2PMessaging loop
Loaded 2 CorDapp(s)                     : Contract CorDapp: Template CorDapp version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, Workflow CorDapp: Template Flows version 1 by vendor Corda Open Source with licence Apache License, Version 2.0
Node for "Notary" started up and registered in 42.27 sec
Running P2PMessaging loop

Running the Template Server

./gradlew -b ./clients/build.gradle runTemplateServer

> Task :clients:runTemplateServer
I 22:18:59 1 Starter.logStarting - Starting Starter on Justins-MBP-4.lan with PID 30159 (/Users/jphillips/git/coastal-waste-smart-contract/cordapp/clients/build/classes/java/main started by jphillips in /Users/jphillips/git/coastal-waste-smart-contract/cordapp/clients)
I 22:18:59 1 Starter.logStartupProfileInfo - No active profile set, falling back to default profiles: default
I 22:18:59 1 AnnotationConfigServletWebServerApplicationContext.prepareRefresh - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@4816278d: startup date [Sun May 24 22:18:59 BST 2020]; root of context hierarchy
   I 22:19:00 1 TomcatWebServer.initialize - Tomcat initialized with port(s): 10050 (http)
<==I 22:19:00 1 Http11NioProtocol.log - Initializing ProtocolHandler ["http-nio-10050"]
I 22:19:00 1 StandardService.log - Starting service [Tomcat]
I 22:19:00 1 StandardEngine.log - Starting Servlet Engine: Apache Tomcat/8.5.31
I 22:19:00 14 AprLifecycleListener.log - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/jphillips/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
   I 22:19:00 14 [/].log - Initializing Spring embedded WebApplicationContext
I 22:19:00 14 ContextLoader.prepareWebApplicationContext - Root WebApplicationContext: initialization completed in 1302 ms
> :I 22:19:00 14 ServletRegistrationBean.addRegistration - Servlet dispatcherServlet mapped to [/]
I 22:19:00 14 FilterRegistrationBean.configure - Mapping filter: 'characterEncodingFilter' to: [/*]
I 22:19:00 14 FilterRegistrationBean.configure - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
I 22:19:00 14 FilterRegistrationBean.configure - Mapping filter: 'httpPutFormContentFilter' to: [/*]
I 22:19:00 14 FilterRegistrationBean.configure - Mapping filter: 'requestContextFilter' to: [/*]
   I 22:19:12 1 RPCClient.logElapsedTime - Failed Startup took 10941 msec
W 22:19:12 1 AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller' defined in file [/Users/jphillips/git/coastal-waste-smart-contract/cordapp/clients/build/classes/java/main/com/template/webserver/Controller.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeRPCConnection': Invocation of init method failed; nested exception is ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user from /127.0.0.1:62172. Username: user1; SSL certificate subject DN: unavailable]
I 22:19:12 1 StandardService.log - Stopping service [Tomcat]
   I 22:19:12 1 ConditionEvaluationReportLoggingListener.logAutoConfigurationReport - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
E 22:19:12 1 SpringApplication.reportFailure - Application run failed
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller' defined in file [/Users/jphillips/git/coastal-waste-smart-contract/cordapp/clients/build/classes/java/main/com/template/webserver/Controller.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeRPCConnection': Invocation of init method failed; nested exception is ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user from /127.0.0.1:62172. Username: user1; SSL certificate subject DN: unavailable]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1274) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1131) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
        at com.template.webserver.Starter.main(Starter.java:21) [main/:?]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeRPCConnection': Invocation of init method failed; nested exception is ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user from /127.0.0.1:62172. Username: user1; SSL certificate subject DN: unavailable]
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:138) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        ... 17 more
Caused by: org.apache.activemq.artemis.api.core.ActiveMQSecurityException: AMQ119031: Unable to validate user from /127.0.0.1:62172. Username: user1; SSL certificate subject DN: unavailable
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:423) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:319) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.createSessionContext(ActiveMQClientProtocolManager.java:288) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.createSessionContext(ActiveMQClientProtocolManager.java:237) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSessionChannel(ClientSessionFactoryImpl.java:1320) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:674) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:299) ~[artemis-core-client-2.6.2.jar:2.6.2]
        at net.corda.client.rpc.internal.RPCClientProxyHandler.initSessions(RPCClientProxyHandler.kt:574) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.internal.RPCClientProxyHandler.start(RPCClientProxyHandler.kt:255) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:93) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:32) ~[corda-rpc-4.4.jar:?]
        at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:223) ~[corda-core-4.4.jar:?]
        at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:213) ~[corda-core-4.4.jar:?]
        at net.corda.client.rpc.internal.RPCClient.start(RPCClient.kt:72) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:620) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:575) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:529) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.CordaRPCClient.start$default(CordaRPCClient.kt:527) ~[corda-rpc-4.4.jar:?]
        at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt) ~[corda-rpc-4.4.jar:?]
        at com.template.webserver.NodeRPCConnection.initialiseNodeRPCConnection(NodeRPCConnection.java:40) ~[main/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:308) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:135) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
        ... 17 more

> Task :clients:runTemplateServer FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':clients:runTemplateServer'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
11 actionable tasks: 4 executed, 7 up-to-date

The only thing I have changed from the cordapp-template-java project is I have changed the nodes in the top level build.grade file:

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
    nodeDefaults {
        projectCordapp {
            deploy = false
        }
        cordapp project(':contracts')
        cordapp project(':workflows')
    }
    node {
        name "O=Notary,L=London,C=GB"
        notary = [validating : false]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10043")
        }
    }
    node {
        name "O=PartyA,L=London,C=GB"
        p2pPort 10005
        rpcSettings {
            address("localhost:10006")
            adminAddress("localhost:10046")
        }
        rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
    node {
        name "O=PartyB,L=New York,C=US"
        p2pPort 10008
        rpcSettings {
            address("localhost:10009")
            adminAddress("localhost:10049")
        }
        rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
    }

}

If I run the same commands in the cordapp-template-java project I don't get the security exception, so I must have to perform another step if I am to add new nodes? Do I need to generate new SSL certificates for the new nodes?

Failed to apply plugin 'net.corda.plugins.cordapp'

I cloned cordapp-template-java using the below link.
https://github.com/corda/cordapp-template-java.git
Branch - release-V4

1) I executed gradle build/clean from IntelliJ gradle sidebar. It's failing with below error stack.

Build file 'D:\blockchain\build.gradle' line: 60

Failed to apply plugin 'net.corda.plugins.cordapp'.
Collection contains no element matching the predicate.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

2) Executed gradle command with --stacktrace.

  • Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'net.corda.plugins.cordapp'

  • Caused by: java.util.NoSuchElementException: Collection contains no element matching the predicate.

Bin files in Workflows module

In the Release 4 Version of the Template in Module ‚Workflow‘ there are bin/*.class committed

Updated 15days ago

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.