Closed longdt closed 3 years ago
It seen low develop activity in this repo. I fixed by make a fork.
Thanks
I had the same issue and your fork fixed it for me. Thanks.
I have the same problem under Ubuntu, but not on Windows.
Using @longdt fork all is fine.
It works for me.Thanks very much! @longdt
here is also a PR part of this fix, it will be merged soon https://github.com/web3j/web3j-maven-plugin/pull/89
@gtebrean There is already a PR for this bug but they doesn't merge it #85 So don't hope It will be merged soon. And you should use my fork because this plugin doesn't work with solidity compiler version >= 0.8.10
I have simple solidity contract:
when I run:
mvn web3j:generate-sources -e -X
command I got error:class org.json.simple.JSONArray cannot be cast to class java.lang.String (org.json.simple.JSONArray is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @51dbd6e4; java.lang.String is in module java.base of loader 'bootstrap')
Digging more plugin log, I found some change from result json of solidity compiler 0.8.xSpecifically,
abi
field change data type fromstring
(in version <= 0.7.x) to array (in version 0.8.x), so it cause following code in classJavaClassGeneratorMojo
throws casting exceptionList<AbiDefinition> functionDefinitions = loadContractDefinition(results.get(SolidityCompiler.Options.ABI.getName()));
orString abiJson = contractResult.get(SolidityCompiler.Options.ABI.getName());