Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread “main” client.exception.EosApiException: Not Found: unspecified while creating account #46

Open
BhumikaB opened this issue Apr 24, 2019 · 0 comments

Comments

@BhumikaB
Copy link

I am using following of Java code while creating account:

Using Java library

eos-java-rpc-wrapper
adyliu/jeos

Using

Jungle2 testnet

Chain Id of jungle2 testnet:
038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca

The Following java code

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import client.EosApiClientFactory;
import client.EosApiRestClient;
import client.domain.common.transaction.PackedTransaction;
import client.domain.common.transaction.SignedPackedTransaction;
import client.domain.common.transaction.TransactionAction;
import client.domain.common.transaction.TransactionAuthorization;
import client.domain.response.chain.AbiJsonToBin;
import client.domain.response.chain.Block;
import client.domain.response.chain.transaction.PushedTransaction;


public class CreateAccount {
    public static void main(String[] args) {


        EosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance("http://jungle2.cryptolions.io:8888").newRestClient();

        /* Create the json array of arguments */
        Map<String, String> args1 = new HashMap<>(4);
        args1.put("from", "abontester12"); // SENDER (MY PRE-GENERATED EOS ACCOUNT)
        args1.put("to", "eosio"); // RECEIVER
        args1.put("quantity", "0.1000 EOS"); // AMOUNT
        args1.put("memo", "My First Transaction"); // JUST MEMO
        AbiJsonToBin data = eosApiRestClient.abiJsonToBin("eosio.token", "transfer", args1);

        System.out.println("data::"+ data.getBinargs());

        Block block = eosApiRestClient.getBlock(eosApiRestClient.getChainInfo().getHeadBlockId());

        System.out.println("block::"+ block.getId());

        /* Create Transaction Action Authorization */
        TransactionAuthorization transactionAuthorization = new TransactionAuthorization();
        transactionAuthorization.setActor("abontester12");
        transactionAuthorization.setPermission("active");

        /* Create Transaction Action */
        TransactionAction transactionAction = new TransactionAction();
        transactionAction.setAccount("abontester12");
        transactionAction.setName("transfer");
        transactionAction.setData(data.getBinargs());
        transactionAction.setAuthorization(Collections.singletonList(transactionAuthorization));

        /* Create a transaction */
        PackedTransaction packedTransaction = new PackedTransaction();
        packedTransaction.setRefBlockPrefix(block.getRefBlockPrefix().toString());
        packedTransaction.setRefBlockNum(block.getBlockNum().toString());
        packedTransaction.setExpiration("2019-04-30T14:53:59.000");
        packedTransaction.setRegion("0");
        packedTransaction.setMax_net_usage_words("0");
        packedTransaction.setContextFreeData(Collections.emptyList());
        packedTransaction.setContextFreeActions(Collections.emptyList());
        packedTransaction.setActions(Collections.singletonList(transactionAction));

        SignedPackedTransaction signedPackedTransaction = eosApiRestClient.signTransaction(packedTransaction, Collections.singletonList("EOS6t8Piaew17krZSMM3aZJt6XMawH9HuvDZPABw7kooJRTiUeijD"),"038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca");

        /* Push the transaction */
       // PushedTransaction = eosApiRestClient.pushTransaction("none", signedPackedTransaction);

        PushedTransaction pushedTransaction = eosApiRestClient.pushTransaction("none", signedPackedTransaction);
        System.out.println("pushedTransaction=" + pushedTransaction.getTransactionId());


    }
}

It gives the following Exception:

INFO: {"code":404,"message":"Not Found","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"Unknown Endpoint","file":"http_plugin.cpp","line_number":328,"method":"handle_http_request"}]}}
Apr 24, 2019 3:53:08 PM okhttp3.internal.platform.Platform log
INFO: <-- END HTTP (210-byte body)
Exception in thread "main" client.exception.EosApiException: Not Found: unspecified
    at client.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:55)
    at client.impl.EosApiRestClientImpl.signTransaction(EosApiRestClientImpl.java:197)
    at com.apiservice.controller.CreateAccount.main(CreateAccount.java:61)

pom.xml is:

<dependency>
    <groupId>io.jafka</groupId>
    <artifactId>jeos</artifactId>
    <version>0.9.15</version>
</dependency>

<dependency>
    <groupId>com.github.EOSEssentials</groupId>
    <artifactId>eos-java-rpc-wrapper</artifactId>
    <version>master-SNAPSHOT</version>
</dependency>

even tried with chain id jungle2 testnet

chain id : e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant