Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » bundling by reference
bundling by reference [message #59510] Thu, 02 February 2006 17:34 Go to next message
feifei li is currently offline feifei liFriend
Messages: 6
Registered: July 2009
Junior Member
My RCP application reference third party jars. After some research, I
find "bundling by reference" in Jeff Mcaffer and Jean-Michel Lemieux's
RCP book, and decide to take this approach.

Everything works fine in eclipse ide environment, RCP book provides step
by step instruction, I just follow the instruction and my application
run smoothly. But after I export my rcp product to file system, and try
to run it in standalone mode, I keep get java.lang.NoClassDefFoundError
for my third party library.

According to the book, if you want to use "bundling by reference", you
should define your manifest as following
Bundle-Classpath: external:$third_party$/JarFileName
$third_party$ can be environment variable or absolute path. I tried
both, and both works fine if I run my RCP application inside eclipse
ide, and both throw exception if I run it in standalone mode.

Following is some detail about my rcp application:
My eclipse is 3.2 M3
My os is windows xp
I have two plugins: A, B. plugin A includes all my code. and plugin B is
a wrapper for third party library.

So in plugin A's manifest.mf, I defined following line
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
plugin B's SymbolicName

And I have several third party jar, so in plugin B's manifest.mf
I defined following line:
Bundle-Classpath: external:c:\dir\first.jar,
c:\dir\second.jar
c:\dir\third.jar
Export-Package: com.packagename,
....

And if I use relative path and remove external keyword, It actually
works. so plugin B's manifest.mf become following:

Bundle-Classpath: ..\..\..\..\dir\first.jar,
..\..\..\dir\second.jar
..\..\..\third.jar
Export-Package: com.packagename,
....

Not quite sure what's the problem, any help will be really appreciate.
Re: bundling by reference [message #60543 is a reply to message #59510] Thu, 09 February 2006 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

I saw a bug report go by the other day saying that the external variable
bindings did not work correctly with environment vars (or maybe it was
System properties). Perhaps you are seeing the same problem? Can you try
using external: and a system property (use -D as a VM arg to set the system
property or put it in config.ini)

If there is still a problem, please enter a bug report in Equinox/Framework

Thanks
Jeff

"feifei" <lfeifei@hotmail.com> wrote in message
news:drtfrp$6ct$1@utils.eclipse.org...
> My RCP application reference third party jars. After some research, I
> find "bundling by reference" in Jeff Mcaffer and Jean-Michel Lemieux's
> RCP book, and decide to take this approach.
>
> Everything works fine in eclipse ide environment, RCP book provides step
> by step instruction, I just follow the instruction and my application
> run smoothly. But after I export my rcp product to file system, and try
> to run it in standalone mode, I keep get java.lang.NoClassDefFoundError
> for my third party library.
>
> According to the book, if you want to use "bundling by reference", you
> should define your manifest as following
> Bundle-Classpath: external:$third_party$/JarFileName
> $third_party$ can be environment variable or absolute path. I tried
> both, and both works fine if I run my RCP application inside eclipse
> ide, and both throw exception if I run it in standalone mode.
>
> Following is some detail about my rcp application:
> My eclipse is 3.2 M3
> My os is windows xp
> I have two plugins: A, B. plugin A includes all my code. and plugin B is
> a wrapper for third party library.
>
> So in plugin A's manifest.mf, I defined following line
> Require-Bundle: org.eclipse.core.runtime,
> org.eclipse.ui,
> plugin B's SymbolicName
>
> And I have several third party jar, so in plugin B's manifest.mf
> I defined following line:
> Bundle-Classpath: external:c:\dir\first.jar,
> c:\dir\second.jar
> c:\dir\third.jar
> Export-Package: com.packagename,
> ....
>
> And if I use relative path and remove external keyword, It actually
> works. so plugin B's manifest.mf become following:
>
> Bundle-Classpath: ..\..\..\..\dir\first.jar,
> ..\..\..\dir\second.jar
> ..\..\..\third.jar
> Export-Package: com.packagename,
> ....
>
> Not quite sure what's the problem, any help will be really appreciate.
Re: bundling by reference [message #65150 is a reply to message #60543] Wed, 19 April 2006 09:38 Go to previous message
Eclipse UserFriend
Originally posted by: ebeling.carmen.se

I have the same kind of problem.

I have a plugin consisting of a few .jar files, the manifest saying:
...
Bundle-Classpath: first.jar,
second.jar,
third.jar,
...
Export-Package: com.packagename,
...

The jar files are located in the project root.

The problem is that when I in another plugin try to include these jars I can still not use the classes in the exported packages from the jars/plugin. The manifest that includes the plugin states:

Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
jar plugin symbolic name

I have done this earlier and it worked fine, but in my new workspace it seems to work differently. Could it be a problem with the PDE or something with the location of the workspace? I ended up copying the structure from the old workspace where this worked, but even then it doesn't work. The only difference is that the old workspace was located in the project root. Now, the new workspace is located under Documents and Settings(Win XP)...
Previous Topic:Bundling Berkeley DBXML - Advice from the experts requested
Next Topic:First steps to OSGi
Goto Forum:
  


Current Time: Thu Apr 25 19:57:27 GMT 2024

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

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

Back to the top