karaf with orient db gives "java.lang.NoClassDefFoundError: com/sun/jna/Platform"
<p>Iam trying to build up an application with</p>

<p>karaf 4.0.5
orientdb 2.1.16</p>

<p>But the orientdb service isnt loading and in the log is following error:</p>

<pre><code>    The callback method validate has thrown an exception : com/sun/jna/Platform
java.lang.NoClassDefFoundError: com/sun/jna/Platform
    at com.orientechnologies.nio.OCLibraryFactory.&lt;clinit&gt;(OCLibraryFactory.java:35)
    at com.orientechnologies.nio.OJNADirectMemory.&lt;clinit&gt;(OJNADirectMemory.java:35)
    at com.orientechnologies.common.directmemory.ODirectMemoryFactory.&lt;clinit&gt;(ODirectMemoryFactory.java:59)
    at com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.&lt;init&gt;(ODirectMemoryPointerFactory.java:28)
    at com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.&lt;clinit&gt;(ODirectMemoryPointerFactory.java:24)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.initPageCache(ODiskWriteAheadLog.java:558)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.init(ODiskWriteAheadLog.java:279)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.&lt;init&gt;(ODiskWriteAheadLog.java:692)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.&lt;init&gt;(ODiskWriteAheadLog.java:616)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:292)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:169)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:248)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:125)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:106)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:66)
    at xx.yy.zz.orientdb.OrientDatabase.__M_validate(OrientDatabase.java:30)
    at xx.yy.zz.orientdb.OrientDatabase.validate(OrientDatabase.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_91]
    at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_91]
    at org.apache.felix.ipojo.util.Callback.call(Callback.java:233)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.util.Callback.call(Callback.java:193)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:440)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:312)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:306)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:114)[28:org.apache.felix.ipojo:1.12.1]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_91]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform not found by com.orientechnologies.orientdb-core [13]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_91]
    ... 38 more
2016-05-06 19:54:58,171 | ERROR |  pool-1-thread-1 | orientdb                         | 21 - xx.yy.zz.orientdb - 1.0.0.SNAPSHOT | [ERROR]  : java.lang.NoClassDefFoundError: com/sun/jna/Platform
java.lang.IllegalStateException: java.lang.NoClassDefFoundError: com/sun/jna/Platform
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:171)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:440)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:312)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:306)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:114)[28:org.apache.felix.ipojo:1.12.1]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_91]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: java.lang.NoClassDefFoundError: com/sun/jna/Platform
    at com.orientechnologies.nio.OCLibraryFactory.&lt;clinit&gt;(OCLibraryFactory.java:35)
    at com.orientechnologies.nio.OJNADirectMemory.&lt;clinit&gt;(OJNADirectMemory.java:35)
    at com.orientechnologies.common.directmemory.ODirectMemoryFactory.&lt;clinit&gt;(ODirectMemoryFactory.java:59)
    at com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.&lt;init&gt;(ODirectMemoryPointerFactory.java:28)
    at com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.&lt;clinit&gt;(ODirectMemoryPointerFactory.java:24)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.initPageCache(ODiskWriteAheadLog.java:558)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.init(ODiskWriteAheadLog.java:279)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.&lt;init&gt;(ODiskWriteAheadLog.java:692)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.&lt;init&gt;(ODiskWriteAheadLog.java:616)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:292)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:169)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:248)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:125)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:106)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:66)
    at xx.yy.zz.orientdb.OrientDatabase.__M_validate(OrientDatabase.java:30)
    at xx.yy.zz.orientdb.OrientDatabase.validate(OrientDatabase.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_91]
    at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_91]
    at org.apache.felix.ipojo.util.Callback.call(Callback.java:233)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.util.Callback.call(Callback.java:193)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)[28:org.apache.felix.ipojo:1.12.1]
    at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162)[28:org.apache.felix.ipojo:1.12.1]
    ... 13 more
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform not found by com.orientechnologies.orientdb-core [13]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_91]
    ... 38 more
</code></pre>

<p>the maven module looks like</p>

<pre><code>    &lt;dependency&gt;
        &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
        &lt;artifactId&gt;orientdb-graphdb&lt;/artifactId&gt;
        &lt;version&gt;2.1.16&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;net.java.dev.jna&lt;/groupId&gt;
        &lt;artifactId&gt;jna-platform&lt;/artifactId&gt;
        &lt;version&gt;4.2.2&lt;/version&gt;
    &lt;/dependency&gt;
</code></pre>

<p>adding "com.sun.jna" and "com.sun.jna.platform" to the property "org.osgi.framework.system.packages.extra" in the custom.properties file doesnt helps either </p>

<p>As karaf felix base Iam using:</p>

<p><a href="https://github.com/thometal/ipojokaraf" rel="nofollow">https://github.com/thometal/ipojokaraf</a></p>

<p>Why does the orientdb module not recognize that the "jna" bundles are there?</p>

<p>Thank you in advance</p>