Comments (7)
I'm not able to reproduce it. Could you send the value of subtranresponse.getResultXdr()
for the execution that results in java.lang.NullPointerException
being thrown (you can just print it before the line that's causing java.lang.NullPointerException
)?
from java-stellar-sdk.
PFB the required data:
Transaction xdr AAAAAP0uDCJGzWofMAUkG/F3YCPctgLkeP3VTr3P1mHKznAHAAAAZAA5klgAAABKAAAAAAAAAAAAAAABAAAAAQAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAMAAAABRVVSAAAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAFVU0QAAAAAAOw4Vbv3zJ23hiG1bjU7M/AOuVNHKnREERoitIr1Zj/ZAAAAAAOThwAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAHKznAHAAAAQGK49TjFF8thkJA7x1ZYXy1V0KqYeQllcM0l1coVT5QlBuzamttVyUr4Ggu69jdHtHQhQ6Fjb19jHPWuuNI3CAg=
subtranresponse.isSuccess(): true
Inside success:
java.lang.NullPointerException
at org.stellar.sdk.responses.SubmitTransactionResponse.getOfferIdFromResult(SubmitTransactionResponse.java:98)
at com.stellar.Offers.manageOffer(Offers.java:102)
at com.stellar.Offers.main(Offers.java:30)
from java-stellar-sdk.
But what is the result xdr? Likely the offer was taken when you placed it so there is no offer left
from java-stellar-sdk.
Transaction xdr AAAAAP0uDCJGzWofMAUkG/F3YCPctgLkeP3VTr3P1mHKznAHAAAAZAA5klgAAABLAAAAAAAAAAAAAAABAAAAAQAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAMAAAABRVVSAAAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAFVU0QAAAAAAOw4Vbv3zJ23hiG1bjU7M/AOuVNHKnREERoitIr1Zj/ZAAAAAAOThwAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAHKznAHAAAAQEe1jyNCeK3TckPuuKeWIICf6nvz2zBZ8mbbUamWLnOFMMqvQPTllOe9DIdloNxaixgle9zi2F+yyOhLzpNhkAg=
subtranresponse.isSuccess(): true
Inside success:
subtranresponse.getEnvelopeXdr(): AAAAAP0uDCJGzWofMAUkG/F3YCPctgLkeP3VTr3P1mHKznAHAAAAZAA5klgAAABLAAAAAAAAAAAAAAABAAAAAQAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAMAAAABRVVSAAAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAFVU0QAAAAAAOw4Vbv3zJ23hiG1bjU7M/AOuVNHKnREERoitIr1Zj/ZAAAAAAOThwAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAHKznAHAAAAQEe1jyNCeK3TckPuuKeWIICf6nvz2zBZ8mbbUamWLnOFMMqvQPTllOe9DIdloNxaixgle9zi2F+yyOhLzpNhkAg=
subtranresponse.getResultXdr(): AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAA7DhVu/fMnbeGIbVuNTsz8A65U0cqdEQRGiK0ivVmP9kAAAAAAAASJQAAAAFVU0QAAAAAAOw4Vbv3zJ23hiG1bjU7M/AOuVNHKnREERoitIr1Zj/ZAAAAAAcnDgAAAAABRVVSAAAAAAD9LgwiRs1qHzAFJBvxd2Aj3LYC5Hj91U69z9Zhys5wBwAAAAADk4cAAAAAAgAAAAA=
java.lang.NullPointerException
at org.stellar.sdk.responses.SubmitTransactionResponse.getOfferIdFromResult(SubmitTransactionResponse.java:98)
at com.stellar.Offers.manageOffer(Offers.java:101)
at com.stellar.Offers.main(Offers.java:26)
from java-stellar-sdk.
As Jed mentioned you won't get offer id in result_xdr
if the offer was taken. This is by design.
from java-stellar-sdk.
We should change getOfferIdFromResult
to return null
in this case.
from java-stellar-sdk.
Fixed in 0.1.13.
from java-stellar-sdk.
Related Issues (20)
- Correct the data type of certain fields to store the expected design values. HOT 1
- Add the fromXdrBase64, fromXdrByteArray, toXdrBase64 and toXdrByteArray methods to the XDR classes. HOT 3
- Optimize the way of generating XDR classes.
- Preserve existing auth entries after simulation if they're present HOT 1
- Add `SorobanDataBuilder` to prepare sorobanData easily. HOT 1
- Use JDK 11 for building jar.
- Update XDR reference HOT 3
- New soroban_readme.md for Soroban sdk usage HOT 1
- There is a typo in Transaction.isSorobanData. HOT 1
- `AccountConverter.enableMuxed()` not throwing exceptions with trailing characters of a valid mux account
- The dependency on commons-codec conflicts with the commons-codec in lower versions of the Android framework.
- NullPointerException when calling `PaymentOperationresponse.getAsset()` HOT 2
- Updating the SDKs to the stable Protocol 20 release HOT 1
- Protocol 20: Add support for resource leeway in `simulateTransaction`
- Add support for new fields in Soroban RPC's `sendTransaction` endpoint
- Required changes for passing parameters when communicating with Soroban RPC. HOT 1
- Provide documentation for each version on javadoc.io. HOT 1
- Provide the SDK in the Central Maven HOT 1
- How to configure Friendbot for testnet network ? HOT 2
- Protocol 21 SDK Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-stellar-sdk.