"Unsatisfied native code filter" error when trying to export OSGi fragment in Eclipse with custom vm arg
Asked Answered
D

1

6

There seems to be only one other question of this nature, here, but the solution suggested by that answer hasn't been effective for me. I am using Spring Tool Suite (essentially Kepler 4.3.2 SR2) as my IDE to develop an OSGi fragment that contains the latest version of some native C++ code. The fragments exist to allow for the possibility of different version of software existing in different environments that this native code is intended to integrate with.

However I am unable to export this fragment, apparently on account of a custom vm arg that we use to represent this version number.

The manifest looks something like this:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Windows 64-bit support for Third-Party XYZ 4.12.7
Bundle-SymbolicName: com.ourcompany.oursoftwarepackage.xyz.win64xyz4127  
Bundle-Version: 8.6.2.qualifier
Bundle-Vendor: OurCompany
Fragment-Host: com.ourcompany.oursoftwarepackage.xyz
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=x86_64))
Bundle-NativeCode: xyzintegration.dll; selection-filter = "(oursoftwarepackage.xyzVersion=4.12.7)"
Bundle-ClassPath: .

The error says:

Processing inclusion from feature org.eclipse.pde.container.feature: Bundle com.ourcompany.oursoftwarepackage.xyz.win64xyz4127_8.6.2.qualifier failed to resolve.: Unsatisfied native code filter: xyzintegration.dll; selection-filter="(oursoftwarepackage.xyzVersion=4.12.7)".

If I remove the selection filter clause then it appears to export but there is no actual artifact produced.

The suggestion I extrapolated from the link above was to include the vmarg

-Doursoftwarepackage.xyzVersion=4.12.7 

in the plug-in development target environment. That, however, did not appear to satisfy the OSGi framework. Now I am at a loss as to how to get the fragment to resolve so that the export can proceed.

Dexterdexterity answered 29/10, 2015 at 16:20 Comment(2)
You say that you added the vmarg in your PDE target environment. What does that mean? Are you using this vmarg on starting your application?Lawannalawbreaker
In the target environment there is a setting for vmargs. I added the custom arg there.Dexterdexterity
L
0

I suppose you talk about the target environment setting of the target definition editor. At least that is the only place I know for such a setting. But that is the definition of the target you are developing against. It does not specify the runtime.

You need to set the VM parameter in the Run configuration.

Run -> Run Configurations... -> Select the application to start -> Switch to the Arguments tab -> insert the value to the VM arguments section

Lawannalawbreaker answered 20/11, 2015 at 7:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.