fabric 2.4 invoke asset-transfer-basic/chaincode-java got "Undefined contract called"
I follow the tutorial:
run "./network.sh up createChannel" run "./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-java -ccl java -cci InitLedger"
then got error:
Error: endorsement failure during invoke. response: status:500 message:"Undefined contract called"

anyone can help me
@weiminw On the example it does not mention to add -cci initLedger, please have a look here: https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html or on https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic, section Running the sample, step 2. BTW if you have a look in the ticket I have raised: https://github.com/hyperledger/fabric-samples/issues/747 the issue will be another for this example.
I believe your error is due to using the --isInit flag when invoking the transaction function. The legacy intialisation mechanism is deprecated and its use is discouraged.
I don't see exactly the error as you but, using Fabric v3.0.0 and the --isInit flag for the peer chaincode invoke command, I get this error:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 9d847bfdd3012b5bb571cc6da3096c0d95401ec5bb1bc287c1286ee6de4c9103: invalid invocation: chaincode 'basic' does not require initialization but called as init"
Running exactly the same command but with the --isInit flag removed, the invocation is successful.