{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/ethereumj/issues/312","labels_url":"https://api.github.com/repos/ethereum/ethereumj/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/ethereumj/issues/312/comments","events_url":"https://api.github.com/repos/ethereum/ethereumj/issues/312/events","html_url":"https://github.com/ethereum/ethereumj/issues/312","id":108731176,"number":312,"title":"Contract submission fails","user":{"login":"mikkazan","id":3474290,"avatar_url":"https://avatars.githubusercontent.com/u/3474290?v=3","gravatar_id":"","url":"https://api.github.com/users/mikkazan","html_url":"https://github.com/mikkazan","followers_url":"https://api.github.com/users/mikkazan/followers","following_url":"https://api.github.com/users/mikkazan/following{/other_user}","gists_url":"https://api.github.com/users/mikkazan/gists{/gist_id}","starred_url":"https://api.github.com/users/mikkazan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikkazan/subscriptions","organizations_url":"https://api.github.com/users/mikkazan/orgs","repos_url":"https://api.github.com/users/mikkazan/repos","events_url":"https://api.github.com/users/mikkazan/events{/privacy}","received_events_url":"https://api.github.com/users/mikkazan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-28T19:36:51Z","updated_at":"2015-09-28T20:40:48Z","closed_at":null,"body":"Hi EthereumJ team,\r\nhope you missed me :)\r\n\r\nI am trying to send new contract to ethereumj and got exception back\r\n\r\nHere is my code\r\n```\r\n@Override\r\n// data is compiled contract\r\n    public void submitContract(byte[] data, Long value) {\r\n        Repository repository = ethereumBean.getEthereum().getRepository();\r\n        //Fails here\r\n        nonce = repository.getNonce(userKey.getAddress());\r\n        Long gasLimit = ethereumBean.getEthereum().getBlockchain().getBestBlock().getGasLimit();\r\n        Transaction tx = CallTransaction.createRawTransaction(nonce.longValue(), 70_000_000_000L, gasLimit, null, value, data);\r\n        tx.sign(userKey.getPrivKeyBytes());\r\n        ethereumBean.getEthereum().submitTransaction(tx);\r\n    }\r\n```\r\n\r\nI generated user privateKey using Hex.toHexString(new ECKey().decompress().getPrivKeyBytes()); and added it to .conf file. Genesis file has nonce and gasLimit and was loaded according to the log\r\n\r\n2015-09-28 14:57:06.704  INFO 5724 --- [pool-1-thread-1] general                                  : DB is empty - adding Genesis\r\n2015-09-28 14:57:07.040  INFO 5724 --- [pool-1-thread-1] general                                  : Genesis block loaded\r\n2015-09-28 14:57:07.053  INFO 5724 --- [       Thread-6] blockqueue                               : Start loading sync queue\r\n2015-09-28 14:57:07.072  INFO 5724 --- [       Thread-6] sync                                     : Sync Manager: ON\r\n2015-09-28 14:57:07.090  INFO 5724 --- [    UDPListener] discover                                 : Discovery UDPListener started\r\n2015-09-28 14:57:07.116  INFO 5724 --- [pool-6-thread-1] net                                      : Listening for incoming connections, port: [30303]\r\n2015-09-28 14:57:07.129  INFO 5724 --- [pool-6-thread-1] net                                      : NodeId: [server_node_id]\r\n\r\n\r\nThe exception is \r\njava.lang.NullPointerException: null\r\n        at org.ethereum.trie.TrieImpl.insert(TrieImpl.java:225)\r\n        at org.ethereum.trie.TrieImpl.insertOrDelete(TrieImpl.java:201)\r\n        at org.ethereum.trie.TrieImpl.update(TrieImpl.java:133)\r\n        at org.ethereum.trie.SecureTrie.update(SecureTrie.java:25)\r\n        at org.ethereum.db.RepositoryImpl$9.invoke(RepositoryImpl.java:492)\r\n        at org.ethereum.db.RepositoryImpl$13.invoke(RepositoryImpl.java:636)\r\n        at org.ethereum.db.RepositoryImpl.doWithAccessCounting(RepositoryImpl.java:626)\r\n        at org.ethereum.db.RepositoryImpl.doWithAccessCounting(RepositoryImpl.java:633)\r\n        at org.ethereum.db.RepositoryImpl.updateAccountState(RepositoryImpl.java:489)\r\n        at org.ethereum.db.RepositoryImpl.createAccount(RepositoryImpl.java:560)\r\n        at org.ethereum.db.RepositoryImpl.getAccountStateOrCreateNew(RepositoryImpl.java:475)\r\n        at org.ethereum.db.RepositoryImpl.getNonce(RepositoryImpl.java:469)\r\n\r\ncan you pelase point me what am I doing wrong?"},"comment":{"url":"https://api.github.com/repos/ethereum/ethereumj/issues/comments/143867639","html_url":"https://github.com/ethereum/ethereumj/issues/312#issuecomment-143867639","issue_url":"https://api.github.com/repos/ethereum/ethereumj/issues/312","id":143867639,"user":{"login":"romanman","id":5822633,"avatar_url":"https://avatars.githubusercontent.com/u/5822633?v=3","gravatar_id":"","url":"https://api.github.com/users/romanman","html_url":"https://github.com/romanman","followers_url":"https://api.github.com/users/romanman/followers","following_url":"https://api.github.com/users/romanman/following{/other_user}","gists_url":"https://api.github.com/users/romanman/gists{/gist_id}","starred_url":"https://api.github.com/users/romanman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanman/subscriptions","organizations_url":"https://api.github.com/users/romanman/orgs","repos_url":"https://api.github.com/users/romanman/repos","events_url":"https://api.github.com/users/romanman/events{/privacy}","received_events_url":"https://api.github.com/users/romanman/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T20:40:48Z","updated_at":"2015-09-28T20:40:48Z","body":"@mikkazan @mkalinin : I think the genesis is the key , \r\n@mikkazan , how exactly you call your genesis , and how\r\nyou execute it ?\r\n"}}