Skip to main content



      Home
Home » Eclipse Projects » Equinox » Exporting a package from a jar library in a plugin's classpath.
Exporting a package from a jar library in a plugin's classpath. [message #62104] Sat, 18 February 2006 17:25 Go to next message
Eclipse UserFriend
Is it possible for a plugin to export a package to the runtine, where
that package comes from a jar in that plugin's classpath?

Pat McNerthney
ClearPoint Metrics, Inc.
Re: Exporting a package from a jar library in a plugin's classpath. [message #62127 is a reply to message #62104] Sat, 18 February 2006 21:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Yes, provided that Jar is in the Bundle-Classpath as opposed to just the .classpath/Java Build Path.

Alex.
Re: Exporting a package from a jar library in a plugin's classpath. [message #62151 is a reply to message #62127] Sun, 19 February 2006 01:59 Go to previous messageGo to next message
Eclipse UserFriend
Alex Blewitt wrote:
> Yes, provided that Jar is in the Bundle-Classpath as opposed to
> just the .classpath/Java Build Path.

I believe I have done this, but the PDE complains.

First, before even trying to export the package, here is the MANIFEST.MF
file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.cpm.designstudio.workspace; singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .,
lib/bcprov-jdk14-127.jar,
lib/bsf.jar,
lib/commons-logging.jar,
lib/commons-pool-1.2.jar,
lib/cpm-datasources.jar,
lib/cpm-platform.jar,
lib/cpm-utils.jar,
lib/hsqldb.jar,
lib/jakarta-regexp-1.3.jar,
lib/javax.servlet.jar,
lib/jaxen-full.jar,
lib/js.jar,
lib/jsr173_api.jar,
lib/jxl.jar,
lib/jxta.jar,
lib/log4j-1.2.9.jar,
lib/org.mortbay.jetty.jar,
lib/saxpath.jar,
lib/xbean.jar,
lib/xercesImpl.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: com.cpm.designstudio.workspace,
com.cpm.designstudio.workspace.util
Eclipse-AutoStart: true
Bundle-Activator: com.cpm.designstudio.workspace.WorkspacePlugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources

In lib/cpm-utils.jar is the com.cpm.xml package that I would like to
export. The first problem I ran into is that the PDE doesn't let me
choose any packages in these jars. So I manually added it directly into
the MANIFEST.MF file like so:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.cpm.designstudio.workspace; singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .,
lib/bcprov-jdk14-127.jar,
lib/bsf.jar,
lib/commons-logging.jar,
lib/commons-pool-1.2.jar,
lib/cpm-datasources.jar,
lib/cpm-platform.jar,
lib/cpm-utils.jar,
lib/hsqldb.jar,
lib/jakarta-regexp-1.3.jar,
lib/javax.servlet.jar,
lib/jaxen-full.jar,
lib/js.jar,
lib/jsr173_api.jar,
lib/jxl.jar,
lib/jxta.jar,
lib/log4j-1.2.9.jar,
lib/org.mortbay.jetty.jar,
lib/saxpath.jar,
lib/xbean.jar,
lib/xercesImpl.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: com.cpm.designstudio.workspace,
com.cpm.designstudio.workspace.util,
com.cpm.xml
Eclipse-AutoStart: true
Bundle-Activator: com.cpm.designstudio.workspace.WorkspacePlugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources

When I do this, the PDE flags the line I just added (the " com.cpm.xml"
line) as the error "Package com.cpm.xml does not exist in this plug-in."

Is it possible that the run-time in fact supports this, but that the PDE
does not properly handle this?

Pat McNerthney
ClearPoint Metrics, Inc.
Re: Exporting a package from a jar library in a plugin's classpath. [message #62174 is a reply to message #62151] Sun, 19 February 2006 05:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Looks good. I'd recommend exporting a package of one of the other dependencies that you have listed (e.g. org.apache.commons.logging) to see whether it's a problem with your specific packages, or with the way of doing this.

Mind you, you might be better off turning the cpm-util etc. into plugins, rather than having them as separate Jars. Bear in mind that a pugin is just a Jar with extra manfiest entries and (maybe) a plugin.xml, so there's no reason why you can't have a Jar be both a plugin and an ordinary Jar file at the same time. If that's done, you just end up with importing this as a plugin dependency and re-export the dependency.

Alex.
Re: Exporting a package from a jar library in a plugin's classpath. [message #62270 is a reply to message #62174] Sun, 19 February 2006 22:03 Go to previous message
Eclipse UserFriend
Alex,

I have resolved this. It turns out my problem was specifying the jars
using external locations, rather than a location within the current
workspace. The PDE seems to behave much better now in this area.

Thanks so much for your help, it made me realize that something was
definitely not right with what I was doing.

Pat
Previous Topic:Can't find dependent libraries of native module (DLL)
Next Topic:HttpService: getRequestDispatcher returns null for different httpContext
Goto Forum:
  


Current Time: Sun May 11 09:51:34 EDT 2025

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

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

Back to the top