Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Plugin unable to find class - ClassNotFoundException
Plugin unable to find class - ClassNotFoundException [message #895407] Thu, 12 July 2012 17:52
Stephen McGruer is currently offline Stephen McGruerFriend
Messages: 4
Registered: June 2012
Junior Member
(Apologies if this is in the wrong place, wasn't sure if this is a Memory Analyzer specific issue or a RCP one.)

I'm currently trying to add a drop-in plugin to the Eclipse Memory Analyzer tool, but am having trouble getting my plugin to find it's class when it's built. When built, my plugin's jar looks like:


My code is contained in my_plugin_lib.jar, which looks like:


The third_party jar contains some third party code.

My MANIFEST.MF file looks like:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: My Plugin
Bundle-SymbolicName: com.example.eclipse.mat;singleton:=true
Bundle-Version: 0.0.0
Require-Bundle: org.eclipse.mat.api;bundle-version="1.2.0",
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: third_party.jar,my_plugin_lib.jar,.
Export-Package: com.example.eclipse.mat,

My is:

source.. = src/
output.. = bin/
bin.includes = META-INF/,\

And, finally, my plugin.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
   <extension id="my_plugin" point="org.eclipse.core.runtime.applications">
         <run class="com.example.eclipse.mat.MyPlugin" />

When I place the my_plugin.jar file under mat/dropins/plugins, and run my application, I just get an error that my class cannot be found:

!SESSION 2012-07-12 10:47:41.423 -----------------------------------------------
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application com.example.eclipse.mat.my_plugin test_heap
Command-line arguments:  -application com.example.eclipse.mat.my_plugin test_heap

!ENTRY org.eclipse.osgi 4 0 2012-07-12 10:47:43.522
!MESSAGE Application error
org.eclipse.core.runtime.CoreException: Plug-in com.example.eclipse.mat was unable to load class com.example.eclipse.mat.MyPlugin.
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.eclipse.equinox.launcher.Main.invokeFramework(
        at org.eclipse.equinox.launcher.Main.basicRun(
        at org.eclipse.equinox.launcher.Main.main(
Caused by: java.lang.ClassNotFoundException: com.example.eclipse.mat.MyPlugin
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(
        at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(
        ... 16 more

Does anyone know what I am doing wrong? Previously I have created a successful plugin that had it's sources directly under com/example/eclipse/mat/..., but the way I am doing it now creates a _lib jar. I thought that that shouldn't be a problem, as I include the jar on the ClassPath, but maybe I was wrong?

Thanks for any help,
Previous Topic:Enable/Disable menu item in eclipse plugin
Next Topic:[Solved] View listen to combobox selection
Goto Forum:

Current Time: Mon Mar 04 00:57:01 GMT 2024

Powered by FUDForum. Page generated in 0.02710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top