appengine-plugins icon indicating copy to clipboard operation
appengine-plugins copied to clipboard

ClassNotFoundException when JVM tearing down

Open chanseokoh opened this issue 5 years ago • 8 comments

Probably for the same reason as https://github.com/GoogleContainerTools/jib/issues/2016. I think this clean-up hook never really worked.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.699 s
[INFO] Finished at: 2020-01-03T21:23:12+05:30
[INFO] Final Memory: 12M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.2.0:run (default-cli) on project helloworld: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:2.2.0:run failed: com.google.cloud.tools.managedcloudsdk.command.CommandExitException: Process failed with exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: com/google/common/io/RecursiveDeleteOption
        at com.google.cloud.tools.managedcloudsdk.components.WindowsBundledPythonCopier.deleteCopiedPython(WindowsBundledPythonCopier.java:82)
        at com.google.cloud.tools.managedcloudsdk.components.WindowsBundledPythonCopier.lambda$copyPython$0(WindowsBundledPythonCopier.java:58)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.google.common.io.RecursiveDeleteOption
        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)
        ... 3 more

chanseokoh avatar Jan 28 '20 18:01 chanseokoh

I noticed that there is a similar problem at https://github.com/GoogleContainerTools/jib. Perhaps we can refer to this issue to find more context about the bug. Or maybe this can help us find the faulty lines and we can also refer to the fix for the bug?

JenniferJohnson89 avatar Aug 26 '20 11:08 JenniferJohnson89

Yes, I'm pretty sure it's the same issue. The shutdown hook doesn't work as I originally expected.

https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/a2aaa0bea3df8a0720e6fad9886337c90f49b090/src/main/java/com/google/cloud/tools/managedcloudsdk/components/WindowsBundledPythonCopier.java#L57-L59

https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/a2aaa0bea3df8a0720e6fad9886337c90f49b090/src/main/java/com/google/cloud/tools/managedcloudsdk/components/WindowsBundledPythonCopier.java#L75-L87

chanseokoh avatar Aug 26 '20 13:08 chanseokoh

close as not planned

JoeWang1127 avatar Aug 12 '22 13:08 JoeWang1127

This stack trace has been spotted in the wild again, on a windows build in GoogleCloudPlatform/app-maven-plugin#480?. I wonder if referencing RecursiveDeleteOption.ALLOW_INSECURE in WindowsBundledPythonCopier in a class field, or anywhere else that runs before JVM shutdown, might be an easy workaround. If not, then a similar solution as in Jib applies.

elefeint avatar Sep 29 '22 18:09 elefeint

hmm, @elefeint I think you meant app-maven-plugin#480?

zhumin8 avatar Oct 17 '22 21:10 zhumin8

Updated, thanks!

elefeint avatar Oct 18 '22 13:10 elefeint

@craigmit the error is about deleting temporary local files on your laptop. It has nothing to do with any online files or apps.

chanseokoh avatar Feb 17 '24 01:02 chanseokoh

@craigmit the error is about deleting temporary local files on your laptop. It has nothing to do with any online files or apps.

Ah, thanks. I misunderstood. Post deleted. Cheers.

craigmit avatar Feb 17 '24 02:02 craigmit