Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded Clojure to 1.8 and now I see this java.lang.NoClassDefFoundError for HeaderMap #335

Closed
JMacLulich opened this issue Oct 5, 2016 · 9 comments

Comments

@JMacLulich
Copy link

JMacLulich commented Oct 5, 2016

Hi Guys,

I'm trying to figure out what the has caused this error to appear in my project after bumping up the version of Clojure from 1.7 to 1.8 in my project.

I now get this error whenever I try and require the clj-http package.

Caused by: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap

I think its got something to do with interactions with clj-oauth or some other OAuth library I'm using that is importing an older version of clj-http. clj-oauth for instance includes clj-http v2.0.2.

Has anyone seen this error before when updating their version of Clojure?

Thanks, Jason.

@JMacLulich
Copy link
Author

Just to expand on the error above, I get this:

1. Caused by java.lang.NoClassDefFoundError
   IllegalName:
   compile__stub.clj_http.headers.clj-http.headers/HeaderMap

@dakrone
Copy link
Owner

dakrone commented Oct 13, 2016

Sounds like it might be something that causing bad dependencies? What does lein deps :tree spit out?

@s4s0l
Copy link

s4s0l commented Feb 15, 2017

Same for me, using gradle not lein but effect as described above:

+--- org.clojure:clojure:1.8.0
\--- clj-http:clj-http:2.3.0
     +--- org.apache.httpcomponents:httpcore:4.4.5
     +--- org.apache.httpcomponents:httpclient:4.5.2
     |    +--- org.apache.httpcomponents:httpcore:4.4.4 -> 4.4.5
     |    +--- commons-logging:commons-logging:1.2
     |    \--- commons-codec:commons-codec:1.9 -> 1.10
     +--- org.apache.httpcomponents:httpmime:4.5.2
     |    \--- org.apache.httpcomponents:httpclient:4.5.2 (*)
     +--- commons-codec:commons-codec:1.10
     +--- commons-io:commons-io:2.5
     +--- slingshot:slingshot:0.12.2
     \--- potemkin:potemkin:0.4.3
          +--- clj-tuple:clj-tuple:0.2.2
          \--- riddley:riddley:0.1.12

@dakrone
Copy link
Owner

dakrone commented Feb 28, 2018

For the users still seeing this, do you still see it upon upgrading to clj-http in the 3.x series?

@jiacai2050
Copy link
Contributor

3.9.0 still have this issue

Caused by: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:654)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
	at clojure.lang.DynamicClassLoader.defineClass(DynamicClassLoader.java:46)
	at clojure.lang.Compiler$NewInstanceExpr.compileStub(Compiler.java:7903)
	at clojure.lang.Compiler$NewInstanceExpr.build(Compiler.java:7768)
	at clojure.lang.Compiler$NewInstanceExpr$DeftypeParser.parse(Compiler.java:7678)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)

@jiacai2050
Copy link
Contributor

jiacai2050 commented May 29, 2018

After digging into this issue, I have found the root cause:

Briefly speaking, clojure 1.8's change affect potemkin, and is already fixed in clj-commons/potemkin#40.
clj-http(3.9.0) depends on potemkin 0.4.5, which contains the fix, but if your dependencies contains older version of potemkin, then you will probably see this issue.

I'm not sure which is the earliest version contains the fix, but 0.4.5 surely do.

@JMacLulich
Copy link
Author

Thanks for the update guys, I have to admit i did loose track of this ticket after filing it, but appreciate the continued updates over the years.

@jiacai2050
Copy link
Contributor

@JMacLulich Close now?

@dakrone
Copy link
Owner

dakrone commented May 30, 2018

Sounds like this is resolved, so I'm going to close this for now

@dakrone dakrone closed this as completed May 30, 2018
deckeraa added a commit to deckeraa/clj-stripe that referenced this issue Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants