Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNA.JAR is invalid OSGi bundle #63

Closed
brettwooldridge opened this issue Mar 23, 2012 · 5 comments
Closed

JNA.JAR is invalid OSGi bundle #63

brettwooldridge opened this issue Mar 23, 2012 · 5 comments

Comments

@brettwooldridge
Copy link
Contributor

Due to a simple blank line in the MANIFEST.MF file, Eclipse treats the jna.jar file as an invalid OSGi bundle.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_29-b11-402-10M3527 (Apple Inc.)
Main-Class: com.sun.jna.Native

Name: com/sun/jna/
Implementation-Title: com.sun.jna
Implementation-Vendor: JNA Development Team
Implementation-Version: 3.4.0 (b541)
Specification-Title: Java Native Access (JNA)
Specification-Vendor: JNA Development Team
Specification-Version: 3
Bundle-ManifestVersion: 2
Bundle-Name: jna
Bundle-Description: JNA Library
Bundle-SymbolicName: com.sun.jna
Bundle-Version: 3
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Vendor: JNA Development Team
Bundle-ActivationPolicy: lazy
Export-Package: com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32
Bundle-NativeCode: com/sun/jna/win32-x86/jnidispatch.dll; processor=x8
6;osname=win32, com/sun/jna/win32-amd64/jnidispatch.dll; processor=x8
6-64;osname=win32, com/sun/jna/w32ce-arm/jnidispatch.dll; processor=a
rm;osname=wince, com/sun/jna/sunos-x86/libjnidispatch.so; processor=
x86;osname=sunos, com/sun/jna/sunos-amd64/libjnidispatch.so; processo
r=x86-64;osname=sunos, com/sun/jna/sunos-sparc/libjnidispatch.so; pro
cessor=sparc;osname=sunos, com/sun/jna/sunos-sparcv9/libjnidispatch.s
o; processor=sparcv9;osname=sunos, com/sun/jna/linux-ppc/libjnidispa
tch.so; processor=ppc;osname=linux, com/sun/jna/linux-ppc64/libjnidis
patch.so; processor=ppc64;osname=linux, com/sun/jna/linux-i386/libjni
dispatch.so; processor=x86;osname=linux, com/sun/jna/linux-amd64/libj
nidispatch.so; processor=x86-64;osname=linux, com/sun/jna/linux-arm/l
ibjnidispatch.so; processor=arm;osname=linux, com/sun/jna/linux-ia64/
libjnidispatch.so; processor=ia64;osname=linux, com/sun/jna/openbsd-
i386/libjnidispatch.so; processor=x86;osname=openbsd, com/sun/jna/fre
ebsd-i386/libjnidispatch.so; processor=x86;osname=freebsd, com/sun/jn
a/freebsd-amd64/libjnidispatch.so; processor=x86-64;osname=freebsd,
com/sun/jna/darwin/libjnidispatch.jnilib; osname=macos,

The blank line between the Main-Class: header and the Name: header needs to be removed.

@brettwooldridge
Copy link
Contributor Author

Forgot something ... the trailing comma (,) after "osname=macos," on the last line of the manifest is also invalid. After correcting these two issues locally, Eclipse was able to treat the jna.jar as an OSGi bundle.

@brettwooldridge
Copy link
Contributor Author

I spoke too soon, another minor correction. The "Bundle-Version" header says "3" as the value, but OSGi seems to want a three-part version, for example "3.4.0" (for version 3.4).

@brettwooldridge
Copy link
Contributor Author

See this enhancement request:

http://java.net/jira/browse/JNA-141

The items above are still insufficent without this enhancement.

@twall
Copy link
Contributor

twall commented Mar 29, 2012

Are you certain that's why eclipse treats it as invalid? because ant is generating the manifest, so if it's not a valid manifest that's an ant bug and if it is a valid manifest that's an eclipse bug.

On Mar 23, 2012, at 12:46 AM, brettwooldridge wrote:

Due to a simple blank line in the MANIFEST.MF file, Eclipse treats the jna.jar file as an invalid OSGi bundle.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_29-b11-402-10M3527 (Apple Inc.)
Main-Class: com.sun.jna.Native

Name: com/sun/jna/
Implementation-Title: com.sun.jna
Implementation-Vendor: JNA Development Team
Implementation-Version: 3.4.0 (b541)
Specification-Title: Java Native Access (JNA)
Specification-Vendor: JNA Development Team
Specification-Version: 3
Bundle-ManifestVersion: 2
Bundle-Name: jna
Bundle-Description: JNA Library
Bundle-SymbolicName: com.sun.jna
Bundle-Version: 3
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Vendor: JNA Development Team
Bundle-ActivationPolicy: lazy
Export-Package: com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32
Bundle-NativeCode: com/sun/jna/win32-x86/jnidispatch.dll; processor=x8
6;osname=win32, com/sun/jna/win32-amd64/jnidispatch.dll; processor=x8
6-64;osname=win32, com/sun/jna/w32ce-arm/jnidispatch.dll; processor=a
rm;osname=wince, com/sun/jna/sunos-x86/libjnidispatch.so; processor=
x86;osname=sunos, com/sun/jna/sunos-amd64/libjnidispatch.so; processo
r=x86-64;osname=sunos, com/sun/jna/sunos-sparc/libjnidispatch.so; pro
cessor=sparc;osname=sunos, com/sun/jna/sunos-sparcv9/libjnidispatch.s
o; processor=sparcv9;osname=sunos, com/sun/jna/linux-ppc/libjnidispa
tch.so; processor=ppc;osname=linux, com/sun/jna/linux-ppc64/libjnidis
patch.so; processor=ppc64;osname=linux, com/sun/jna/linux-i386/libjni
dispatch.so; processor=x86;osname=linux, com/sun/jna/linux-amd64/libj
nidispatch.so; processor=x86-64;osname=linux, com/sun/jna/linux-arm/l
ibjnidispatch.so; processor=arm;osname=linux, com/sun/jna/linux-ia64/
libjnidispatch.so; processor=ia64;osname=linux, com/sun/jna/openbsd-
i386/libjnidispatch.so; processor=x86;osname=openbsd, com/sun/jna/fre
ebsd-i386/libjnidispatch.so; processor=x86;osname=freebsd, com/sun/jn
a/freebsd-amd64/libjnidispatch.so; processor=x86-64;osname=freebsd,
com/sun/jna/darwin/libjnidispatch.jnilib; osname=macos,

The blank line between the Main-Class: header and the Name: header needs to be removed.


Reply to this email directly or view it on GitHub:
#63

@pkriens
Copy link

pkriens commented Apr 3, 2012

Name is the only invalid header for the main section ... A Name header indicates headers for the signing of Jars. These are the kind of errors (and many others) that bnd will catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants