ANN Ritz 0.5.0

803 views
Skip to first unread message

Hugo Duncan

unread,
Sep 19, 2012, 3:49:38 PM9/19/12
to clojure

Ritz provides a clojure debugger for nREPL.el and SLIME, other nREPL
middleware, and a general repl-utils library.

0.5.0 adds several new features.

* load-project will load the project for buffer you are currently
visiting. This allows you to switch projects in an existing repl.

* reload-project will reload the current project. If you have added
dependencies to the project, these will be added to the classpath. If
you have removed dependencies, the classpath will be updated
appropriately and all user namespaces cleared.

* lein will allow you to use the REPL vm to run lein command for you
current project.

The commands above should be prefixed with slime-ritz-, or nrepl-ritz-
as appropriate.

ritz-nrepl works with the recent nrepl.el 0.1.4 release.

Change log: https://github.com/pallet/ritz/blob/develop/ReleaseNotes.md

Project: https://github.com/pallet

Hugo

Stefan Hübner

unread,
Sep 21, 2012, 5:50:09 AM9/21/12
to clo...@googlegroups.com
Hi Hugo,

I have two questions:

a) Are you planning on updating Zi for this new release?

b) How can ritz-nrepl or (preferably) ritz-swank be embedded in an
application?

Best Regards,
Stefan

Hugo Duncan

unread,
Sep 21, 2012, 12:35:45 PM9/21/12
to clo...@googlegroups.com

Stefan,

sthu...@googlemail.com (Stefan Hübner) writes:

> a) Are you planning on updating Zi for this new release?

Yes. It might take a few days.

> b) How can ritz-nrepl or (preferably) ritz-swank be embedded in an
> application?

I just added instructions [1] to the ritz-swank README. I've not
actually tried this yet, but this is essentially how the lein ritz
plugin starts ritz-swank.

Hugo

[1] https://github.com/pallet/ritz/tree/develop/swank#embedding

adrians

unread,
Sep 21, 2012, 11:05:37 PM9/21/12
to clo...@googlegroups.com
Hi Hugo,

I'm trying to get ritz-nrepl going with the latest lein2 and nrepl.el from Melpa. I think I've followed the instructions on the project page, yet I get this, when I nrepl-ritz-jack-in:

error in process sentinel: Could not start nREPL server: Exception in thread "main" java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at ritz.jpda.jdi$eval973$loading__4784__auto____974.invoke(jdi.clj:1)

at ritz.jpda.jdi$eval973.invoke(jdi.clj:1)

at clojure.lang.Compiler.eval(Compiler.java:6511)

at clojure.lang.Compiler.eval(Compiler.java:6501)

at clojure.lang.Compiler.load(Compiler.java:6952)

at clojure.lang.RT.loadResourceScript(RT.java:359)

at clojure.lang.RT.loadResourceScript(RT.java:350)

at clojure.lang.RT.load(RT.java:429)

at clojure.lang.RT.load(RT.java:400)

at clojure.core$load$fn__4890.invoke(core.clj:5415)

at clojure.core$load.doInvoke(core.clj:5414)

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

at clojure.core$load_one.invoke(core.clj:5227)

at clojure.core$load_lib.doInvoke(core.clj:5264)

at clojure.lang.RestFn.applyTo(RestFn.java:142)

at clojure.core$apply.invoke(core.clj:603)

at clojure.core$load_libs.doInvoke(core.clj:5298)

at clojure.lang.RestFn.applyTo(RestFn.java:137)

at clojure.core$apply.invoke(core.clj:603)

at clojure.core$require.doInvoke(core.clj:5381)

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

at ritz.jpda.debug$eval822$loading__4784__auto____823.invoke(debug.clj:1)

at ritz.jpda.debug$eval822.invoke(debug.clj:1)

at clojure.lang.Compiler.eval(Compiler.java:6511)

at clojure.lang.Compiler.eval(Compiler.java:6501)

at clojure.lang.Compiler.load(Compiler.java:6952)

at clojure.lang.RT.loadResourceScript(RT.java:359)

at clojure.lang.RT.loadResourceScript(RT.java:350)

at clojure.lang.RT.load(RT.java:429)

at clojure.lang.RT.load(RT.java:400)

at clojure.core$load$fn__4890.invoke(core.clj:5415)

at clojure.core$load.doInvoke(core.clj:5414)

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

at clojure.core$load_one.invoke(core.clj:5227)

at clojure.core$load_lib.doInvoke(core.clj:5264)

at clojure.lang.RestFn.applyTo(RestFn.java:142)

at clojure.core$apply.invoke(core.clj:603)

at clojure.core$load_libs.doInvoke(core.clj:5298)

at clojure.lang.RestFn.applyTo(RestFn.java:137)

at clojure.core$apply.invoke(core.clj:605)

at clojure.core$use.doInvoke(core.clj:5392)

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

at ritz.nrepl$eval5$loading__4784__auto____6.invoke(nrepl.clj:1)

at ritz.nrepl$eval5.invoke(nrepl.clj:1)

at clojure.lang.Compiler.eval(Compiler.java:6511)

at clojure.lang.Compiler.eval(Compiler.java:6501)

at clojure.lang.Compiler.load(Compiler.java:6952)

at clojure.lang.RT.loadResourceScript(RT.java:359)

at clojure.lang.RT.loadResourceScript(RT.java:350)

at clojure.lang.RT.load(RT.java:429)

at clojure.lang.RT.load(RT.java:400)

at clojure.core$load$fn__4890.invoke(core.clj:5415)

at clojure.core$load.doInvoke(core.clj:5414)

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

at clojure.core$load_one.invoke(core.clj:5227)

at clojure.core$load_lib.doInvoke(core.clj:5264)

at clojure.lang.RestFn.applyTo(RestFn.java:142)

at clojure.core$apply.invoke(core.clj:603)

at clojure.core$load_libs.doInvoke(core.clj:5298)

at clojure.lang.RestFn.applyTo(RestFn.java:137)

at clojure.core$apply.invoke(core.clj:603)

at clojure.core$require.doInvoke(core.clj:5381)

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

at user$eval1.invoke(NO_SOURCE_FILE:1)

at clojure.lang.Compiler.eval(Compiler.java:6511)

at clojure.lang.Compiler.eval(Compiler.java:6501)

at clojure.lang.Compiler.eval(Compiler.java:6500)

at clojure.lang.Compiler.eval(Compiler.java:6477)

at clojure.core$eval.invoke(core.clj:2797)

at clojure.main$eval_opt.invoke(main.clj:297)

at clojure.main$initialize.invoke(main.clj:316)

at clojure.main$null_opt.invoke(main.clj:349)

at clojure.main$main.doInvoke(main.clj:427)

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

at clojure.lang.Var.invoke(Var.java:419)

at clojure.lang.AFn.applyToHelper(AFn.java:163)

at clojure.lang.Var.applyTo(Var.java:532)

at clojure.main.main(main.java:37)

The same exception is thrown if I invoke ritz-nrepl from the command-line. I'm using jdk 1.7.0_07 with Windows 7 64 bit, if that helps. Any clue as to what's going wrong?

Cheers,
Adrian

Timothy Washington

unread,
Sep 23, 2012, 3:16:44 AM9/23/12
to clo...@googlegroups.com
I was following the instructions on the ritz-nrepl page. And I get the error below, when executing the "M-x nrepl-ritz-jack-in" command. 

        ...
        at clojure.lang.RestFn.invoke(RestFn.java:703)
        at ritz.nrepl.debug_eval$eval2289$loading__4505__auto____2290.invoke(debug_eval.clj:1)
        at ritz.nrepl.debug_eval$eval2289.invoke(debug_eval.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6465)
        at clojure.lang.Compiler.eval(Compiler.java:6455)
        at clojure.lang.Compiler.load(Compiler.java:6902)
        at clojure.lang.RT.loadResourceScript(RT.java:357)
        at clojure.lang.RT.loadResourceScript(RT.java:348)
        at clojure.lang.RT.load(RT.java:427)
        at clojure.lang.RT.load(RT.java:398)
        at clojure.core$load$fn__4610.invoke(core.clj:5386)
        at clojure.core$load.doInvoke(core.clj:5385)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invoke(core.clj:5200)
        at clojure.core$load_lib.doInvoke(core.clj:5237)
        at clojure.lang.RestFn.applyTo(RestFn.java:142)
        at clojure.core$apply.invoke(core.clj:602)
        at clojure.core$load_libs.doInvoke(core.clj:5271)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invoke(core.clj:604)
        at clojure.core$use.doInvoke(core.clj:5363)
        at clojure.lang.RestFn.invoke(RestFn.java:3894)
        at ritz.nrepl$eval5$loading__4505__auto____6.invoke(nrepl.clj:1)
        at ritz.nrepl$eval5.invoke(nrepl.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6465)
        at clojure.lang.Compiler.eval(Compiler.java:6455)
        at clojure.lang.Compiler.load(Compiler.java:6902)
        at clojure.lang.RT.loadResourceScript(RT.java:357)
        at clojure.lang.RT.loadResourceScript(RT.java:348)
        at clojure.lang.RT.load(RT.java:427)
        at clojure.lang.RT.load(RT.java:398)
        at clojure.core$load$fn__4610.invoke(core.clj:5386)
        at clojure.core$load.doInvoke(core.clj:5385)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invoke(core.clj:5200)
        at clojure.core$load_lib.doInvoke(core.clj:5237)
        at clojure.lang.RestFn.applyTo(RestFn.java:142)
        at clojure.core$apply.invoke(core.clj:602)
        at clojure.core$load_libs.doInvoke(core.clj:5271)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invoke(core.clj:602)
        at clojure.core$require.doInvoke(core.clj:5352)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at user$eval1.invoke(NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:6465)
        at clojure.lang.Compiler.eval(Compiler.java:6455)
        at clojure.lang.Compiler.eval(Compiler.java:6454)
        at clojure.lang.Compiler.eval(Compiler.java:6431)
        at clojure.core$eval.invoke(core.clj:2795)
        at clojure.main$eval_opt.invoke(main.clj:296)
        at clojure.main$initialize.invoke(main.clj:315)
        at clojure.main$null_opt.invoke(main.clj:348)
        at clojure.main$main.doInvoke(main.clj:426)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:405)
        at clojure.lang.AFn.applyToHelper(AFn.java:163)
        at clojure.lang.Var.applyTo(Var.java:518)
        at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: ex-info in this context
        at clojure.lang.Util.runtimeException(Util.java:156)
        at clojure.lang.Compiler.resolveIn(Compiler.java:6720)
        at clojure.lang.Compiler.resolve(Compiler.java:6664)
        at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6625)
        at clojure.lang.Compiler.analyze(Compiler.java:6198)
        ... 171 more


You mention that this is meant to be used in tandem with nrepl.el (nrepl-jack-in)? Because it looks like a parallel tool (nrepl-ritz-jack-in). Could you run through a typical workflow of setting and using the "M-x nrepl-ritz-break-on-exception" command? I just want to make sure that I'm grokking how to use it. 

And thanks for all your work on this. I'm excited to start using it. 


Stefan Hübner

unread,
Sep 24, 2012, 3:53:36 AM9/24/12
to clo...@googlegroups.com
adrians <nma...@gmail.com> writes:

> Hi Hugo,
>
> I'm trying to get ritz-nrepl going with the latest lein2 and nrepl.el from Melpa. I think
> I've followed the instructions on the project page, yet I get this, when I
> nrepl-ritz-jack-in:
>
> error in process sentinel: Could not start nREPL server: Exception in thread "main" java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine
>
> [...]
>
> The same exception is thrown if I invoke ritz-nrepl from the command-line. I'm using jdk
> 1.7.0_07 with Windows 7 64 bit, if that helps. Any clue as to what's going wrong?

I had the same problem a while ago. Putting the JDK's tools.jar on the
classpath solved it.

Hugo Duncan

unread,
Sep 24, 2012, 10:43:10 PM9/24/12
to clo...@googlegroups.com

Adrian,

adrians <nma...@gmail.com> writes:

> I'm trying to get ritz-nrepl going with the latest lein2 and nrepl.el from
> Melpa. I think I've followed the instructions on the project page, yet I
> get this, when I nrepl-ritz-jack-in:
>
> error in process sentinel: Could not start nREPL server: Exception in thread "main" java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine
...

> The same exception is thrown if I invoke ritz-nrepl from the command-line.
> I'm using jdk 1.7.0_07 with Windows 7 64 bit, if that helps. Any clue as to
> what's going wrong?

The error is saying that it hasn't been able to find the jdk's tools.jar file.

This is issue https://github.com/pallet/ritz/issues/53, which is now
fixed and will be in the next release.

Hugo

Hugo Duncan

unread,
Sep 24, 2012, 10:49:51 PM9/24/12
to clo...@googlegroups.com

Tim,


Timothy Washington <twas...@gmail.com> writes:

> I was following the instructions on the ritz-nrepl
> page<https://github.com/pallet/ritz/tree/develop/nrepl>. And
> I get the error below, when executing the "*M-x nrepl-ritz-jack-in*"
> command.

...

> Caused by: java.lang.RuntimeException: Unable to resolve symbol: ex-info in
> this context
> at clojure.lang.Util.runtimeException(Util.java:156)
> at clojure.lang.Compiler.resolveIn(Compiler.java:6720)
> at clojure.lang.Compiler.resolve(Compiler.java:6664)
> at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6625)
> at clojure.lang.Compiler.analyze(Compiler.java:6198)
> ... 171 more

This seems to be an issue with clojure 1.4 not being used in the
controlling vm, and should have been fixed by
https://github.com/pallet/ritz/issues/53, which will be included in the
next release.

> You mention that this is meant to be used in tandem with nrepl.el (*
> nrepl-jack-in*)? Because it looks like a parallel tool (*nrepl-ritz-jack-in*).

You should be able to invoke nrepl-ritz-jack-in once nrepl-ritz.el is
installed.

> Could you run through a typical workflow of setting and using the "*M-x
> nrepl-ritz-break-on-exception*" command? I just want to make sure that I'm
> grokking how to use it.

After running 'M-x nrepl-ritz-break-on-exception', you should get the
debugger activated on an exception. So, entering something like
(throw (Exception. "Hello")) at the repl should result in a debugger
buffer being displayed, showing you a stacktrace.

Hope that helps,

Hugo

Timothy Washington

unread,
Sep 26, 2012, 8:00:06 AM9/26/12
to clo...@googlegroups.com
Sweet. I'll try to pull the latest from the git repo. 


Cheers

Tim Washington 




--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Stefan Hübner

unread,
Sep 26, 2012, 9:33:23 AM9/26/12
to clo...@googlegroups.com
Hugo Duncan <dunca...@gmail.com> writes:

> sthu...@googlemail.com (Stefan Hübner) writes:
>
>> b) How can ritz-nrepl or (preferably) ritz-swank be embedded in an
>> application?
>
> I just added instructions [1] to the ritz-swank README. I've not
> actually tried this yet, but this is essentially how the lein ritz
> plugin starts ritz-swank.
>
> Hugo
>
> [1] https://github.com/pallet/ritz/tree/develop/swank#embedding

Thank you for writing this up! With a small correction it works
beautifully:

--8<---------------cut here---------------start------------->8---
(ns my-app
(:use [ritz.swank.socket-server :only [start]]))

;; previously: ritz.swank/start-server
(start {:server-ns 'ritz.swank.repl})
;; optionally takes :host/:port keyword args
--8<---------------cut here---------------end--------------->8---


Now ritz-swank works with a REPL sitting in a Hadoop application JAR.

Thank you so much!

-Stefan

Chris Jeris

unread,
Sep 26, 2012, 10:19:19 AM9/26/12
to clo...@googlegroups.com
I am also having trouble getting the nrepl-ritz debugger to start.  I am able to start a repl with M-x nrepl-ritz-jack-in.  Then when I do M-x nrepl-ritz-break-on-exception and type '(throw (Exception. "OHAI"))' into the repl, what happens is that I see "nrepl-dbg-setup 1" in the minibuffer and the repl becomes unresponsive.  The process is still alive, but nothing ever comes back to the buffer.

Am I missing some important part of setup here?  I have Clojure 1.4.0, clojure-mode 1.11.5, nrepl.el 0.1.4, ritz 0.5.0, Emacs 24.2.1 on Mac OS 10.6; all the Emacs packages were installed from marmalade.

thanks, Chris Jeris

On Mon, Sep 24, 2012 at 10:49 PM, Hugo Duncan <dunca...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en



--
Chris Jeris
cje...@brightcove.com (617) 686-3271
freenode/twitter/github: ystael

Hugo Duncan

unread,
Oct 5, 2012, 12:01:39 PM10/5/12
to clo...@googlegroups.com
bruce li <leil...@gmail.com> writes:

> I'm trying ritz and having some issues with SLDB that really confused
> me. When I switch on the slime-break-on-exception, it seems it sometimes
> doesn't work. The SLDB buffer won't pop up and I sometimes can see the
> exceptions in the terminal (but sometimes not :( ).

Probably https://github.com/pallet/ritz/issues/51

> By the way, it seems ritz 0.5.0 does not work with Lein 1. I'm wondering if
> Ritz is planned to support Lein 2 only from then on?

I broke it unintentionally - I wonder how many are still using lein1.
Continuing to support lein 1 is obviously more complicated, but should
be feasible.

Hugo

bruce li

unread,
Oct 7, 2012, 9:30:27 PM10/7/12
to clo...@googlegroups.com
2012/10/6 Hugo Duncan <dunca...@gmail.com>
bruce li <leil...@gmail.com> writes:

> I'm trying ritz and having some issues with SLDB that really confused
> me. When I switch on the slime-break-on-exception, it seems it sometimes
> doesn't work. The SLDB buffer won't pop up and I sometimes can see the
> exceptions in the terminal (but sometimes not :(  ).

Probably https://github.com/pallet/ritz/issues/51
 
Ah, this is exactly the issue. Thanks a lot! 
 
> By the way, it seems ritz 0.5.0 does not work with Lein 1. I'm wondering if
> Ritz is planned to support Lein 2 only from then on?

I broke it unintentionally - I wonder how many are still using lein1.
Continuing to support lein 1 is obviously more complicated, but should
be feasible.
I got it. Now I'm trying to switch to lein 2. Thanks again.
Reply all
Reply to author
Forward
0 new messages