Hi Mike, On Tue, Nov 30, 2010 at 9:14 PM, Mike Müller <mike...@mysign.ch> wrote: >...I tried > to use FrameworkUtil.getBundle( getClass() ) inside this class. > So far so good. But when I try to compile the bundle with maven, I always > get "cannot find symbol" for FrameworkUtil.getBundle, but artifact > org.osgi.core > is included in the pom.xml. And what's really confusing: if I try to call > FrameworkUtil.createFilter( "xy" ) I get no errors....
For the FrameworkUtil.getBundle(...) method you need org.osgi.core 4.2.0, and the Sling parent pom (which I assume is what you're using) uses 4.1.0. -Bertrand P.S here's one way to find out about such things: $ mvn dependency:copy-dependencies ... $ cd target/dependency/ $ unzip org.osgi.core-4.1.0.jar $ javap -classpath . org.osgi.framework.FrameworkUtil Compiled from "FrameworkUtil.java" public class org.osgi.framework.FrameworkUtil extends java.lang.Object{ static java.lang.Class class$java$lang$String; public static org.osgi.framework.Filter createFilter(java.lang.String) throws org.osgi.framework.InvalidSyntaxException; static java.lang.Class class$(java.lang.String); } And if you do the same with a 4.2.0 core jar you see the getBundle method.