dart-sass-java icon indicating copy to clipboard operation
dart-sass-java copied to clipboard

Shutdown Hook in BundledCompilerFactory causes NoClassDefFoundError

Open jbb01 opened this issue 2 years ago • 1 comments

I'm trying to run the embedded host from a maven plugin. The build succeeds, but after the BUILD SUCCESS message an error occurs during the shutdown hook running the DirCleaner for the temporary directory containing the bundled dart executable.

Exception in thread "Thread-1" java.lang.NoClassDefFoundError: de/larsgrefer/sass/embedded/bundled/DirCleaner$DeletingFileVisitor
	at de.larsgrefer.sass.embedded.bundled.DirCleaner.run(DirCleaner.java:23)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: de.larsgrefer.sass.embedded.bundled.DirCleaner$DeletingFileVisitor
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 2 more

This appears to be a common problem when using shutdown hooks from inside maven plugins.

A method for running and removing the shutdown hook inside BundledCompilerFactory would probably solve the problem.

jbb01 avatar Feb 07 '24 08:02 jbb01

@larsgrefer Hello, can you create a sass formatter so that the codes can be arranged, I tried several times but it didn't work

appt2 avatar May 23 '24 08:05 appt2