用于天然气价格的资金不足+;Java错误中的值

用于天然气价格的资金不足+;Java错误中的值,java,oracle,transactions,blockchain,solidity,Java,Oracle,Transactions,Blockchain,Solidity,当我在区块链上添加交易时部署合同,它会给出错误 private static final Web3j web3j = Web3j.build(new HttpService("HTTPS://ropsten.infura.io/v3/d11459c1c17049628f462a1492c7df36")); private static final Credentials hostCredentials = Credentials.create("666A82FC33F8134577A7BEB1

当我在区块链上添加交易时部署合同,它会给出错误

private static final Web3j web3j = Web3j.build(new HttpService("HTTPS://ropsten.infura.io/v3/d11459c1c17049628f462a1492c7df36"));

private static final Credentials hostCredentials = Credentials.create("666A82FC33F8134577A7BEB1BDEAA689BB72740178727691D63032432B83E0FB");

private static final BigInteger gasLimit = BigInteger.valueOf(4712388L);
private static final BigInteger gasPrice =  BigInteger.valueOf(20000000000L);

 public String depart_wallet(String code) {
    String walletCode = "";
    switch(code) {
        case "ct_01" : 
                walletCode = "83E094366642F531189D56DF33AC870DB53AF8C7F7F60A7A8B20CB85BC43A59F";
                break;
        case "ft_01" :
                walletCode = "666A82FC33F8134577A7BEB1BDEAA689BB72740178727691D63032432B83E0FB";
                break;
        case "ms_01" :
                walletCode = "3F0B5C58378DE554534A5A8C630AAC075886E74A6B3229000AE78F4500E153E3";
                break;
        case "st_01" :
                walletCode = "3B69CC479DBAC9B02D2B7C39F7829A2E5DF850203A1766355D854DD89FCC6848";
                break;
        case "hr_01" :
                walletCode = "3F1E2BD4EF8941731D244359F0CDF1EF079E5EAFFD57EA6D31ADDEB55E20D426";
                break;
        case "mf_01" :
                walletCode = "C6FD20908CDC2326A8A5E366228C149FA7632E9C4EF035F5B7EBEE1A04158B7E";
                break;

    }
    return walletCode;
}
我将从网络上获取代码

并通过上述方法发送,获取钱包地址并部署

public void budgetAdd(HttpServletRequest req, Model model) throws Exception {

    String department_code = req.getParameter("dept_code");

    String deptWallet = depart_wallet(department_code);

    Credentials dept_AccountNumber = Credentials.create(deptWallet);

    String contractAddress2 = Materal.deploy(web3j, dept_AccountNumber, gasPrice, gasLimit).send().getContractAddress();

    int price = Integer.parseInt(req.getParameter("money"));
    BigInteger ethers = null;

    if(price < 100000) {
        ethers = etherToWei(new BigDecimal(1));
    }
    else if((100000 < price) && (price < 300000)) {
        ethers = etherToWei(new BigDecimal(1.25));
    }
    else if ((300000 < price) && (price < 500000)) {
        ethers = etherToWei(new BigDecimal(1.5));
    }
    else if ((500000 < price) && (price < 800000)) {
        ethers = etherToWei(new BigDecimal(1.8));
    }
    else if ((800000 < price) && (price < 1000000)) {
        ethers = etherToWei(new BigDecimal(2));
    }
    else {
        ethers = etherToWei(new BigDecimal(2.25));
    }

    byte[] name = stringToBytes32(department_code);

    Materal dept = Materal.load(contractAddress2, web3j, hostCredentials, gasPrice, gasLimit);
    String hash = dept.buyMaterial(new BigInteger("0"), name, ethers).send().getTransactionHash();

    String purpose = req.getParameter("purpose");

    HashVO vos = new HashVO();
    vos.setDepartment_code(department_code);
    vos.setE_subject(purpose);
    vos.setE_hashcode(hash);

    int insertCnt = dao.insertLog(vos);
    if(insertCnt == 1) {
        System.out.println("등록되었습니다.");
    }
}
public void budgettad(HttpServletRequest-req,Model-Model)引发异常{
字符串department_code=req.getParameter(“depart_code”);
String deptWallet=离开钱包(部门代码);
凭证部门\ U AccountNumber=凭证。创建(deptWallet);
String contractAddress2=Materal.deploy(web3j,dept_AccountNumber,gasPrice,gasLimit).send().getContractAddress();
intprice=Integer.parseInt(请求getParameter(“money”);
BigInteger ethers=null;
如果(价格<100000){
ethers=etherToWei(新的大十进制数(1));
}
否则,如果((100000<价格)和&(价格<300000)){
ethers=etherToWei(新的BigDecimal(1.25));
}
否则,如果((300000<价格)和&(价格<500000)){
ethers=etherToWei(新的BigDecimal(1.5));
}
否则,如果((500000<价格)和&(价格<800000)){
ethers=etherToWei(新的大十进制数(1.8));
}
否则如果((800000<价格)和&(价格<1000000)){
ethers=etherToWei(新的大十进制数(2));
}
否则{
ethers=etherToWei(新的大十进制数(2.25));
}
字节[]名称=StringToBytes 32(部门代码);
物料部门=物料负荷(合同地址2、web3j、主机凭证、gasPrice、gasLimit);
String hash=dept.buyMaterial(新的BigInteger(“0”),名称,以太);
字符串用途=请求获取参数(“用途”);
HashVO vos=新的HashVO();
vos.设置部门代码(部门代码);
vos.setE_主题(目的);
vos.setE_哈希代码(哈希);
int insertCnt=dao.insertLog(vos);
如果(insertCnt==1){
System.out.println(“등록되었습니다.");
}
}
我想部署并完成,插入到我的Oracle中。 但我的代码无法部署

也许气体极限很低? 但是,当GasLimit更改为6721975时,发生了相同的错误


昨天它正常工作,没有错误,但现在它不工作。你能给我一个关于这个错误的答案吗?

当你问你“出错”的问题时,你总是需要清楚地告诉我们这些错误。另外,请花些时间读一读。“昨天它正常工作,没有错误,但现在它不工作。”“-那么,昨天以来发生了什么变化?昨天发生错误后,gasLimit为4712388L。我更改了6721975。除gasLimit外,没有修改的代码。”。