War is created by lein-immutant
https://github.com/juxt/joplin/blob/v0.2.5/joplin.core/src/joplin/core.clj#L83
(classpath/classpath-jarfiles)
returns empty collection so this code can't find any migrations
have anybody managed to make this function work under wildfly?
Implementation of classpath-jarfiles https://github.com/clojure/java.classpath/blob/master/src/main/clojure/clojure/java/classpath.clj#L87
@edvorg: can you get the output of (clojure.java.classpath/classpath)
?
Hello @tcrawley . I'm sorry for the delay. This function gives me only some system-wide and wildfly jars
(#object[java.io.File 0x28ddc6d6 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/src.zip"] #object[java.io.File 0x6ae2c1bd "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/tools.jar"] #object[java.io.File 0x2beaf450 "/Users/edvorg/Documents/raven/scripts/deploy/wildfly-10.0.0.Final/jboss-modules.jar"] #object[java.io.File 0x4770e765 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/cldrdata.jar"] #object[java.io.File 0x1dd722b "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/dnsns.jar"] #object[java.io.File 0x7dceb484 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/jaccess.jar"] #object[java.io.File 0x1fa9719 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/jfxrt.jar"] #object[java.io.File 0x4171038c "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/localedata.jar"] #object[java.io.File 0x2bd76da3 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/nashorn.jar"] #object[java.io.File 0x233586c9 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/sunec.jar"] #object[java.io.File 0x76229fe9 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar"] #object[java.io.File 0x3f869fc2 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar"] #object[java.io.File 0x2f2c47e4 "/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/ext/zipfs.jar"] #object[java.io.File 0x20a09f06 "/System/Library/Java/Extensions/AppleScriptEngine.jar"] #object[java.io.File 0x421f912c "/System/Library/Java/Extensions/dns_sd.jar"] #object[java.io.File 0x49ec6e22 "/System/Library/Java/Extensions/j3daudio.jar"] #object[java.io.File 0x432039c "/System/Library/Java/Extensions/j3dcore.jar"] #object[java.io.File 0x204ef4b3 "/System/Library/Java/Extensions/j3dutils.jar"] #object[java.io.File 0x1e669767 "/System/Library/Java/Extensions/jai_codec.jar"] #object[java.io.File 0x345167f7 "/System/Library/Java/Extensions/jai_core.jar"] #object[java.io.File 0x20ebac02 "/System/Library/Java/Extensions/libAppleScriptEngine.jnilib"] #object[java.io.File 0x77573fc0 "/System/Library/Java/Extensions/libJ3D.jnilib"] #object[java.io.File 0x5d2053e2 "/System/Library/Java/Extensions/libJ3DAudio.jnilib"] #object[java.io.File 0x62f1e96e "/System/Library/Java/Extensions/libJ3DUtils.jnilib"] #object[java.io.File 0x1f87c28e "/System/Library/Java/Extensions/libmlib_jai.jnilib"] #object[java.io.File 0x51605781 "/System/Library/Java/Extensions/mlibwrapper_jai.jar"] #object[java.io.File 0xe80a10c "/System/Library/Java/Extensions/MRJToolkit.jar"] #object[java.io.File 0x6357832b "/System/Library/Java/Extensions/vecmath.jar"] #object[java.io.File 0x42e5ae7d "/usr/lib/java/libjdns_sd.jnilib"])
I don't see our application jar in this list.. Do you have an idea how could we fix it?we had http://dev.clojure.org/jira/browse/CLASSPATH-5 added to address this specifically, but it may be the case that we didn't ever implement the URLClasspath
protocol in Immutant
checking on that now
@edvorg: what version of Immutant are you using?
we extend the URLClassloader
protocol in 2.1.0 and newer
2.1.0
@edvorg: I can recreate it here. I'll need to do some digging
Any help is needed from my side? I can try to create a minimal project demonstrating an issue..
no, but thanks! I have a minimal project already
ah, nice, thanks
@edvorg: I have a workaround for you, but first, some background why this is happening
inside WildFly, the jars inside the war are never extracted to disk, so they aren't Files, which is why they aren't visible to java.classpath
we can make them files, though, by deploying the war file exploded
to do that, you would create a foo.war/
dir in $WILDFLY_HOME/standalone/deployments/
then unzip
foo.war
inside the foo.war/
directory
then touch $WILDFLY_HOME/standalone/deployments/foo.war.dodeploy
that will cause the jars in the war to be treated as files
but, there is a bug in Immutant that prevents them from being visible
so you have to patch a function inside immutant, like so:
(defn -main [& args]
(alter-var-root #'immutant.wildfly/vfs->file
(constantly
(fn [url]
(if-let [match (and url (re-find #"^vfs(:.*)/?" (.toExternalForm url)))]
(URL. (str "file" (last match)))
url))))
(pp/pprint (cp/classpath)))
alternatively, if there is a way to give joplin a list of the migrations, you could io/resource
each one to create a list of resource urls
@tcrawley: Thank you very much for your rapid help! We will try that soon
@tcrawley: Thank you once more, it helped