Hi all,

I need to load .dll or .so libraries but I just don't succeed. Let's focus
on the windows platform for the moment.

my pom looks like this, for the maven-bundle-plugin:
__
<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.1.0-SNAPSHOT</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Name>Ted</Bundle-Name>
                        <Bundle-Version>${pom.version}</Bundle-Version>
                       
<Private-Package>com.thalesgroup.ted</Private-Package>
                        <Export-Package>
                            com.thalesgroup.ted.openapi.*;version:=0.1,
                            com.jidesoft.*;version:=2.2.1.05,
                            org.apache.log4j.*;version:=1.2.14
                        </Export-Package>
                        <Import-Package>
                            *;resolution:=optional,
                        </Import-Package>
                       
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                       
<Bundle-Activator>com.thalesgroup.ted.TedActivator</Bundle-Activator>
                       
<Include-Resource>native/win32/LcdTimer.dll</Include-Resource>
                        <Bundle-NativeCode>
                            /LcdTimer.dll
                        </Bundle-NativeCode>
                    </instructions>
                </configuration>
            </plugin>
__
 
I checked the resulting jar and it does contain the .dll in the root
directory.

When ran in Felix, and I get the following...
__
Welcome to Felix.
=================

org.osgi.framework.BundleException: Unable to select a native library
clause.
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getSelectedLibraryClause(ManifestParser.java:337)
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getLibraries(ManifestParser.java:294)
        at org.apache.felix.framework.Felix.createModule(Felix.java:3351)
        at
org.apache.felix.framework.Felix.createBundleInfo(Felix.java:3277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2231)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2145)
        at
org.apache.felix.framework.Felix.processAutoProperties(Felix.java:3667)
        at org.apache.felix.framework.Felix.start(Felix.java:803)
        at org.apache.felix.main.Main.main(Main.java:195)
ERROR: Auto-properties install. (org.osgi.framework.BundleException: Could
not create bundle object.)
org.osgi.framework.BundleException: Unable to select a native library
clause.
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getSelectedLibraryClause(ManifestParser.java:337)
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getLibraries(ManifestParser.java:294)
        at org.apache.felix.framework.Felix.createModule(Felix.java:3351)
        at
org.apache.felix.framework.Felix.createBundleInfo(Felix.java:3277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2231)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2145)
        at
org.apache.felix.framework.Felix.processAutoProperties(Felix.java:3667)
        at org.apache.felix.framework.Felix.start(Felix.java:803)
        at org.apache.felix.main.Main.main(Main.java:195)
org.osgi.framework.BundleException: Unable to select a native library
clause.
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getSelectedLibraryClause(ManifestParser.java:337)
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getLibraries(ManifestParser.java:294)
        at org.apache.felix.framework.Felix.createModule(Felix.java:3351)
        at
org.apache.felix.framework.Felix.createBundleInfo(Felix.java:3277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2231)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2145)
        at
org.apache.felix.framework.Felix.processAutoProperties(Felix.java:3699)
        at org.apache.felix.framework.Felix.start(Felix.java:803)
        at org.apache.felix.main.Main.main(Main.java:195)
ERROR: Auto-properties start. (org.osgi.framework.BundleException: Could not
create bundle object.)
org.osgi.framework.BundleException: Unable to select a native library
clause.
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getSelectedLibraryClause(ManifestParser.java:337)
        at
org.apache.felix.framework.util.manifestparser.ManifestParser.getLibraries(ManifestParser.java:294)
        at org.apache.felix.framework.Felix.createModule(Felix.java:3351)
        at
org.apache.felix.framework.Felix.createBundleInfo(Felix.java:3277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2231)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2145)
        at
org.apache.felix.framework.Felix.processAutoProperties(Felix.java:3699)
        at org.apache.felix.framework.Felix.start(Felix.java:803)
        at org.apache.felix.main.Main.main(Main.java:195)
DEBUG: WIRE: 1.0 -> org.ungoverned.osgi.service.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 1.0 -> org.apache.felix.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 2.0 -> org.apache.felix.shell -> 1.0
DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
-> DEBUG: WIRE: 3.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 3.0 -> org.osgi.service.obr -> 3.0
DEBUG: WIRE: 3.0 -> org.apache.felix.shell -> 1.0
__

Do I need to explicitly configure RuntimePermission[loadLibrary.<library
name>] as it is said in the OSGi r4 core specification (page 58 of the pdf).

-----
Tell me something you don't know!
-- 
View this message in context: 
http://www.nabble.com/Bundle-NativeCode%2C-how-to...-tp14337619p14337619.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to