Trouble with Context on bitcoinj 0.13.2
See original GitHub issueHi, first i had a “You must construct a Context object before using bitcoinj!” even if this version should support automatic Context injection. Test code
final byte[] payloadBytes = Bitcoin.fromHex(hex);
final org.bitcoinj.core.Transaction starting = new org.bitcoinj.core.Transaction(MainNetParams.get(), payloadBytes);
System.out.println("starting:"+starting); //Exception here
I solve this issue explicitly calling before that code
Context.getOrCreate(MainNetParams.get());
But this works in local, while in appengine I got:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
turning back to 0.12.3 for now.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Release notes - bitcoinj
Release notes. Version 0.16.2. This is a bug fix and maintenance release. Notable changes: Support segwit in addSignedInput() methods.
Read more >Bitcoin Core version 0.13.2 released
This is a new minor version release, including various bugfixes and performance improvements, as well as updated translations. Please report ...
Read more >Bitcoin Core 0.13.2
This behavior has been changed to return success and to reattempt mempool insertion at the same time transaction rebroadcast is attempted, avoiding a...
Read more >Index (bitcoinj 0.13.1 API) - javadoc.io
A ThreadFactory that propagates a Context from the creating thread into the new thread. ContextPropagatingThreadFactory(String, int) - Constructor for class org ...
Read more >[bitcoin-dev] Script Abuse Potential?
Next message: [bitcoin-dev] Bitcoin Core 0.13.2 released ... direct limit on op_cat is it favors what I'll dub "context free" analysis, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
App Engine has a specific, non-standard API for the creation of threads. Any attempt to create a thread in the normal Java manner will fail.
This would be awkward to support in the extreme: the fact that your app works in previous versions of bitcoinj is just blind luck. It’s not something we ever supported, so this is not a “bug” in the pedantic sense.
However there is a simple solution for you: compile your own bitcoinj and in the Threading class, remove the code that initialises USER_THREAD.
FYI I get the same error while running a unit test in Eclipse after upgrading to BitcoinJ 0.13.3: