Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在爪哇,用于天然气价格的资金不足;价值_Java_Webdeploy - Fatal编程技术网

Java 在爪哇,用于天然气价格的资金不足;价值

Java 在爪哇,用于天然气价格的资金不足;价值,java,webdeploy,Java,Webdeploy,在连接Ropsten之前,ganache已连接 Gaslimits和GasPrice是当时使用的ganache信息 然而,当我第一次连接到Ropsten时,标题中没有错误 private static final Web3j web3j = Web3j.build(new HttpService("https://ropsten.infura.io/v3/d11459c1c17049628f462a1492c7df36")); private static final Credentials

在连接Ropsten之前,ganache已连接

Gaslimits
GasPrice
是当时使用的ganache信息

然而,当我第一次连接到Ropsten时,标题中没有错误

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(6721975L);
private static final BigInteger gasPrice =  BigInteger.valueOf(2000000000000L);
天然气资金不足*价格+价值

运行
Service deploy()
我遇到了这个问题

如果有人知道这个错误,你能向我解释一下吗

使用方法的
deploy()
时,主题中出现错误


欢迎来到SO。我有一些问题想更好地理解你想做什么。看起来您正在使用Java连接到infura节点?你的代码和ganache一起工作了吗?不幸的是,ganache和测试网络之间存在一些差异。另外,我不确定您所说的“Run Service deploy()”是什么意思,看起来您的链接缺少描述。很抱歉,我重新编写了该代码。你能再看一遍吗,重拍代码?
 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;
    }

 @SuppressWarnings("deprecation")
    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);

        System.out.println(gasPrice);
        System.out.println(gasLimit);

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