Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » NoClassDefFoundError
NoClassDefFoundError [message #204573] Thu, 12 April 2007 19:09 Go to next message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
I have written a plugin (A) for Eclipse (3.2). It uses classes that are
in another plugin (B). That plugin is composed of the contents of two
other JARs that I imported into Eclipse and wrapped as a plugin (via the
Project Wizard). I then imported plugin into the plugin A project and
all is fine. If I run it via the runtime workbench it works fine. But
I also wrote an updater site. If I install into a test Eclipse
installation it all seems to install fine. All looks OK. Plugin A
works fine, but when it tries to invoke any code from plugin B, I get a
NoClassDefFoundError. The class it complains about is exported in the
manifest of plugin B. Anybody have any suggestions about what I am missing?

Thanks,
Ric
Re: NoClassDefFoundError [message #204811 is a reply to message #204573] Fri, 13 April 2007 22:19 Go to previous messageGo to next message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
Ric Wright wrote:
> I have written a plugin (A) for Eclipse (3.2). It uses classes that are
> in another plugin (B). That plugin is composed of the contents of two
> other JARs that I imported into Eclipse and wrapped as a plugin (via the
> Project Wizard). I then imported plugin into the plugin A project and
> all is fine. If I run it via the runtime workbench it works fine. But
> I also wrote an updater site. If I install into a test Eclipse
> installation it all seems to install fine. All looks OK. Plugin A
> works fine, but when it tries to invoke any code from plugin B, I get a
> NoClassDefFoundError. The class it complains about is exported in the
> manifest of plugin B. Anybody have any suggestions about what I am missing?
>
> Thanks,
> Ric

Well, I thought I might have made progress when I discovered that
normally Eclipse plugins each have their own class loaders so pluginA
wouldn't be able to load classes from Plugin B. But there existed a
"Buddy Class loader" approach in which

Eclipse-BuddyPolicy: registered

is added to the plugin B's manifest and

Eclipse-RegisterBuddy: com.example.pluginB

is added to the manifest of pluginA.

But this doesn't work either. I tried both com.example.pluginB and
com.example.pluginB_1.0.0.jar since it wasn't clear what the right
syntax is. I'm kind of stumped here. If anyone has suggestions, I'd be
appreciative.
Re: NoClassDefFoundError [message #204819 is a reply to message #204573] Fri, 13 April 2007 22:29 Go to previous messageGo to next message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
Ric Wright wrote:
> I have written a plugin (A) for Eclipse (3.2). It uses classes that are
> in another plugin (B). That plugin is composed of the contents of two
> other JARs that I imported into Eclipse and wrapped as a plugin (via the
> Project Wizard). I then imported plugin into the plugin A project and
> all is fine. If I run it via the runtime workbench it works fine. But
> I also wrote an updater site. If I install into a test Eclipse
> installation it all seems to install fine. All looks OK. Plugin A
> works fine, but when it tries to invoke any code from plugin B, I get a
> NoClassDefFoundError. The class it complains about is exported in the
> manifest of plugin B. Anybody have any suggestions about what I am missing?
>
> Thanks,
> Ric

Well, I thought I might have made progress when I discovered that
normally Eclipse plugins each have their own class loaders so pluginA
wouldn't be able to load classes from Plugin B. But there existed a
"Buddy Class loader" approach in which

Eclipse-BuddyPolicy: registered

is added to the plugin B's manifest and

Eclipse-RegisterBuddy: com.example.pluginB

is added to the manifest of pluginA.

But this doesn't work either. I tried both com.example.pluginB and
com.example.pluginB_1.0.0.jar since it wasn't clear what the right
syntax is. I'm kind of stumped here. If anyone has suggestions, I'd be
appreciative.
Re-solved: NoClassDefFoundError [message #205554 is a reply to message #204819] Tue, 17 April 2007 17:56 Go to previous message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
Ric Wright wrote:
> Ric Wright wrote:
>> I have written a plugin (A) for Eclipse (3.2). It uses classes that
>> are in another plugin (B). That plugin is composed of the contents of
>> two other JARs that I imported into Eclipse and wrapped as a plugin
>> (via the Project Wizard). I then imported plugin into the plugin A
>> project and all is fine. If I run it via the runtime workbench it
>> works fine. But I also wrote an updater site. If I install into a
>> test Eclipse installation it all seems to install fine. All looks
>> OK. Plugin A works fine, but when it tries to invoke any code from
>> plugin B, I get a NoClassDefFoundError. The class it complains about
>> is exported in the manifest of plugin B. Anybody have any suggestions
>> about what I am missing?
>>
>> Thanks,
>> Ric
>
> Well, I thought I might have made progress when I discovered that
> normally Eclipse plugins each have their own class loaders so pluginA
> wouldn't be able to load classes from Plugin B. But there existed a
> "Buddy Class loader" approach in which
>
> Eclipse-BuddyPolicy: registered
>
> is added to the plugin B's manifest and
>
> Eclipse-RegisterBuddy: com.example.pluginB
>
> is added to the manifest of pluginA.
>
> But this doesn't work either. I tried both com.example.pluginB and
> com.example.pluginB_1.0.0.jar since it wasn't clear what the right
> syntax is. I'm kind of stumped here. If anyone has suggestions, I'd be
> appreciative.
The answer was that I was not putting the plugin B in the "required
plugins" section of the manifest. Eclipse somehow resolves it on the fly
(from the compile time info?) if you launch in the runtime workbench,
but it doesn't know to load the plugin if it is running in a separately
installed instance of Eclipse.
Previous Topic:accessing plugin resources
Next Topic:library version clash (two versions of the same library)
Goto Forum:
  


Current Time: Thu Apr 25 12:53:36 GMT 2024

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

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

Back to the top