Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 78535 - [jars] Manifest.mf can't be generated for nested jars
Summary: [jars] Manifest.mf can't be generated for nested jars
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 85065
  Show dependency tree
 
Reported: 2004-11-12 13:20 EST by Gary Karasiuk CLA
Modified: 2006-07-10 07:15 EDT (History)
9 users (show)

See Also:


Attachments
The .log file (30.92 KB, text/plain)
2004-11-12 13:21 EST, Gary Karasiuk CLA
no flags Details
sample plugins (480.68 KB, application/octet-stream)
2004-11-12 13:24 EST, Gary Karasiuk CLA
no flags Details
.log file (30.91 KB, text/plain)
2004-11-12 14:05 EST, Gary Karasiuk CLA
no flags Details
plugins (419.62 KB, application/octet-stream)
2004-11-12 14:07 EST, Gary Karasiuk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Karasiuk CLA 2004-11-12 13:20:21 EST
I zipped up three of my plugins so that they would be single jar files.
I dropped them into the plugins directory, but they would not load properly.
I'll attach the plugins and the full .log file, but here is the first log 
entry:

!SESSION Nov 12, 2004 12:56:48.209 --------------------------------------------
-
eclipse.buildId=M200409161125
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

!ENTRY org.eclipse.osgi Nov 12, 2004 12:56:48.209
!MESSAGE An error occured while automatically activating bundle 
org.eclipse.perfmsr.ui (52).
!STACK 0
org.osgi.framework.BundleException: The activator 
org.eclipse.perfmsr.ui.PerfMsrUIPlugin for bundle org.eclipse.perfmsr.ui is 
invalid
	at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator
(AbstractBundle.java:158)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start
(BundleContextImpl.java:933)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(BundleHost.java:421)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:293)
	at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass
(EclipseClassLoader.java:110)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass
(BundleLoader.java:371)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass
(BundleLoader.java:402)
	at 
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass
(AbstractClassLoader.java:93)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass
(BundleLoader.java:307)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass
(BundleHost.java:336)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass
(AbstractBundle.java:1313)
	at 
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtensi
on(ConfigurationElement.java:131)
	at 
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtensi
on(ConfigurationElement.java:124)
	at 
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtensi
on(ConfigurationElement.java:113)
	at org.eclipse.ui.internal.WorkbenchPlugin$1.run
(WorkbenchPlugin.java:196)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:51)
	at org.eclipse.ui.internal.WorkbenchPlugin.createExtension
(WorkbenchPlugin.java:193)
	at org.eclipse.ui.internal.EarlyStartupRunnable.getExecutableExtension
(EarlyStartupRunnable.java:109)
	at org.eclipse.ui.internal.EarlyStartupRunnable.run
(EarlyStartupRunnable.java:61)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:616)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1283)
	at java.lang.Thread.run(Unknown Source)
Comment 1 Gary Karasiuk CLA 2004-11-12 13:21:42 EST
Created attachment 15829 [details]
The .log file
Comment 2 Gary Karasiuk CLA 2004-11-12 13:24:07 EST
Created attachment 15830 [details]
sample plugins

This zip file contains the three plugins that I was testing.
Comment 3 Pascal Rapicault CLA 2004-11-12 13:51:52 EST
Although not optimal for running large products this mode should be supported 
but it seems that there is a bug, since the inner jars do not get unzipped into 
the org.eclipse.osgi folder of the configuration area.

A better approach for running large products out of jars is to:
- unzip the code jar at the same level than the resources (or in a folder)
- change the library entry in the plugin xml to refer to the source

For example: org.eclipse.perfmsr.core will become (in the top level jar):
plugin.xml (with library set to "binaries/")
binaries/
  org/eclipse/perfmsr/core/A.class
  org/eclipse/perfmsr/core/B.class
  ...

If you want to have the class files at the root, the library value becomes ".".

Assigning to Tom to investigate the initial problem.
Comment 4 Pascal Rapicault CLA 2004-11-12 14:00:01 EST
Never mind, the windows explorer tricked me.
Comment 5 Gary Karasiuk CLA 2004-11-12 14:05:48 EST
Created attachment 15831 [details]
.log file

This is the .log file from my second attempt. In this attempt I:

1) deleted the source jars
2) expanded and then removed the code jars
3) copied the manifest file from the configuration directory, but removed the
classpath line
4) edited the runtime stuff out of the plugin.xml file

So this version of the plugins do not have any nested jar files
Comment 6 Gary Karasiuk CLA 2004-11-12 14:07:23 EST
Created attachment 15832 [details]
plugins 

The plugin jar files that Iused for my second attempt
Comment 7 Thomas Watson CLA 2004-11-12 14:17:02 EST
Pascal, I looked into the initial problem.  The jars are extracted.  It is the 
PluginConverter that does not seem to generate the Provide-Package list 
correctly for the inner jars.  So the framework cannot find packages from 
required bundles.
Comment 8 Thomas Watson CLA 2004-11-12 14:20:55 EST
Gary, the manifest files you copied in comment 5 will be incorrect because 
they are missing the Provide-Package header.  This will cause the same errors 
to occur as your original jar'ed bundles.  You should look at using the 
manifest files that get generated for you plugins when the are fully extracted 
plugins.
Comment 9 Pascal Rapicault CLA 2004-11-12 14:28:13 EST
I've been tricked by the file explorer :) 
What is interesting that if I unjar the plugins to be like in eclipse the plugin
works fine. If I run from the jar, some classes are being found but there is
this strange exception that I haven't figured out yet (and won't be able to
address today).

Tom if you want to keep the investigation, go ahead. I'm not sure why in case of
zipped plugin we would generate a bogus manifest.
Comment 10 Gary Karasiuk CLA 2004-11-12 14:34:04 EST
Re: Comment 8

I can confirm, that once I manually added in the Provide-Package header that 
my plugins worked!
Comment 11 Gordon Hirsch CLA 2005-02-23 13:47:33 EST
I ran into this problem while experimenting with the JavaWebStart/JNLP support.
I debugged a bit, and the problem seems to happen in the
PluginConverterImpl.getExports() method. This is where the jars containing the
plugin classes need to be scanned to build a exported package list. In the
jarred plugin case however, the jar file containing the classes is not correctly
found, so the export list is empty. The following code is where things start to
go wrong. pluginManifestLocation is the plugin jar file and libEntryText is the
name of the library within the jar, so libraryLocation becomes non-existent. 

File libraryLocation;
if (DevClassPathHelper.inDevelopmentMode()) {
...
} else
    libraryLocation = new File(pluginManifestLocation, libEntryText);
Set exports = null;
if (libraryLocation.exists()) {
    if (libraryLocation.isFile())
        exports = filterExport(getExportsFromJAR(libraryLocation), filter);
//TODO Need to handle $xx$ variables
    else if (libraryLocation.isDirectory())
        exports = filterExport(getExportsFromDir(libraryLocation), filter);
} else {
...
Comment 12 Pascal Rapicault CLA 2005-04-01 12:00:27 EST
Consider for M7.
Patches welcomed.
Comment 13 Pascal Rapicault CLA 2005-05-09 12:48:21 EDT
The launcher feature in the delta pack is not up-to-date. Please try to replace
the launcher feature of the delta pack with the one attached in bug #93171
Comment 14 Pascal Rapicault CLA 2005-05-09 12:49:17 EDT
Wrong bug report.
Comment 15 Pascal Rapicault CLA 2005-05-31 15:45:49 EDT
DJ and I did separate evaluations on how to fix this bug, and we both came to
the same conclusion: "nay, too risky, too complicated for this late in the game".

I will even go further saying that this is a wontfix because:
- Eclipse 3.1 recommends shipping with MANIFEST.MF
- Manifest support is now first class in PDE (which used a counter argument as
to why we should not ship manifest before)

I opened bug #97689 to add something in the README.
Comment 16 Gary Karasiuk CLA 2006-07-10 07:15:57 EDT
Cleaning up old defects.