This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-25
Channels
- # alda (7)
- # aleph (10)
- # announcements (3)
- # babashka (103)
- # beginners (54)
- # calva (62)
- # clerk (2)
- # clj-yaml (27)
- # cljs-dev (1)
- # clojure (61)
- # clojure-europe (64)
- # clojure-nl (3)
- # clojure-norway (34)
- # clojure-sweden (4)
- # clojure-uk (4)
- # conjure (9)
- # cursive (1)
- # data-science (3)
- # fulcro (20)
- # gratitude (1)
- # hyperfiddle (54)
- # lsp (9)
- # malli (7)
- # meander (4)
- # membrane (17)
- # off-topic (23)
- # releases (3)
- # sci (1)
- # shadow-cljs (5)
- # sql (1)
- # tree-sitter (8)
- # vim (6)
Hello, I’m try to figure out this issue running the latest version 1.0.27
Error:
; Execution error (NoSuchMethodError) at clj-yaml.core/make-yaml (core.clj:126).
; org.yaml.snakeyaml.representer.Representer: method <init>()V not found
Code that generates the error:
(defn ^:private load-yaml [fileName]
(-> fileName
(io/resource)
(slurp)
(yaml/parse-string)))
The (yaml/parse-string) generates the error
I’m using latest clj-commons/clj-yaml {:mvn/version "1.0.27"},
Version 1.0.26 works fine.
Runtime code works fine.By runtime, I mean running the application like:
exec java $JAVA_OPTS \
-Dfile.encoding=UTF-8 \
-Dclojure.debug=false \
-jar /app/smoketests-standalone.jar
I’m using clj version Clojure CLI version 1.11.1.1165
Hi @U03EEEB90DV! Does this happen for all YAML you are trying to parse? Do you have a minimal YAML file that you can share so that we can try to reproduce your issue on our computers?
Without knowing more, it feels like there might be some library dependency conflict. Have you looked at your dependency tree? But, that said, share a minimal reproduction and we'll lend a hand.
HI @UE21H2HHD, Yes, I did look at the deps tree. I excluded an older version of snakeyaml, and the error is still there. The problem is, it doesn’t get to the yaml loading yet. It crashes before it parses the file.
it also works for 1.0.26.
would pasting in the deps tree help?
Unfortunately its not. I work for Viasat, and things are all internal. I provided the code above. ☝️ , and any old yaml will do. I can give you the config.clj that contains that code, I don’t think it has proprietary information in it. Would that be enough? Maybe a paired down deps.edn file as well. Would that work?
Let me do that. You may have to tweak things a little bit.
I used the same to reproduce
> You may have to tweak things a little bit. Oh. You are asking too much of me here! I need for you to give me something I can just run here from my computer.
In wanting to know how how to run clojure one liners using just java (not the clojure or clj wrappers) for clj-yaml things I made this little script: https://gist.github.com/ingydotnet/a443d9b9720a5429db7e22d1160e4eb8
Babashka is just an abstraction over Bash. I don't see how using it would help me better understand how Java was being invoked.
When I look at Babashka I see a bunch of clj which could have been bash 😎
But then again I've written large frameworks completely in Bash including a test framework and a packaging framework. So yeah.