I wave a strange NullPointerException when I call (println "Some string").
It seems similar to this problem on
Stackoverflow<http://stackoverflow.com/questions/1530555/nullpointer-in-clojure-when-running-doseq-with-multiple-expressions-in-the-body>,
but the 'do' solution doesn't seem to work for me. In the output below, the
"XPATH..." output is obviously being called.
It has something to do with the 'if' block b/c when I i) printout the 'isa'
condition outside of the block, it evaluates to true"
(println (isa? (class (. node getCommandInput))
com.interrupt.bookkeeping.cc.node.AXpathCommandInput ))
Also, if I ii) replace line 67 with "somestring", then the
'NullPointerException' moves up to the if block (which all evaluates to
true). Very strange, but it's probably something known, that I'm missing.
Still a clojure noob.
*CODE *
64 (if (isa? (class (. node getCommandInput))
com.interrupt.bookkeeping.cc.node.AXpathCommandInput)
65 ;; also tried this with same result... (if
(true? true)
66
67 (println "XPATH input") ;; also tried this with
same result... (do (println "XPATH input"))
68 )
*OUTPUT*
load( `//sadf/asdf` );
caseALoadCommand3: load ( ` / / sadf / asdf ` )
XPATH input
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.NullPointerException (bkell.clj:0)
at clojure.lang.Compiler.eval(Compiler.java:4658)
at clojure.lang.Compiler.load(Compiler.java:4972)
at clojure.lang.Compiler.loadFile(Compiler.java:4939)
at clojure.main$load_script__7405.invoke(main.clj:213)
at clojure.main$script_opt__7442.invoke(main.clj:265)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.lang.Var.invoke(Var.java:359)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.main.main(main.java:37)
... 5 more
Caused by: java.lang.NullPointerException
at user$get_depth_adapter__16$fn__18.invoke(bkell.clj:67)
...
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en