Closed ulises closed 9 years ago
FYI, I came across this while writing some tests whereby actors expose their self
via promises, e.g. (deliver an-external-promise (self))
or somesuch.
Oh, another thing, if I add :bootstrap true
to project.clj
, then I get the NPE error mentioned in #43
Output from running a test with :bootstrap true
:
lein test :only sliver.node-test/spawn-test
ERROR in (spawn-test) (ActorLoader.java:368)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.NullPointerException: null
at co.paralleluniverse.actors.ActorLoader.loadCurrentClass (ActorLoader.java:368)
co.paralleluniverse.actors.ActorLoader.getCurrentClassFor (ActorLoader.java:392)
co.paralleluniverse.actors.ActorLoader.getReplacementFor0 (ActorLoader.java:379)
co.paralleluniverse.actors.ActorLoader.getReplacementFor (ActorLoader.java:117)
co.paralleluniverse.actors.Actor.checkReplacement (Actor.java:135)
co.paralleluniverse.actors.Actor.spawn (Actor.java:235)
co.paralleluniverse.actors.Actor.spawn (Actor.java:203)
sliver.node.Node.spawn (node.clj:182)
sliver.node_test/fn (node_test.clj:87)
clojure.test$test_var$fn__7187.invoke (test.clj:704)
clojure.test$test_var.invoke (test.clj:704)
clojure.test$test_vars$fn__7209$fn__7214.invoke (test.clj:722)
sliver.node_test$epmd_erl_fixture.invoke (node_test.clj:15)
clojure.test$compose_fixtures$fn__7181$fn__7182.invoke (test.clj:681)
clojure.test$default_fixture.invoke (test.clj:674)
clojure.test$compose_fixtures$fn__7181.invoke (test.clj:681)
clojure.test$test_vars$fn__7209.invoke (test.clj:722)
clojure.test$default_fixture.invoke (test.clj:674)
clojure.test$test_vars.invoke (test.clj:718)
clojure.test$test_all_vars.invoke (test.clj:728)
clojure.test$test_ns.invoke (test.clj:747)
clojure.core$map$fn__4245.invoke (core.clj:2559)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.boundedLength (RT.java:1654)
clojure.lang.RestFn.applyTo (RestFn.java:130)
clojure.core$apply.invoke (core.clj:626)
clojure.test$run_tests.doInvoke (test.clj:762)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:624)
Aha! Silly me. I was calling (self)
and not @self
. This is a non-issue.
Apologies for the vagueness of the title of this issue, but here's what's happening: 1) create function in a namespace, e.g.
n/f
2) in a different namespace try to spawn this function, e.g.(a/spawn n/f)
3) exception happens:relevant bits of code:
If this is a case of RTFM, that's great, please point me to the docs. If not, then :(