Fork me on GitHub
#cursive
<
2024-02-05
>
Ben Hammond18:02:10

Hi I'm getting a

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at...
at cursive.deps.DepsSettings.getDepsCljVersion(DepsSettings.kt:77
...
when trying to import an existing project. I'm behind a cantankerous corporate firewall, so I am more expecting an Http/403 permission denied kind of error is there some cursive config that has gone awry due to my impaired internet access? or, what can I do to progress this error?

Ben Hammond18:02:14

when I go to settings -> Build,Execution,Deployment -> Build Tools -> Clojure Deps I get a blank page with the writing Select configuration element in the tree to edit its settings Which I assume means it tried to refresh available deps versions but was foiled by the firewall...

Ben Hammond16:02:43

it was a dodgy entry in %AppData%\Roaming\JetBrains\IntelliJIdea2023.3\options\clojure-deps.settings.xml that I had to restor to a version provided by a colleague

cfleming00:02:48

That’s very strange, I guess it might have become confused after upgrading to 1.13 (and the deps.clj change). Is it all working ok now?

Ben Hammond08:02:03

it is, thankyou

Ben Hammond08:02:01

I was missing server credential entries in ~/.m2/settings.xml with the result that every repository request resulted in an http/403 (and maven central repo is blocked by corporate firewall) as a consequence of this, when I hit refresh button on the Clojure Deps settings page the request for deps versions was refused and I ended with with an empty version number array in clojure-deps.settings.xml which then triggers the

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
which I think is unrecoverable without having to manually fix the settings.xml

Ben Hammond08:02:55

that's what I think happened

cfleming17:02:33

Thanks for that, I’ll guard against that exception in the code.

Steffen Glückselig13:06:49

@U793EL04V How did you fix the clojure-deps.settings.xml? Mine seems to be also corrupted...

Ben Hammond13:06:43

in deps.edn I made sure there were :mvn/repos entries that pointed to servers accessible INSIDE the corporate firewall in ~/.m2/settings.xml made sure there were /settings/servers/server entries containing • <id> the key in to the :mvn/repos map • <username> that is acceptable to corporate proxy • <password> munged password that is acceptable to corporate proxy in ~\AppData\Roaming\JetBrains\IntelliJIdea2032.2\options\clojure-deps.settings.xml directly altered file to read


  
    
    
(I am prevented from copy-and-pasting so have manually retyped that - there may be typos)

🙏 1
Ben Hammond13:06:02

It was having that clojure-deps-settings.xml without any list options that really broke things

Ben Hammond13:06:52

but it got there because I was missing Username/Passwords that would permit the corporate maven repo to show me any data

Steffen Glückselig13:06:13

Many thanks. I will work from there!

👍 1
Ryan19:02:04

Trying to run some shadow-cljs tests on a re-frame project automatically on compile.. built in test runner fails Execution error (FileNotFoundException) at cursive.tests.runner/eval233 (run-tests17121268457864433616.clj:81). Could not locate app/core_test__init.class, app/core_test.clj or app/core_test.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. namespace is app.core-test .. node tests is cljs.. shadow-cljs node tests seem to run fine

cfleming00:02:29

Am I correct that you’re trying to run your shadow tests with the Cursive test runner? Unfortunately that only works for Clojure tests right now, not CLJS…

👍 1
Ryan20:02:45

Yup, that’s was I was trying to do 🙂 all good, I can get the tests to run (via the node test running) in shadow cljs, it just lacks the red/green output Im searching for 🙂