This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-10
Channels
- # announcements (1)
- # asami (44)
- # babashka (62)
- # beginners (84)
- # calva (42)
- # cider (5)
- # clj-kondo (32)
- # cljs-dev (8)
- # clojure (61)
- # clojure-australia (3)
- # clojure-berlin (1)
- # clojure-europe (12)
- # clojure-japan (3)
- # clojure-nl (4)
- # clojure-serbia (5)
- # clojure-spec (1)
- # clojure-uk (9)
- # clojurescript (31)
- # community-development (21)
- # conjure (5)
- # cursive (17)
- # datomic (14)
- # emacs (10)
- # etaoin (1)
- # figwheel-main (1)
- # fulcro (9)
- # garden (5)
- # graalvm (16)
- # helix (7)
- # honeysql (13)
- # jackdaw (25)
- # jobs (2)
- # lsp (21)
- # malli (25)
- # missionary (2)
- # mount (3)
- # off-topic (12)
- # practicalli (3)
- # re-frame (43)
- # reagent (45)
- # reitit (36)
- # releases (6)
- # remote-jobs (2)
- # reveal (28)
- # rewrite-clj (7)
- # shadow-cljs (45)
- # slack-help (4)
- # spacemacs (5)
- # sql (23)
- # startup-in-a-month (7)
- # tools-deps (59)
- # vim (26)
Hi, i wonder how i can include a file (xsd) the native-image ? I did try -H:IncludeResources='.*/Resource.*txt$ and then try to use (io/resource "Resource.txt") but it doesn't work
I needed to included a resource file on clojure-lsp called CLOJURE_LSP_VERSION
and this way works: https://github.com/clojure-lsp/clojure-lsp/blob/master/resources/META-INF/native-image/clojure-lsp/clojure-lsp/native-image.properties#L8
Here is also an example: https://github.com/clj-kondo/clj-kondo/blob/7bad82031e3b466ece4562baccece587f1d9345e/script/compile#L20
Ok many thanks can't make it work and i have almost the samle structure. I'll see with you compilation parameters if i miss something
It is ok now i found my error ... Many thanks to you both, for the quick help and for the faboulous tools you bring to clojure !!!!
Note that the resource pattern must be relative to your classpath, not your working dir
Also i have this code that work with lein run but not once compiled as native-image (InputSource. (http://clojure.java.io/input-stream (.getBytes data)))
** ERROR: **
Exception: #error {
:cause No matching field found: getBytes for class java.lang.String
:via
[{:type java.lang.IllegalArgumentException
:message No matching field found: getBytes for class java.lang.String
:at [clojure.lang.Reflector getInstanceField Reflector.java 397]}]
:trace
[[clojure.lang.Reflector getInstanceField Reflector.java 397]
[clojure.lang.Reflector invokeNoArgInstanceMember Reflector.java 440]
[sm_validator_cli.core$create_xml_doc invokeStatic core.clj 43]
@U0F7M1KA7 You need to avoid reflection warnings with (set! *warn-on-reflection* true)
Typehint seems to work for this part (InputSource. (http://clojure.java.io/input-stream (.getBytes ^java.lang.String data)))
now i have
(InputSource. ( (.getBytes data))) ** ERROR: **
Exception: #error {
:cause org.apache.xerces.parsers.ObjectFactory
:via
[{:type java.lang.NoClassDefFoundError
:message nil
:at [org.apache.xerces.parsers.ObjectFactory class$ nil -1]}
{:type java.lang.ClassNotFoundException
:message org.apache.xerces.parsers.ObjectFactory
:at [com.oracle.svm.core.hub.ClassForNameSupport forName ClassForNameSupport.java 60]}]
:trace
[[com.oracle.svm.core.hub.ClassForNameSupport forName ClassForNameSupport.java 60]