Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328586 - Do not install or resolve non-OSGi JARs
Summary: Do not install or resolve non-OSGi JARs
Status: RESOLVED INVALID
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 06:49 EDT by Harald Wellmann CLA
Modified: 2010-10-25 08:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Wellmann CLA 2010-10-25 06:49:21 EDT
Build Identifier: org.eclipse.osgi_3.6.1.R36x_v20100806

Equinox does not complain when you install a plain old JAR lacking the required OSGi manifest headers. Bundle-SymbolicName is mandatory according to the OSGi 4.2 Core Spec.

You can even start a non-bundle. The Equinox shell lists each such non-bundle under the name of "unknown_0.0.0".

After installing multiple non-bundles, 

ss <id>

with the id of any given non-bundle will list _all_ non-bundles.

(This may sound contrived, but I ran into this working with Glassfish 3.1 which indeed installs 5 non-bundles.)

Reproducible: Always

Steps to Reproduce:
java -jar org.eclipse.osgi_XXX.jar
osgi> install file:/path/to/plainOld.jar
osgi> install file:/path/to/anotherPlainOld.jar
osgi> start 1 2
osgi> ss
Framework is launched.

id      State       Bundle
0       ACTIVE      org.eclipse.osgi_3.6.1.R36x_v20100806
1       ACTIVE      unknown_0.0.0 [1]
2       ACTIVE      unknown_0.0.0 [2]

osgi> ss 1

Framework is launched.

id      State       Bundle
1       ACTIVE      unknown_0.0.0 [1]
2       ACTIVE      unknown_0.0.0 [2]
Comment 1 BJ Hargrave CLA 2010-10-25 08:29:36 EDT
(In reply to comment #0)
> Equinox does not complain when you install a plain old JAR lacking the required
> OSGi manifest headers. Bundle-SymbolicName is mandatory according to the OSGi
> 4.2 Core Spec.
> 

BSN is only required for Bundle-ManifestVersion: 2. So a plain old jar is a valid bundle in the R3 sense. Perhaps not very useful, but another bundle could load classes and resources from it via the Bundle methods.

I suppose it would be useful for some warning if a jar is installed that contains no OSGi manifest headers. But, while unusual, it certainly is not an error.
Comment 2 Thomas Watson CLA 2010-10-25 08:33:43 EDT
As BJ points out, this is the spec'ed behavior of the OSGi framework.