Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Add jar into feature needs to plugin installation but NoClassDefFoundError
Add jar into feature needs to plugin installation but NoClassDefFoundError [message #185164] Wed, 20 December 2006 16:54 Go to next message
Sophie Andrieu is currently offline Sophie AndrieuFriend
Messages: 38
Registered: July 2009
Member
Hello,

I'm developping a feature for a plugin and in my feature I create an
Install handler class in order to execute some code at the plugin
installation.
The MyInstallHandler class and the plugin installation is correctly
executed...
Now, I modify the MyInstallHandler class and I need now some externals jar
which are dom4j-1.6.1.jar and jaxen-1.1-beta-6.jar : I include them into
the Java Build Path property project and I add them into the Binary Build
of the Build tab of feature.xml.
But when I install my plugin, there is an error :
java.lang.NoClassDefFoundError: org/dom4j/io/OutputFormat
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.update.internal.core.InstallHandlerProxy.getLoca lHandler(InstallHandlerProxy.java:561)
at
org.eclipse.update.internal.core.InstallHandlerProxy.initial ize(InstallHandlerProxy.java:159)
at
org.eclipse.update.internal.core.InstallHandlerProxy.<init>(InstallHandlerProxy.java:115)
at org.eclipse.update.core.Feature.install(Feature.java:296)
at org.eclipse.update.internal.core.SiteFile.install(SiteFile.j ava:96)
at
org.eclipse.update.internal.core.ConfiguredSite.install(Conf iguredSite.java:155)
at
org.eclipse.update.internal.core.ConfiguredSite.install(Conf iguredSite.java:119)
at
org.eclipse.update.internal.operations.InstallOperation.exec ute(InstallOperation.java:92)
at
org.eclipse.update.internal.operations.BatchInstallOperation .execute(BatchInstallOperation.java:84)
at
org.eclipse.update.internal.ui.wizards.InstallWizard2.instal l(InstallWizard2.java:374)
at
org.eclipse.update.internal.ui.wizards.InstallWizard2.access $1(InstallWizard2.java:371)
at
org.eclipse.update.internal.ui.wizards.InstallWizard2$1.run( InstallWizard2.java:473)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Classes are not found...

Have I missed something into the feature configuration ?
Greats for your help...

Sophie

Sophie.Andrieu@xrce.xerox.com
XEROX XRCE
Re: Add jar into feature needs to plugin installation but NoClassDefFoundError [message #185196 is a reply to message #185164] Wed, 20 December 2006 20:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Sophie" <Sophie.Andrieu@xrce.xerox.com> wrote in message
news:8c8c51fd2f7a7fd7fc49fa9fbfd9487b$1@www.eclipse.org...
> Hello,
>
> I'm developping a feature for a plugin and in my feature I create an
> Install handler class in order to execute some code at the plugin
> installation.
> The MyInstallHandler class and the plugin installation is correctly
> executed...
> Now, I modify the MyInstallHandler class and I need now some externals jar
> which are dom4j-1.6.1.jar and jaxen-1.1-beta-6.jar : I include them into
> the Java Build Path property project and I add them into the Binary Build
> of the Build tab of feature.xml.


The jars need to be contained within your plug-in, or else they need to be
wrapped in plug-ins of their own. Eclipse won't load code from external
jars at runtime, at least not without a lot of extra effort.

There are a few tips at
http://wiki.eclipse.org/index.php/Plug-in_Development_Enviro nment.
Re: Add jar into feature needs to plugin installation but NoClassDefFoundError [message #185308 is a reply to message #185196] Thu, 21 December 2006 08:48 Go to previous messageGo to next message
Sophie Andrieu is currently offline Sophie AndrieuFriend
Messages: 38
Registered: July 2009
Member
Thanks for your help... But I have the same error...

I do the following things :

* Within the plugin project :
As you says, I add the two jars within the plugin project like :
- within the Runtime tab, I add dom4j-1.6.1.jar and jaxen-1.1-beta-6.jar
into the classpath.
- within the Build configuration, I select the two jars into the Binary
Build
Thus, the MANIFEST.MF has a Bundle-ClassPath like :
Bundle-ClassPath: lib/dom4j-1.6.1.jar,
lib/jaxen-1.1-beta-6.jar,
.,

* Within the feature project, the organization is :

myplugin.feature
|- src
|- installhandler
|- MyInstallHandler.java
|- feature.xml
|- build.properties
|- installhandler.jar // it's the jar of MyInstallHandler.java

This feature reference the plugin project (which is added within the
Plug-ins and Fragments tab).
The feature.xml file is :
<feature
id="myplugin.feature"
label="myplugin.feature"
version="1.0.1"
provider-name=""
plugin="myplugin">
<install-handler library="installhandler.jar"
handler="installhandler.MyInstallHandler"/>

<description>
My plugin
</description>

<copyright>
</copyright>

<license>
Yes, you agree.
</license>

<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.debug.core"/>
</requires>

<plugin
id="myplugin"
download-size="0"
install-size="0"
version="1.0.1"/>
</feature>

I don't know why it's not run... and why classes are not found...

Thanks
Re: Add jar into feature needs to plugin installation but NoClassDefFoundError [message #185463 is a reply to message #185308] Thu, 21 December 2006 21:10 Go to previous message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Sophie" <Sophie.Andrieu@xrce.xerox.com> wrote in message
news:a323b819c1b945149bd19cbe491afab6$1@www.eclipse.org...
> Thanks for your help... But I have the same error...
>
> I do the following things :
>
> * Within the plugin project :
> As you says, I add the two jars within the plugin project like :
> - within the Runtime tab, I add dom4j-1.6.1.jar and jaxen-1.1-beta-6.jar
> into the classpath.
> - within the Build configuration, I select the two jars into the Binary
> Build
> Thus, the MANIFEST.MF has a Bundle-ClassPath like :
> Bundle-ClassPath: lib/dom4j-1.6.1.jar,
> lib/jaxen-1.1-beta-6.jar,
> .,
>

When the plug-in is installed, does it still contain the jar files? That
is, does the installed plug-in have a lib/ directory, and are
dom4j-1.6.1.jar and jaxen-1.1-beta-6.jar present in that directory?
Previous Topic:Copy, Cut and Paste shortcuts do not work as expected
Next Topic:Downloading Eclipse does not work
Goto Forum:
  


Current Time: Fri Mar 29 06:53:00 GMT 2024

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

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

Back to the top