sun.misc import need to be optional
Currently, metrics-core fails to load under apache karaf 2.3.1 container b/c sun.mics is a required package.
This is a similar to Netty 4.0 where sun.misc is mark as optional as a solution
I have basically no idea how OSGi works, so if you'd like to submit a pull request to resolve this I'd be happy to accept it.
it is a simple change by configure sun.misc.* as optional at top level pom under maven-bundle-plugin. here is the git diff ( tested with my production). Makesure to use edit mode to see the actual content
C:\Users\Dan.Tran\dev\codahale\metrics>git diff pom.xml
diff --git a/pom.xml b/pom.xml
index 6655cb7..9c05362 100644
--- a/pom.xml
+++ b/pom.xml
@@ -179,6 +179,7 @@
<Import-Package><![CDATA[
javax.servlet*;version="[2.5.0,4.0.0)",
org.slf4j*;version="[1.6.0,2.0.0)",
+ sun.misc.*;resolution:=optional,
*
]]>
</Import-Package>
This can also be addressed on the karaf side by adding sun.misc to your exported packages in Karaf's config.properties:
# Extra packages appended after standard packages
org.osgi.framework.system.packages.extra= \
sun.misc