Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 130118

Summary: Bundle-NativeCode directive not recognized on AIX
Product: [Eclipse Project] Equinox Reporter: strus <strus_fr>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 3.1.2   
Target Milestone: ---   
Hardware: Power PC   
OS: AIX Motif   
Whiteboard:

Description strus CLA 2006-03-02 09:04:44 EST
The Bundle-NativeCode directive in MANIFEST.MF files in a fragment or plugin does not work.
The native libraries can be loaded only if they are put in /usr/lib or by using
 the -Djava.library.path directive.

MANIFEST.MF content on aix:
---------------------------------------------------------
anifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Foo Plug-in
Bundle-SymbolicName: foo; singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Activator: foo.FooPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime
Bundle-NativeCode: libprocmon.so;osname=Aix;processor=ppc
Eclipse-AutoStart: true
---------------------------------------------------------
Whatever the osname char case.
Comment 1 Thomas Watson CLA 2006-03-02 10:07:57 EST
What is the error message that you get when the library is not in /usr/lib or on the java.library.path property?

Is your bundle a jar'ed bundle? or a directory bundle?
Comment 2 strus CLA 2006-03-02 11:44:28 EST
(In reply to comment #1)
> What is the error message that you get when the library is not in /usr/lib or
> on the java.library.path property?
> 
> Is your bundle a jar'ed bundle? or a directory bundle?
> 

I tried both solutions without any difference. The framework doesn't say anything (so the MANIFEST.MF is well parsed I think) but I have an UnsatisfactedLinkError error.
Comment 3 strus CLA 2006-03-06 03:43:15 EST
No news ?

Comment 4 Thomas Watson CLA 2006-03-06 08:57:38 EST
Attaching a testcase would help.  We have not seen this problem on AIX.
Comment 5 strus CLA 2006-03-06 09:03:13 EST
(In reply to comment #4)
> Attaching a testcase would help.  We have not seen this problem on AIX.
> 

The test case is pretty simple.
Create a simple libhello.so library on Aix displaying "hello world"

Create a simple plugin from a simple template proposed when you create a plugin.
Just add in the plugin .java file:
static { 
  System.out.println("Trying to load libhello.so");
  try {
    System.loadLibrary("hello");
    System.out.println("libhello.so loaded with sucess");
  } catch (UnsatisfiedLinkError e1) {
    System.out.println(e1.toString());
  }
}

Use the manifest file I tried in my first post.

Try it, it will failed.

Do the same thing on Linux, It will work.
Comment 6 Thomas Watson CLA 2006-03-06 09:37:00 EST
The reason I'm asking for a testcase is because we already got native code that seems to work on AIX (e.g. swt).  Instead trying to recreate your scenario it would help greatly if you just provided the exact testcase that is failing.
Comment 7 Pascal Rapicault CLA 2006-04-05 11:43:29 EDT

*** This bug has been marked as a duplicate of 133343 ***