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

random NoClassDefFoundError: org/apache/log4j/Layout #568

Open
danischroeter opened this issue Aug 20, 2021 · 2 comments
Open

random NoClassDefFoundError: org/apache/log4j/Layout #568

danischroeter opened this issue Aug 20, 2021 · 2 comments

Comments

@danischroeter
Copy link

hi there

until today scalaxb worked fine for me but (I really have no idea why) it started failing today with

[error] java.lang.NoClassDefFoundError: org/apache/log4j/Layout
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$1(ScalaxbCompile.scala:22)
[error]         at scala.Option.map(Option.scala:230)
[error]         at sbtscalaxb.ScalaxbCompile$.compile$1(ScalaxbCompile.scala:20)
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$4(ScalaxbCompile.scala:30)
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$4$adapted(ScalaxbCompile.scala:29)
[error]         at sbt.util.Tracked$.$anonfun$outputChangedW$1(Tracked.scala:128)
[error]         at sbtscalaxb.ScalaxbCompile$.apply(ScalaxbCompile.scala:36)
[error]         at sbtscalaxb.ScalaxbPlugin$.$anonfun$baseScalaxbSettings$7(ScalaxbPlugin.scala:41)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[error]         at java.base/java.lang.Thread.run(Thread.java:832)
[error] Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
[error]         at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
[error]         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
[error]         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$1(ScalaxbCompile.scala:22)
[error]         at scala.Option.map(Option.scala:230)
[error]         at sbtscalaxb.ScalaxbCompile$.compile$1(ScalaxbCompile.scala:20)
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$4(ScalaxbCompile.scala:30)
[error]         at sbtscalaxb.ScalaxbCompile$.$anonfun$apply$4$adapted(ScalaxbCompile.scala:29)
[error]         at sbt.util.Tracked$.$anonfun$outputChangedW$1(Tracked.scala:128)
[error]         at sbtscalaxb.ScalaxbCompile$.apply(ScalaxbCompile.scala:36)
[error]         at sbtscalaxb.ScalaxbPlugin$.$anonfun$baseScalaxbSettings$7(ScalaxbPlugin.scala:41)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[error]         at java.base/java.lang.Thread.run(Thread.java:832)

The same sbt build works on our buildsystem and for my colleagues. The exact same project worked for me before.
I already redownloaded all dependencies etc.

Additionally adding libraryDependencies += "log4j" % "log4j" % "1.2.17" to my build also did not help. But log4j should be needed anyway only for the plugin to run.

@eed3si9n
Copy link
Owner

You might be missing some specific version of log4j? Do you have any machine-specific plugins you use for example to load things into IDEs?

@danischroeter
Copy link
Author

I already checked that log4j is downloaded and present (coursier dir).
I also already disabled all custom plugins but without any change...

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

2 participants