Working example of a Java SDK Code for Fabric Commercial Paper example


Rajeev Kuppadakath
 

Hi,
I am new to this so sorry to ask this basic question. I am going through the examples provided in the fabric-samples package. The network is up and running and also I can run the JavaScript version of the code to 'issue' an asset which is kept ../application/issue.js - which is working fine
However trying to do the same in the application-java/src../../Issue.java, but getting exception like below
Do you have a working Java SDK version of this code somewhere where I can look into? The Java sdk version comes along with this example uses 2.1.0 , is that the latest or do I need to get a new one?

thanks for your help 

regards
Rajeev

Use network channel: mychannel.
Use org.papernet.commercialpaper smart contract.
Submit commercial paper issue transaction.
Exception in thread "main" org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org2.example.com.  Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: e2fd766ac0c8ef3f0601bdd67570aa808d3f43709ee509ea2235ec87a6d8cbad to Peer{ id: 2, name: peer0.org2.example.com, channelName: mychannel, url: grpcs://localhost:9051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org2MSP], cause=null}
        at


Chris Gabriel
 

Hi Rajeev,
In the test-network directory, try running

 ./network.sh down 

Then retry the Java sample.  Hope this helps,
Chris


On Apr 18, 2021, at 1:12 PM, Rajeev Kuppadakath <kuppadakath@...> wrote:


Hi,
I am new to this so sorry to ask this basic question. I am going through the examples provided in the fabric-samples package. The network is up and running and also I can run the JavaScript version of the code to 'issue' an asset which is kept ../application/issue.js - which is working fine
However trying to do the same in the application-java/src../../Issue.java, but getting exception like below
Do you have a working Java SDK version of this code somewhere where I can look into? The Java sdk version comes along with this example uses 2.1.0 , is that the latest or do I need to get a new one?

thanks for your help 

regards
Rajeev

Use network channel: mychannel.
Use org.papernet.commercialpaper smart contract.
Submit commercial paper issue transaction.
Exception in thread "main" org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org2.example.com.  Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: e2fd766ac0c8ef3f0601bdd67570aa808d3f43709ee509ea2235ec87a6d8cbad to Peer{ id: 2, name: peer0.org2.example.com, channelName: mychannel, url: grpcs://localhost:9051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org2MSP], cause=null}
        at