Tim Sauerwein
2017-09-01 23:02:56 UTC
My experiences with trial use of Datomic have been very positive so far.
However, I had some difficulties attempting to integrate the Datomic peer
library with a Luminus web app.
The first symptom was a StackOverflowError during Clojure compilation of
the datomic.api namespace. I tried increasing the JVM thread stack size
(by using :jvm-opts in the project.clj file) but then encountered a problem
related to logging. The symptom is that SLF4J reports two different
relevant jar files on the classpath (they are log4j-over-slf4j.jar and
slf4j-log4j12.jar), also with a notice that this problem is pre-empting the
StackOverflowError. (At this point my hope was that the StackOverflowError
happens because the multiple jar files are causing SLF4J to loop, instead
of the overflow being a separate problem.)
I found a place in the Datomic docs which describes how to control logging
in the Datomic peer library. I followed the directions there by adding
exclusions in the project.clj file (like this: [com.datomic/datomic-pro
"0.9.5561" :exclusions [org.slf4j/slf4j-nop org.slf4j/slf4j-log4j12]]) but I
found (by using lein deps :tree) that the peer library still brings in
log4j-over-slf4j (it is noted as: [org.slf4j/log4j-over-slf4j "1.7.7"
:scope "runtime"] in the report). So I tried adding org.slf4j/log4j-over-slf4j
to the :exclusions list. Now the application starts up without the logging
failure or a StackOverflowError, although there is still an error message
(which I was seeing before but paying less attention to) that says "No
log4j2 configuration file found. Using default configuration: logging only
errors to the console."
This configuration is not sanctioned by the Datomic documentation as far as
I know, but at least the app runs now. I got rid of the increased thread
stack size; it does not seem to matter.
I hope that this report will be useful to others.
However, I had some difficulties attempting to integrate the Datomic peer
library with a Luminus web app.
The first symptom was a StackOverflowError during Clojure compilation of
the datomic.api namespace. I tried increasing the JVM thread stack size
(by using :jvm-opts in the project.clj file) but then encountered a problem
related to logging. The symptom is that SLF4J reports two different
relevant jar files on the classpath (they are log4j-over-slf4j.jar and
slf4j-log4j12.jar), also with a notice that this problem is pre-empting the
StackOverflowError. (At this point my hope was that the StackOverflowError
happens because the multiple jar files are causing SLF4J to loop, instead
of the overflow being a separate problem.)
I found a place in the Datomic docs which describes how to control logging
in the Datomic peer library. I followed the directions there by adding
exclusions in the project.clj file (like this: [com.datomic/datomic-pro
"0.9.5561" :exclusions [org.slf4j/slf4j-nop org.slf4j/slf4j-log4j12]]) but I
found (by using lein deps :tree) that the peer library still brings in
log4j-over-slf4j (it is noted as: [org.slf4j/log4j-over-slf4j "1.7.7"
:scope "runtime"] in the report). So I tried adding org.slf4j/log4j-over-slf4j
to the :exclusions list. Now the application starts up without the logging
failure or a StackOverflowError, although there is still an error message
(which I was seeing before but paying less attention to) that says "No
log4j2 configuration file found. Using default configuration: logging only
errors to the console."
This configuration is not sanctioned by the Datomic documentation as far as
I know, but at least the app runs now. I got rid of the increased thread
stack size; it does not seem to matter.
I hope that this report will be useful to others.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.