This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-27
Channels
- # announcements (5)
- # beginners (267)
- # boot (1)
- # calva (37)
- # cider (11)
- # clara (10)
- # clj-kondo (24)
- # cljsrn (13)
- # clojars (1)
- # clojure (119)
- # clojure-europe (5)
- # clojure-italy (19)
- # clojure-nl (11)
- # clojure-spec (18)
- # clojure-uk (99)
- # clojurescript (44)
- # clojurex (57)
- # community-development (6)
- # cursive (13)
- # datomic (92)
- # duct (12)
- # fulcro (1)
- # graalvm (4)
- # jobs (1)
- # kaocha (6)
- # luminus (3)
- # lumo (9)
- # off-topic (20)
- # pathom (6)
- # re-frame (21)
- # reagent (2)
- # reitit (9)
- # remote-jobs (4)
- # shadow-cljs (32)
- # spacemacs (3)
Is it possible to override the path where the Datomic peer library looks for transactor-key.jks
?
In this case the data store is Dynamo ... so I don't think there is JDBC involved ... but I could definitely be mistaken
The last Datomic item in the stacktrace when it doesn't find the file is datomic.artemis-client/create-session-factory
I didn't make it. It's packaged with Datomic. I learned about it when I got an exception trying to start the peer library in an environment where the class path does not map to the filesystem in the way that the code seems to expect and it could not find the file.
So this file lives at /var/task/datomic/transactor-key.jks
but Artemis/Netty is still looking for /datomic/transactor-key.jks
basing that on this part of the stacktrace I see:
Caused by: java.io.FileNotFoundException: /datomic/transactor-key.jks (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1045)
at org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport.loadKeystore(SSLSupport.java:104)
Looking at code it does look like Artemis gets that URL by calling findResource ... so, yeah, I'm not sure what is going wrong on the lambda that that isn't working.
datomic deps on an older version of artemis which deps on netty-all, which includes every netty class
[com.datomic/datomic-pro "0.9.5786"
:exclusions [org.slf4j/slf4j-nop org.slf4j/slf4j-log4j12
;; netty-all is a netty "uberjar". When combined
;; with other things that depend on netty sub-deps
;; directly, we get duplicate netty classes of
;; different versions on the classpath.
;; In our case, artemis-client-core depends on
;; netty-all 4.0; google-cloud-logging-logback
;; transitively depends on specific netty packages
;; (not netty-all); when combined, we get
;; duplicate netty classes of different versions
;; on the classpath.
;; Solution: exclude netty-all and depend on what
;; artemis *actually* requires. Then maven
;; can resolve the dep tree correctly.
io.netty/netty-all]]
I have even considered repackaging datomic peer lib with a different pom that fixes this issue
;; Source for artemis netty deps:
;;
;; artemis-commons
[io.netty/netty-buffer "4.1.34.Final"]
[io.netty/netty-transport "4.1.34.Final"]
[io.netty/netty-handler "4.1.34.Final"]
;; artemis-core-client
[io.netty/netty-transport-native-epoll "4.1.34.Final" :classifier "linux-x86_64"]
[io.netty/netty-codec-http "4.1.34.Final"]
Looking more at that Artemis validateStoryURL function I am thinking that the DWIM nature of that might explain why it works someplaces and not others
in normal environments, file.exists()
in validateStoreURL
returns false so it falls through to the call to findResource
, which finds it in the jar, and all is well
Lambda unzips the jar into /var/task
which may also be the working directory of the process (not sure) so maybe that causes file.exists()
to return true, so it returns the result of file.toURI().toURL()
instead of calling findResource
I don't have an explanation for why, if that's true, the subsequent call to java.net.URL.openStream
fails
this may not be the right place to ask this question, but does anyone in here have a link to docs or refrence for using the cognitect http-client? I am trying to make use of this library since it’s already in my project, but I cannot for the life of me figure out how to send a request body on an http post. I am setting a :body key on the request that is a java.nio.ByteBuffer, and the API that I’m calling is complaining to me that my request doesn’t have a body. I’d like to avoid switching to another library if I can, but I am a bit nonplussed about how to use this library.
I don’t think there are any docs, but the source is in the jar file
make sure that when you hand in the ByteBuffer, the "read head" (.position) is not at the limit
How have others approached transitive dependency conflicts in datomic cloud? I’m using a library that depends on [email protected]
, while 1.10
(the datomic cloud dependency) causes a compilation error. I recognize it’s more of a JVM soft-spot than anything, I’m mainly curious how others have broached this in cases both where a the conflicting library can be forked and when it cannot.
This instance is, yes. So in the worst case I could fork and maintain a version that works on 1.10
. But I’m also curious about how I’d go about resolving the problem if that weren’t an option. It seems like that would be a difficult position to be in.
Is AOT relevant here? Is that a viable solution path? I’m not familiar enough with the JVM to know whether the conflict would still be experienced
In general, with Ions it has to prefer the Ion's version of a conflict, where there is a conflict
In this case (`clj-multiformats`) it’s a super trivial conflict—`clj-multiformats` uses encodeHexString
with 2 arguments, which isn’t in the 1.10
API.
Right on. Agreed. The whole thing is just a minor bummer, since its such a surface level incompatibility (I believe 1.11 even accretes appropriately)