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

1.6.0 MtGox v1 placeMarketOrder Null Pointer Exception #107

Closed
WLJenkins opened this issue May 5, 2013 · 10 comments
Closed

1.6.0 MtGox v1 placeMarketOrder Null Pointer Exception #107

WLJenkins opened this issue May 5, 2013 · 10 comments

Comments

@WLJenkins
Copy link

Calling app:
https://github.com/aido/AidoATP

Platform:
Win 7 64 bit
JRE - 1.7.0_u13

MtGox acct API enabled, keys, and perms confirmed.

Ask order: 0.002

@timmolter
Copy link
Member

Can you try the latest development snapshot? I just ran com.xeiam.xchange.examples.mtgox.v1.service.trade.polling.MarketOrderDemo, and it works for me.

@WLJenkins
Copy link
Author

Will do. Thank you. Will update with results.

@WLJenkins
Copy link
Author

Recompiled using XChange 1.6.1 devel.

Same traceback. MtGoxPollingTradeService.java:83 placeMarketOrder - NPE.

I wonder if Gox likes to lock API trade activity on accounts without warning. If this is common I might regen my API key.

@carmaa
Copy link

carmaa commented May 8, 2013

Got the same problem here, on OS X 10.8.3 x86_64, running xchange 1.6.0.

java.lang.NullPointerException
  at com.xeiam.xchange.mtgox.v1.service.trade.polling.MtGoxPollingTradeService.placeMarketOrder(MtGoxPollingTradeService.java:84)
  at org.aido.atp.TrendTradingAgent.marketOrder(TrendTradingAgent.java:554)
  at org.aido.atp.TrendTradingAgent.evalAsk(TrendTradingAgent.java:432)
  at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:344)
  at java.lang.Thread.run(Thread.java:722)

@timmolter
Copy link
Member

What happens if you guys run this class in XChange: com.xeiam.xchange.examples.mtgox.v1.service.trade.polling.MarketOrderDemo?

(You'll need to use your own MtGox api keys)

@mmazi
Copy link
Contributor

mmazi commented May 8, 2013

Running MarketOrderDemo (on xchange-1.6.0 git tag) seems to work normally for me. (The order doesn't execute but is automatically cancelled immediately since I have no funds in my account.) If I disable trading for the key through the web interface, I get a reasonable error message.

@mmazi
Copy link
Contributor

mmazi commented May 8, 2013

Aha, trying to execute a bid with 0.002 BTC value results in NPE. The reason seems to be that mtGoxSuccess.getReturn() is null -- "return" is not present in the returned json.

11:25:35.976 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 200
11:25:35.982 [default] [main] DEBUG si.mazi.rescu.HttpTemplate - Response body: {"result":"error","error":"Order amount is too low","token":"unknown_error"}
Exception in thread "main" java.lang.NullPointerException
at com.xeiam.xchange.mtgox.v1.service.trade.polling.MtGoxPollingTradeService.placeMarketOrder(MtGoxPollingTradeService.java:84)
at com.xeiam.xchange.examples.mtgox.v1.service.trade.polling.MarketOrderDemo.main(MarketOrderDemo.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

@mmazi
Copy link
Contributor

mmazi commented May 8, 2013

Fixed this: 39e1608

@mmazi mmazi closed this as completed May 8, 2013
@timmolter
Copy link
Member

nice work!

@carmaa
Copy link

carmaa commented May 8, 2013

Thanks!

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

4 participants