HTTP 500 Error Using Java RPC

+1 vote
Hello all,
I am having an issue using RPC to create an asset.
My code is as follows to make the call:
public void testCreatingAsset(){

    ArrayList<Object> params = new ArrayList<>();
    params.add(address);
    params.add("asset1");
    params.add(1000);
    params.add(0.01);
    JSONObject creatingAssetObject = rpcClient.request("issue", params);
}
When the call is made I get the following error:
Server returned HTTP response code: 500 for URL
 
I have tried the following things to either solve or find the cause of the problem:
  • I have tried manually making the call (writing it in the command line) and the call is successful - returning the JSON object
  • Reversed ordering of params ArrayList (adding 0.01 first then 1000 etc...)
    
  • Tried making a different call, I tried "help" with an empty ArrayList and is successful, it returns the JSON object
  • I tried making a sendassettaddress call using RPC and this didn't work either, it seems any calls made with paramaters are failing
    
 
Thanks in advance,
GOMD
asked Mar 24, 2016 by GOMD

1 Answer

+1 vote

If making the call manually works, this looks like it might be an issue with the library you're using. Please try seeing if you can find an option (or add in some code) to make it output the JSON-RPC payload it is sending, and then you can compare that to the output from multichain-cli to find the difference (though the chain_name parameter is optional).

answered Mar 24, 2016 by MultiChain
FYI for anyone who comes accross similar problems, when trying to create an asset which already exists in the network the API I was using (thetransactioncompany JSON RPC2) returns a 500 error. This error also occurs when making a call that is not permitted, for example; trying to create an asset when the node is not permitted to.
...