Compilation error when starting the eclipse plugin. Unable to find libraries, although they are all there

I develop a plugin for eclipse and from time to time (yes, sometimes it works, sometimes not. Then I need to clean up the project and restart everything.) When I activate it, the following error appears:

Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle DeepRefactoring (501). at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:116) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174) ... 49 more Caused by: org.osgi.framework.BundleException: Error starting module. at org.eclipse.osgi.container.Module.doStart(Module.java:580) at org.eclipse.osgi.container.Module.start(Module.java:439) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107) ... 59 more Caused by: java.lang.Error: Unresolved compilation problems: The import org.eclipse cannot be resolved The import org.eclipse cannot be resolved The import org.osgi cannot be resolved AbstractUIPlugin cannot be resolved to a type BundleContext cannot be resolved to a type BundleContext cannot be resolved to a type ImageDescriptor cannot be resolved to a type The method imageDescriptorFromPlugin(String, String) is undefined for the type Activator at deeprefactoring.Activator.<init>(Activator.java:7) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:755) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:706) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319) at org.eclipse.osgi.container.Module.doStart(Module.java:571) ... 62 more 

All libraries are present (there are no compilation errors in the project).

Do you have any ideas from which this could come from?

EDIT:

OK, so I found a solution: I had a plug-in project not only in my original workspace, but also in the work environment. For some reason there (in the working environment) failed to compile projects, he had errors. After closing the instance, the project somehow remembered that it had errors, and so now it was also impossible to start from the original workspace. It seems like cleaning up the project. Other solutions may include: deleting or closing the project in the workspace, or disabling automatic assembly there.

+1
source share

Source: https://habr.com/ru/post/1237662/


All Articles