stuartsierra/component

System fails to start with clojure 1.8.0-RC4

martinhynar opened this issue · 4 comments

I tried to run my system with latest clojure 1.8.0-RC4 and got this error:

Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IMapEntry, compiling:(/tmp/form-init4056328453855830101.clj:1:73)
    at clojure.lang.Compiler.load(Compiler.java:7391)
    at clojure.lang.Compiler.loadFile(Compiler.java:7317)
    at clojure.main$load_script.invokeStatic(main.clj:275)
    at clojure.main$init_opt.invokeStatic(main.clj:277)
    at clojure.main$init_opt.invoke(main.clj:277)
    at clojure.main$initialize.invokeStatic(main.clj:308)
    at clojure.main$null_opt.invokeStatic(main.clj:342)
    at clojure.main$null_opt.invoke(main.clj:339)
    at clojure.main$main.invokeStatic(main.clj:421)
    at clojure.main$main.doInvoke(main.clj:384)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IMapEntry
    at com.stuartsierra.component.SystemMap.entryAt(component.clj:174)
    at clojure.lang.RT.find(RT.java:821)
    at clojure.core$select_keys.invokeStatic(core.clj:1497)
    at clojure.core$select_keys.invoke(core.clj:1490)
    at com.stuartsierra.component$dependency_graph.invokeStatic(component.clj:104)
    at com.stuartsierra.component$dependency_graph.invoke(component.clj)
    at com.stuartsierra.component$update_system.invokeStatic(component.clj:133)
    at com.stuartsierra.component$update_system.doInvoke(component.clj)
    at clojure.lang.RestFn.invoke(RestFn.java:445)
    at com.stuartsierra.component$start_system.invokeStatic(component.clj:162)
    at com.stuartsierra.component$start_system.invoke(component.clj)
    at com.stuartsierra.component$start_system.invokeStatic(component.clj:160)
    at com.stuartsierra.component$start_system.invoke(component.clj)
    at com.stuartsierra.component.SystemMap.start(component.clj:177)
    at funnel.bin.service$_main.invokeStatic(service.clj:97)
    at funnel.bin.service$_main.doInvoke(service.clj)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:379)
    at user$eval2574.invokeStatic(form-init4056328453855830101.clj:1)
    at user$eval2574.invoke(form-init4056328453855830101.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6917)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    ... 14 more

Running with clojure 1.8.0-RC3 and lower has no problems. I tried this with component 0.3.1 and 0.2.3

@martinhynar in my current project, i don't encounter that problem.

my app uses Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13, org.clojure/clojure "1.8.0-RC4", and com.stuartsierra/component "0.3.1"

I cannot reproduce this failure. The unit tests pass on Clojure 1.8.0-RC4.

If you have a minimal reproducible test case, please let me know.

Compilation errors like this are often caused by stale AOT-compiled .class files. Make sure you are running with a clean source tree.

Sorry for not responding earlier, you know holiday season.
It happened on my project that is not a toy project so I need to setup something smaller that will demonstrate this. Regarding AOT, cleaning the project did not help. Anyway, let me try to setup example project.

I tried with freshly released clojure 1.8.0 and problem disappeared.