adamwynne / twitter-api

Async io interface to all the twitter APIs
372 stars 64 forks source link

Null pointer exception in trivial use case. #39

Closed heartpunk closed 10 years ago

heartpunk commented 10 years ago

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots
  "prints tehgeekmeister's toots"
  (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds)))

And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

    :java.lang.NullPointerException
    at clojure.lang.Var.invoke(Var.java:411)
    at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1)
    at user$eval5.invoke(form-init5319499649707338122.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6619)
    at clojure.lang.Compiler.eval(Compiler.java:6609)
    at clojure.lang.Compiler.load(Compiler.java:7064)
    at clojure.lang.Compiler.loadFile(Compiler.java:7020)
    at clojure.main$load_script.invoke(main.clj:294)
    at clojure.main$init_opt.invoke(main.clj:299)
    at clojure.main$initialize.invoke(main.clj:327)
    at clojure.main$null_opt.invoke(main.clj:362)
    at clojure.main$main.doInvoke(main.clj:440)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
heartpunk commented 10 years ago

Had the idea to test this in the repl: same exact code doesn't have this issue there. I'm using lein run -m namespace/function when I get this error.

adamwynne commented 10 years ago

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister notifications@github.com wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException
at clojure.lang.Var.invoke(Var.java:411)
at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1)
at user$eval5.invoke(form-init5319499649707338122.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.Compiler.loadFile(Compiler.java:7020)
at clojure.main$load_script.invoke(main.clj:294)
at clojure.main$init_opt.invoke(main.clj:299)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:421)

— Reply to this email directly or view it on GitHub.

heartpunk commented 10 years ago

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne notifications@github.comwrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister notifications@github.com wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440) at clojure.lang.RestFn.invoke(RestFn.java:421) — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357 .

heartpunk commented 10 years ago

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg <tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne notifications@github.comwrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister notifications@github.com wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440) at clojure.lang.RestFn.invoke(RestFn.java:421) — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357 .

adamwynne commented 10 years ago

great - can you close the issue

On Mon, Jan 27, 2014 at 5:24 AM, tehgeekmeister notifications@github.comwrote:

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg < tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne notifications@github.comwrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister notifications@github.com

wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440)

at clojure.lang.RestFn.invoke(RestFn.java:421)

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357> .

Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342813 .

heartpunk commented 10 years ago

Why? It works in your example cases, but not for another trivial case I tried. Is it not intended to be used the way I'm using it? To me this seems like a bug, but I'm open to learning why it isn't one, if that's the case?— Sent from Mailbox for iPhone

On Sun, Jan 26, 2014 at 9:34 PM, Adam Wynne notifications@github.com wrote:

great - can you close the issue On Mon, Jan 27, 2014 at 5:24 AM, tehgeekmeister notifications@github.comwrote:

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg < tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne notifications@github.comwrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister notifications@github.com

wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440)

at clojure.lang.RestFn.invoke(RestFn.java:421)

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357> .

Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342813 .


Reply to this email directly or view it on GitHub: https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343060

adamwynne commented 10 years ago

from what you showed me, _print_mytoots should be a function - using defn

(defn print_my_toots "prints tehgeekmeister's toots" [](statuses-home-timeline :oauth-creds tehgeekmeisters_creds))

pprinting the result of the result of the statuses-home-timeline function call will not work as it works through a callback (being an async library), so the callback is where the pprint should be

On Mon, Jan 27, 2014 at 5:39 AM, tehgeekmeister notifications@github.comwrote:

Why? It works in your example cases, but not for another trivial case I tried. Is it not intended to be used the way I'm using it? To me this seems like a bug, but I'm open to learning why it isn't one, if that's the case?— Sent from Mailbox for iPhone

On Sun, Jan 26, 2014 at 9:34 PM, Adam Wynne notifications@github.com wrote:

great - can you close the issue On Mon, Jan 27, 2014 at 5:24 AM, tehgeekmeister < notifications@github.com>wrote:

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg < tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne notifications@github.comwrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister < notifications@github.com>

wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440)

at clojure.lang.RestFn.invoke(RestFn.java:421)

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub<

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357>

.

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342813> .


Reply to this email directly or view it on GitHub: https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343060

— Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343176 .

heartpunk commented 10 years ago

Oh, man, I'm sorry. I skimmed the docs waaaaay too quick earlier when I was switching over from clojure-twitter. Sorta assumed it was synchronous by default, but now I see that's not the case. All working great now, thanks!

On Sun, Jan 26, 2014 at 9:46 PM, Adam Wynne notifications@github.comwrote:

from what you showed me, _print_mytoots should be a function - using defn

  • so it should be something like

(defn print_my_toots "prints tehgeekmeister's toots" [](statuses-home-timeline :oauth-creds tehgeekmeisters_creds))

pprinting the result of the result of the statuses-home-timeline function call will not work as it works through a callback (being an async library), so the callback is where the pprint should be

On Mon, Jan 27, 2014 at 5:39 AM, tehgeekmeister notifications@github.comwrote:

Why? It works in your example cases, but not for another trivial case I tried. Is it not intended to be used the way I'm using it? To me this seems like a bug, but I'm open to learning why it isn't one, if that's the case?— Sent from Mailbox for iPhone

On Sun, Jan 26, 2014 at 9:34 PM, Adam Wynne notifications@github.com wrote:

great - can you close the issue On Mon, Jan 27, 2014 at 5:24 AM, tehgeekmeister < notifications@github.com>wrote:

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg < tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne < notifications@github.com>wrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister < notifications@github.com>

wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440)

at clojure.lang.RestFn.invoke(RestFn.java:421)

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub<

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357>

.

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342813>

.


Reply to this email directly or view it on GitHub:

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343060

— Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343176> .

— Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343390 .

adamwynne commented 10 years ago

no problem :)

On Mon, Jan 27, 2014 at 5:56 AM, tehgeekmeister notifications@github.comwrote:

Oh, man, I'm sorry. I skimmed the docs waaaaay too quick earlier when I was switching over from clojure-twitter. Sorta assumed it was synchronous by default, but now I see that's not the case. All working great now, thanks!

On Sun, Jan 26, 2014 at 9:46 PM, Adam Wynne notifications@github.comwrote:

from what you showed me, _print_mytoots should be a function - using defn

  • so it should be something like

(defn print_my_toots "prints tehgeekmeister's toots" [](statuses-home-timeline :oauth-creds tehgeekmeisters_creds))

pprinting the result of the result of the statuses-home-timeline function call will not work as it works through a callback (being an async library), so the callback is where the pprint should be

On Mon, Jan 27, 2014 at 5:39 AM, tehgeekmeister < notifications@github.com>wrote:

Why? It works in your example cases, but not for another trivial case I tried. Is it not intended to be used the way I'm using it? To me this seems like a bug, but I'm open to learning why it isn't one, if that's the case?-- Sent from Mailbox for iPhone

On Sun, Jan 26, 2014 at 9:34 PM, Adam Wynne notifications@github.com

wrote:

great - can you close the issue On Mon, Jan 27, 2014 at 5:24 AM, tehgeekmeister < notifications@github.com>wrote:

I just tried all of them except the picture post (I have no picture I want to post), with no problems in the REPL or using lein -m my-module/main. I tried running them with prints around them as a file, but get no output that way (but no exception either).

On Sun, Jan 26, 2014 at 9:09 PM, Ezekiel Smithburg < tehgeekmeister@gmail.com

wrote:

Nope, I'll do that now.

On Sun, Jan 26, 2014 at 9:07 PM, Adam Wynne < notifications@github.com>wrote:

Did you try the example in the docs?

Sent from my iPad

On 26 Jan 2014, at 11:34 pm, tehgeekmeister < notifications@github.com>

wrote:

I was just testing this library out, and ran this code (secrets removed):

(def tehgeekmeisters_creds (make-oauth-creds ...))

(def print_my_toots "prints tehgeekmeister's toots" (pprint (statuses-home-timeline :oauth-creds tehgeekmeisters_creds))) And then this is interspersed in the output on every run so far. Since there's no filenames in this library mentioned, and I'm new to clojure, I can't be of much more help unfortunately.

:java.lang.NullPointerException at clojure.lang.Var.invoke(Var.java:411) at user$eval5$fn__7.invoke(form-init5319499649707338122.clj:1) at user$eval5.invoke(form-init5319499649707338122.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6609) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.Compiler.loadFile(Compiler.java:7020) at clojure.main$load_script.invoke(main.clj:294) at clojure.main$init_opt.invoke(main.clj:299) at clojure.main$initialize.invoke(main.clj:327) at clojure.main$null_opt.invoke(main.clj:362) at clojure.main$main.doInvoke(main.clj:440)

at clojure.lang.RestFn.invoke(RestFn.java:421)

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub<

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342357>

.

Reply to this email directly or view it on GitHub<

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33342813>

.


Reply to this email directly or view it on GitHub:

https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343060

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343176>

.

Reply to this email directly or view it on GitHub< https://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343390> .

Reply to this email directly or view it on GitHubhttps://github.com/adamwynne/twitter-api/issues/39#issuecomment-33343688 .