On Nov 24, 7:38 am, "Michael Wood" <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 24, 2008 at 4:45 PM, Stuart Sierra
>
> <[EMAIL PROTECTED]> wrote:
>
> > If you're running this at the REPL, in recent versions only the name
> > of the exception is printed.  If you want the full backtrace, do:
> > (.printStackTrace *e)
>
> That doesn't explain why the line number is listed as 0.
>
> Is that expected?
>
> The stack trace does not appear to be any more helpful anyway:
>
> user=> (let [listener (new-listener 8888)]
>  (.accept listener))
> java.lang.NullPointerException (NO_SOURCE_FILE:0)
> user=> (.printStackTrace *e)
> java.lang.NullPointerException (NO_SOURCE_FILE:0)
>         at clojure.lang.Compiler.eval(Compiler.java:4118)
>         at clojure.lang.Repl.main(Repl.java:93)
> Caused by: java.lang.NullPointerException
>         at 
> clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:253)
>         at user$eval__40.invoke(Unknown Source)
>         at clojure.lang.Compiler.eval(Compiler.java:4107)
>         ... 1 more
> nil
>
> --
> Michael Wood <[EMAIL PROTECTED]>

The reason the line number is 0 is the NPE happens in the REPL... (new-
listener 8888) is not throwing the exception, it's just returning
null. The NPE happens on the next line: (.accept listener) where
listener is now set to null.

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to