当我使用 maven 和嵌入式 AVM 调用合同时,我收到以下消息:
[ERROR] Failed to execute goal org.aion4j:aion4j-maven-plugin:0.5.0-beta1:call (default-cli) on project supercontract: Method call failed: InvocationTargetException: Dapp call failed. Code: FAILED, Reason: null -> [Help 1]
我刚刚编辑了HelloAvM
您mvn initialize
在项目时获得的合同。这是整个合同:
public class HelloAvm {
// Voting App
// 1. Users call a function to find out what the question is.
// 2. They then call another function with their choice.
// 3. Any use can call the results() function to find out what the current votes are.
public static int questionNumber = 1;
public static String questionString = "Is Haggis a real animal?";
public String getQuestion() {
return "Question #" + questionNumber + ": " + questionString;
}
public void testContract() {
// This function just returns a string to show that the contract is working.
BlockchainRuntime.println("This contract is working.");
}
public static byte[] main() {
return ABIDecoder.decodeAndRunWithClass(HelloAvm.class, BlockchainRuntime.getData());
}
}
我不确定它为什么会失败,并且错误消息没有多大用处。我查看了 StackOverflow 上的其他 InvocationTargetException 错误,但它们似乎对这个问题没有帮助。