Fork me on GitHub
#cursive
<
2021-12-06
>
AJ Jaro17:12:00

When generating stubs in IntelliJ version 2021.3 and Cursive 1.12.1-2021.3 I receive an error in this thread. How can I resolve this?

AJ Jaro17:12:46

java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at clojure.lang.RT.loadClassForName(RT.java:2239)
at clojure.lang.RT.load(RT.java:449)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cursive.stubs.metadata.clojure$read_ns.invokeStatic(clojure.clj:65)
at cursive.stubs.metadata.clojure$read_ns.invoke(clojure.clj:64)
at user$eval259.invokeStatic(create-stub16236083806959255914.clj:2)
at user$eval259.invoke(create-stub16236083806959255914.clj:2)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.Compiler.loadFile(Compiler.java:7574)
at clojure.lang.RT$3.invoke(RT.java:327)
at user$eval5.invokeStatic(form-init9916428172362789119.clj:1)
at user$eval5.invoke(form-init9916428172362789119.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7167)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.Compiler.loadFile(Compiler.java:7574)
at clojure.main$load_script.invokeStatic(main.clj:475)
at clojure.main$init_opt.invokeStatic(main.clj:477)
at clojure.main$init_opt.invoke(main.clj:477)
at clojure.main$initialize.invokeStatic(main.clj:508)
at clojure.main$null_opt.invokeStatic(main.clj:542)
at clojure.main$null_opt.invoke(main.clj:539)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.lambda.AWSLambdaClient
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at amazonica.aws.lambda__init.__init0(Unknown Source)
at amazonica.aws.lambda__init. (Unknown Source)
... 50 more

cfleming20:12:56

Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.lambda.AWSLambdaClient

cfleming20:12:25

That’s the actual problem, any idea why that wouldn’t be on the classpath? I’m assuming that would be pulled in by Amazonica, right?

AJ Jaro02:12:59

No, it’s a bit confusing. Yes, it is pulled in by Amazonica through our deps.edn. Here’s what we have there. Additionally, I have that class available in the External Libraries section of the project.

amazonica/amazonica             {:mvn/version "0.3.153"}
com.amazonaws/aws-java-sdk-s3   {:mvn/version "1.11.876" :exclusions  [joda-time/joda-time]}

AJ Jaro02:12:30

When I opened that class I could click Download Source and that seemed to resolve the problem. Is that a deps.edn issue then?

cfleming02:12:29

Um, honestly, I’m not sure. I can’t see how downloading the sources would affect that in any way. Are you able to reproduce the problem or is it now working ok?

AJ Jaro22:12:19

I’m not able to reproduce it anymore. It’s a bit odd 🤷

cfleming23:12:28

Well, I think I’m going to file that under “sunspots”.