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

[BUG] Classpath problems with ThinFatJar #696

Open
1 task done
zzeekk opened this issue Dec 16, 2022 · 5 comments
Open
1 task done

[BUG] Classpath problems with ThinFatJar #696

zzeekk opened this issue Dec 16, 2022 · 5 comments

Comments

@zzeekk
Copy link

zzeekk commented Dec 16, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Using Spark-Excel 0.18.5 with Spark 3.3.1 in IntellJ, and get the following exception:
java.lang.NoSuchMethodError: org.apache.logging.log4j.util.LoaderUtil.getClassLoaders()[Ljava/lang/ClassLoader;

The problems seems to be that Spark 3.3.1 has Log4j 2.17.2 as dependency, but Spark-Excel has shaded Log4J 2.19.0 into its jar (without renaming!). And there are many more dependencies shaded into it, even scala:
image

Shading in dependencies without renaming makes dependency management with Maven impossible. It potentially produces weird NoSuchMethodError and ClassNotFoundExceptions as conflicting versions are easily present in the classpath. Best practice is to let Maven solve dependencies, or rename shaded dependencies and remove them from the pom.

Why is it done like that for spark-excel?

Fixing this should make spark-excel much more compatible in my opinion.

Expected Behavior

  1. The default artifact published by spark-excel does not include any shaded dependency (or they are renamed). Needed maven dependencies are listed in the pom as currently done.
  2. An artifact including shaded dependencies can additionally be created and published using maven classifier. The classifier, e.g. "shaded", is then included in the published jar file, e.g. spark-excel_2.12-shaded-3.3.1_0.18.5.

Steps To Reproduce

No response

Environment

- Spark version: 3.3.1
- Spark-Excel version: 0.18.5
- OS: Windows
- Cluster environment: IntelliJ

Anything else?

No response

@nightscape
Copy link
Owner

Hi @zzeekk, PRs to improve the packaging are very welcome!
The current build uses Mill, so the build.sc file would be the appropriate place for any fixes.

@zzeekk
Copy link
Author

zzeekk commented Dec 18, 2022

Great, will look into it.

@christianknoepfle
Copy link
Contributor

See also #654

@zzeekk
Copy link
Author

zzeekk commented Dec 20, 2022

Created PR #697, please check

@zzeekk
Copy link
Author

zzeekk commented Jan 20, 2023

Hi @nightscape, i finalized my tests on release 0.18.6-beta1, looks good to me.
I have one more suggestion about the version number scheme, please see 0.18.6-beta1

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

No branches or pull requests

3 participants