Ok, I hit a wall and really did not see this coming.
Based on what I have read, its really easy for Clojure and Java to
work together. So I wrote some test Clojure code with a very simple
defrecord (say named as "testrec") and AOT compile it, create a jar
file, and add it to a "HelloWorld" java project in Eclipse. I can
create object of class "testrec" and run its member functions. Cool,
no problem.
But then I put the same thing into my target Java system (for which I
am consider Clojure for production use), I got
"java.lang.ExceptionInInitializerError" exception when trying to
create my "testrec" object. A little bit more digging suggests this is
related to class loader, which I don't know much about. According to a
web page, I need to do this:
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
before calling the constructor of my "testrec" class. Tried that, but
I got
java.security.AccessControlException: access denied
("java.lang.RuntimePermission" "setContextClassLoader")
Seems I cannot change the context class loader.
What is the solution here?
Sorry for the long post. But I hope this is not a dead end. Thanks a
lot.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en