Class cast exception running gradle clojureRepl

40 views
Skip to first unread message

.Santanu Chakrabarti

unread,
Apr 7, 2015, 3:30:55 PM4/7/15
to cloju...@googlegroups.com
I am using clojuresque 1.7.0. And I am getting a class cast exception as I run "gradle clojureRepl" from command line.

Stack trace
==========

Exception in thread "main" java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
    at clojuresque.tasks.repl$eval905$start_repl_task_driver__907.invoke(repl.clj:11)
    at clojuresque.tasks.repl$eval905$start_repl__910.invoke(repl.clj:9)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.core$apply.invoke(core.clj:624)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojuresque.Driver.main(Driver.java:49)
:clojureRepl FAILED

 
It seems the if statement that checks if the type of port variable is a string is not working.

My gradle.build file
================

buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://clojars.org/repo' }
    }
    dependencies {
        classpath 'clojuresque:clojuresque:1.7.0'
    }
}

apply plugin: 'clojure'

repositories {
    mavenCentral()
    maven { url 'http://clojars.org/repo' }
}

dependencies {
    compile "org.clojure:clojure:1.6.0"
    runtime "org.clojure:tools.nrepl:0.2.10"
}


.Santanu Chakrabarti

unread,
Apr 7, 2015, 3:37:58 PM4/7/15
to cloju...@googlegroups.com
Work around is to add the following in build.gradle file.


clojureRepl {
    port = "7888"
}

janu...@gmail.com

unread,
Aug 24, 2015, 6:02:07 PM8/24/15
to clojuresque
Hi,

Thanks for the workaround. Now it doesn't fail but I can't see the console prompt either. Repl starts at 7888 but I can't enter anything. Any ideas ?

I'm running with both:

./gradlew -q clojureRepl
./gradlew clojureRepl

Cheers

.Santanu Chakrabarti

unread,
Aug 25, 2015, 12:13:37 AM8/25/15
to cloju...@googlegroups.com, janu...@gmail.com

Hi,

Its long back that I did the set up. But what I can remember is that I got the Clojure REPL prompt at the console after this. However I wrote a blog post of my set up activities and my findings. Please refer to that and see if that helps you.

Post is "Clojure with Emacs 23" at https://programmerscratchpad.wordpress.com.

As a side note I shall like to mention that I am using Clojure with Emacs and inf-clojure minor mode.

Thanks and regards
Santanu

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "clojuresque" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/clojuresque/T_FHD9KaOio/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an clojuresque...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

janu...@gmail.com

unread,
Aug 25, 2015, 12:44:01 PM8/25/15
to clojuresque, janu...@gmail.com
Oh, I think I got it wrong.

./gradlew clojureRepl

This runs a repl server on the selected port, but it doesn't return a clojure repl. I could connect then to that server by using leiningen or cider or whatever the clojure client I want to use.

Is there any way to return a local repl ?

.Santanu Chakrabarti

unread,
Aug 25, 2015, 1:13:28 PM8/25/15
to cloju...@googlegroups.com, janu...@gmail.com

Have you got a chance to read my blog post? I referred my gradle.build file there for the requirement that you mentioned.

But there is some issue while you use it from plain command shell probably due to limited console support by Gradle itself. However using this local repl with inf-clojure mode in Emacs is a piece of cake. I am happy using it that way.

Regards
Santanu

Meikel Brandmeyer

unread,
Aug 25, 2015, 4:30:07 PM8/25/15
to cloju...@googlegroups.com
Hi,

having a local level will probably not happen any time soon, since
gradle doesn't support this stdin/stdout passing to some internal
process. I'm sorry about that.

This feature was asked for already in the past, but the gradle team
didn't assign a priority.

Meikel

Am 25.08.2015 um 19:13 schrieb .Santanu Chakrabarti:
> Have you got a chance to read my blog post? I referred my gradle.build
> file there for the requirement that you mentioned.
>
> But there is some issue while you use it from plain command shell
> probably due to limited console support by Gradle itself. However using
> this local repl with inf-clojure mode in Emacs is a piece of cake. I am
> happy using it that way.
>
> Regards
> Santanu
>
> On Aug 25, 2015 10:14 PM, <janu...@gmail.com
> <mailto:clojuresque...@googlegroups.com>.
> Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
>
> --
> Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der
> Gruppe "clojuresque" abonniert haben.
> Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von
> dieser Gruppe erhalten möchten, senden Sie eine E-Mail an
> clojuresque...@googlegroups.com
> <mailto:clojuresque...@googlegroups.com>.

janu...@gmail.com

unread,
Aug 25, 2015, 4:49:35 PM8/25/15
to clojuresque
Bingo!!!

@Santanu Thanks. I first did a quick read and I didn't see it. Now I've seen "repl" task and that's exactly what I was looking for.

@Meikel Why Santanu solution is not good enough ? I'm more than happy having that repl. Executing:

./gradlew -q repl

It prompts the clojure console. It lacks some features, I know (autocompletion for example), but at least you have your code available in the repl ready to go.

BTW Very useful plugin Meikel
>     Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
>
> --
> Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der
> Gruppe "clojuresque" abonniert haben.
> Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von
> dieser Gruppe erhalten möchten, senden Sie eine E-Mail an
> clojuresque...@googlegroups.com

.Santanu Chakrabarti

unread,
Aug 25, 2015, 5:17:01 PM8/25/15
to cloju...@googlegroups.com, janu...@gmail.com
@januslynd You are welcome :-).

>     Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
>
> --
> Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der
> Gruppe "clojuresque" abonniert haben.
> Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von
> dieser Gruppe erhalten möchten, senden Sie eine E-Mail an
> Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "clojuresque" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/clojuresque/T_FHD9KaOio/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an clojuresque...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages