<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged error;clojure</title>
<link>https://ask.clojure.org/index.php/tag/error%3Bclojure</link>
<description></description>
<item>
<title>&quot;Unable to resolve symbol&quot; after using Var.pushThreadBindings in a second thread</title>
<link>https://ask.clojure.org/index.php/11482/unable-resolve-symbol-after-pushthreadbindings-second-thread</link>
<description>&lt;p&gt;In &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/cnuernber/dtype-next/issues/52&quot;&gt;https://github.com/cnuernber/dtype-next/issues/52&lt;/a&gt; we are planning to make interoperability between java, clojure and other non-jvm-languages easier when using machine learning libraries that are written in clojure. We also want to create an efficient path for dataframes and ndarrays into julia (libjulia-clj) and python (libpython-clj).&lt;/p&gt;
&lt;p&gt;I have made some significant progress with clojure integration from java here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/invesdwin/invesdwin-context/blob/master/invesdwin-context-parent/invesdwin-context-clojure/src/main/java/de/invesdwin/context/clojure/pool/&quot;&gt;https://github.com/invesdwin/invesdwin-context/blob/master/invesdwin-context-parent/invesdwin-context-clojure/src/main/java/de/invesdwin/context/clojure/pool/&lt;/a&gt;&lt;br&gt;
(test cases to reproduce the issue are in the same project)&lt;/p&gt;
&lt;p&gt;It seems single threaded tests run fine now, but when using more than 1 thread the bindings don't seem to work. From what I read clojure should use threadlocals for namespace variables. But maybe I am missing some system property to isolate everything properly? (similar to jruby's org.jruby.embed.localcontext.scope=threadsafe; &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jruby/jruby/wiki/RedBridge#Context_Instance_Type&quot;&gt;https://github.com/jruby/jruby/wiki/RedBridge#Context_Instance_Type&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Am I doing something wrong or is clojure not capable to be called from multiple threads in parallel without namespace conflicts?&lt;br&gt;
It seems clojure binds itself to the first thread that initialized it and any other thread runs into binding errors:&lt;br&gt;
&lt;img src=&quot;https://user-images.githubusercontent.com/332937/149600047-cf9e8767-02a5-449d-ade1-2106af393c12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;As a workaround I could keep interaction with clojure limited to a single thread and delegate script executions to that single thread via an executor. Though it would be more efficient if the thread local isolation of clojure worked with more than one thread.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11482/unable-resolve-symbol-after-pushthreadbindings-second-thread</guid>
<pubDate>Sat, 15 Jan 2022 13:03:57 +0000</pubDate>
</item>
<item>
<title>Exception in thread &quot;main&quot; java.lang.RuntimeException: Unable to find static field:</title>
<link>https://ask.clojure.org/index.php/11333/exception-thread-main-runtimeexception-unable-static-field</link>
<description>&lt;p&gt;Hey, i`'m still very green in clojure and Java but i want to use this git repo &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/setzer22/alignment_model_text&quot;&gt;https://github.com/setzer22/alignment_model_text&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;when i execute the Installation script i get the followign error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [INFO] --- clojure-maven-plugin:1.8.4:compile (clojure-compile) @ modelvsdocument ---
Compiling edu.upc.modelvsdocument.extraction.common to /home/user/alignment_model_text-master/modelvsdocument/target/classes
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean?
Exception in thread &quot;main&quot; java.lang.RuntimeException: Unable to find static field: IDENT in class edu.upc.Jfreeling.AnalysisLevel, compiling:(edu/upc/nlp4bpm_commons/Freeling.clj:51:8)
        at clojure.lang.Compiler.analyze(Compiler.java:6720)
        at clojure.lang.Compiler.analyze(Compiler.java:6657)
        at clojure.lang.Compiler$MapExpr.parse(Compiler.java:3072)
        at clojure.lang.Compiler.analyze(Compiler.java:6709)
        at clojure.lang.Compiler.analyze(Compiler.java:6657)
        at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3767)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6921)
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So i googled and tried to fix that, but i'm not really sure about the exact problem.&lt;/p&gt;
&lt;p&gt;Does anyone know what causes such an error? And maybe have some tips to solve this?&lt;/p&gt;
&lt;p&gt;Thank you very much!&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11333/exception-thread-main-runtimeexception-unable-static-field</guid>
<pubDate>Tue, 30 Nov 2021 08:45:56 +0000</pubDate>
</item>
</channel>
</rss>