EOSIO / eosio-java

EOSIO SDK for Java - API for integrating with EOSIO-based blockchains
https://eosio.github.io/eosio-java/
MIT License
127 stars 44 forks source link

"org.bouncycastle.math.ec.ECCurve$AbstractFp"'s signer information does not match signer information of other classes in the same package #136

Closed chencore closed 3 years ago

chencore commented 3 years ago

What is the reason for this error when calling a contract on the server side using the official EOSIO SDK for java? code: `public Object testpushaction2() { try { IRPCProvider rpcProvider = new EosioJavaRpcProviderImpl(chainUrl + "/v1/"); ISerializationProvider serializationProvider = new AbiEosSerializationProviderImpl(); IABIProvider abiProvider = new ABIProviderImpl(rpcProvider, serializationProvider); ISignatureProvider signatureProvider = new SoftKeySignatureProviderImpl();

        try {
            ((SoftKeySignatureProviderImpl) signatureProvider).importKey(activePrivateKey);
        } catch (ImportKeyError importKeyError) {
            importKeyError.printStackTrace();
            return null;
        }
        TransactionSession session = new TransactionSession(
                serializationProvider,
                rpcProvider,
                abiProvider,
                signatureProvider
        );

        TransactionProcessor processor = session.getTransactionProcessor();
        TransactionConfig transactionConfig = processor.getTransactionConfig();
        transactionConfig.setUseLastIrreversible(false);
        transactionConfig.setExpiresSeconds(600);
        processor.setTransactionConfig(transactionConfig);
        String jsonData = "{\n" +
                "\"user\": \"nami55555552\"\n" +
                "}";

        List<Authorization> authorizations = new ArrayList<>();
        authorizations.add(new Authorization(account, "active"));
        List<Action> actions = new ArrayList<>();
        actions.add(new Action(account, "walletdata", authorizations, jsonData));

        processor.prepare(actions);

        SendTransactionResponse sendTransactionResponse = processor.signAndBroadcast();

        ArrayList<Object> actionReturnValues = sendTransactionResponse.getActionValues();
        System.out.println(actionReturnValues);
        return actionReturnValues;
    }catch(Exception ex) {
        ex.printStackTrace();
        return 0;
    }
}

`

pom.xml:

`

one.block
        <artifactId>eosio-java-rpc-provider</artifactId>
        <version>1.0.0</version>
    </dependency>
one.block eosiojava 1.0.0
    <dependency>
        <groupId>one.block</groupId>
        <artifactId>eosio-java-abieos-serialization-provider</artifactId>
        <version>1.0.0</version>
    </dependency>

    <dependency>
        <groupId>one.block</groupId>
        <artifactId>eosiojavasoftkeysignatureprovider</artifactId>
        <version>1.0.0</version>
    </dependency>`

error message: java.lang.SecurityException: class "org.bouncycastle.math.ec.ECCurve$AbstractFp"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:898) ~[na:1.8.0_151] at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668) ~[na:1.8.0_151] at java.lang.ClassLoader.defineClass(ClassLoader.java:761) ~[na:1.8.0_151] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_151] at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_151] at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_151] at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_151] at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_151] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_151] at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_151] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_151] at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_151] at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_151] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_151] at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_151] at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_151] at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_151] at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_151] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_151] at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_151] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_151] at org.bouncycastle.crypto.ec.CustomNamedCurves.<clinit>(Unknown Source) ~[bcprov-jdk15on-1.61.jar:1.61.0] at one.block.eosiojava.utilities.EOSFormatter.<clinit>(EOSFormatter.java:159) ~[eosiojava-1.0.0.jar:na] at one.block.eosiosoftkeysignatureprovider.SoftKeySignatureProviderImpl.importKey(SoftKeySignatureProviderImpl.java:95) ~[eosiojavasoftkeysignatureprovider-1.0.0.jar:na] at com.famouscall.hxsz.controller.HomeController.testpushaction2(HomeController.java:141) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.36.jar:9.0.36] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.36.jar:9.0.36]