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

Handle NoClassDefFoundError when determining class type #186

Closed
wants to merge 2 commits into from

Conversation

plexus
Copy link
Contributor

@plexus plexus commented Jan 22, 2017

When resolve-missing gets a number of candidate classes, it will load them to
determine the type (Clojure type/record vs regular Java class). However a class
on the classpath may be compiled with dependencies that are not currently
present, causing the loading to fail.

This would cause the whole operation to fail, instead this change handles the
exception, takes it as a sign that it's a regular Java class, and continues.

For example, I do a resolve-missing on the symbol URL, this yields two
candidates: java.net.URL, and
com.gargoylesoftware.htmlunit.javascript.host.URL. The latter depends on
org.w3c.dom.ElementTraversal, which is not currently present, causing a
NoClassDefFoundError.

Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • All tests are passing (run lein do clean, test)
  • Code inlining with mranderson works and tests pass with inlined code (run ./build.sh install -- takes a long time)
  • You've updated the changelog (if adding/changing user-visible functionality)

Thanks!

plexus and others added 2 commits January 22, 2017 13:47
When `resolve-missing` gets a number of candidate classes, it will load them to
determine the type (Clojure type/record vs regular Java class). However a class
on the classpath may be compiled with dependencies that are not currently
present, causing the loading to fail.

This would cause the whole operation to fail, instead this change handles the
exception, takes it as a sign that it's a regular Java class, and continues.

For example, I do a `resolve-missing` on the symbol URL, this yields two
candidates: `java.net.URL`, and
`com.gargoylesoftware.htmlunit.javascript.host.URL`. The latter depends on
`org.w3c.dom.ElementTraversal`, which is not currently present, causing a
`NoClassDefFoundError`.
@expez
Copy link
Member

expez commented Jan 22, 2017

Merged this one manually after trying the 'resolve conflicts' button on github and getting an unexpected result.

Thanks for the patch! 👍

@expez expez closed this Jan 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants