Did you try to disable urlhandlers? -Dfelix.service.urlhandlers=false regards,
Karl On Tue, Nov 22, 2011 at 11:56 AM, Caunter, Mark <[email protected]> wrote: > Hi, > > We've added the felix property felix.bootdelegation.implicit=false as > recommended by Karl and that enabled us to get past that initial problem. > > However, there is a further issue: > > After Felix is started, our code creates a URL, opens the connection and > reads in the response from the input stream. Pretty basic stuff, but this > code is failing in the most fundamental way: > > 11-22 10:20:42.057: E/SkiftaService(3342): java.net.MalformedURLException: > java.lang.IllegalStateException: Unknown protocol: http > 11-22 10:20:42.057: E/SkiftaService(3342): at > java.net.URL.<init>(URL.java:192) > 11-22 10:20:42.057: E/SkiftaService(3342): at > java.net.URL.<init>(URL.java:127) > 11-22 10:20:42.057: E/SkiftaService(3342): at > com.skifta.android.client.SkiftaService.init(SkiftaService.java:782) > 11-22 10:20:42.057: E/SkiftaService(3342): at > com.skifta.android.client.SkiftaService$1.run(SkiftaService.java:384) > 11-22 10:20:42.057: E/SkiftaService(3342): at > java.lang.Thread.run(Thread.java:856) > > The java.net.URL class in this case is the version in the libcore of the > Android O/S. Most importantly: if felix is NOT started (literally the > call to felix.start() is commented out) the code works fine. So, > something must happen after Felix starts to cause this. > > This is only a problem with Android 4.0, not earlier versions of Android. > > Any ideas? > > Regards, > > Mark > > > > On 10/11/2011 17:25, "Karl Pauls" <[email protected]> wrote: > >>Can you try to set the following property: >> >>felix.bootdelegation.implicit=false >> >>that hopefully fixes it. >> >>regards, >> >>Karl >> >>On Thu, Nov 10, 2011 at 5:32 PM, Caunter, Mark <[email protected]> >>wrote: >>> This is the stack trace for the latest version of felix: >>> >>> E/SkiftaService(10175): unable to load and start bundle from >>> org.apache.felix.http.jetty-2.2.0.jar >>> E/SkiftaService(10175): org.osgi.framework.BundleException: Activator >>> start error in bundle org.apache.felix.http.jetty [3]. >>> E/SkiftaService(10175): at >>> org.apache.felix.framework.Felix.activateBundle(Felix.java:2027) >>> E/SkiftaService(10175): at >>> org.apache.felix.framework.Felix.startBundle(Felix.java:1895) >>> E/SkiftaService(10175): at >>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) >>> E/SkiftaService(10175): at >>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) >>> E/SkiftaService(10175): at >>> >>>com.skifta.android.client.SkiftaService.startOSGi(SkiftaService.java:1208 >>>) >>> E/SkiftaService(10175): at >>> com.skifta.android.client.SkiftaService.init(SkiftaService.java:675) >>> E/SkiftaService(10175): at >>> com.skifta.android.client.SkiftaService$1.run(SkiftaService.java:384) >>> E/SkiftaService(10175): at java.lang.Thread.run(Thread.java:856) >>> E/SkiftaService(10175): Caused by: java.lang.ExceptionInInitializerError >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.http.base.internal.AbstractHttpActivator.doStart(Abstrac >>>tH >>> ttpActivator.java:45) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.http.jetty.internal.JettyActivator.doStart(JettyActivato >>>r. >>> java:29) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.http.base.internal.AbstractActivator.start(AbstractActiv >>>at >>> or.java:41) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.util.SecureAction.startActivator(SecureAction. >>>ja >>> va:641) >>> E/SkiftaService(10175): at >>> org.apache.felix.framework.Felix.activateBundle(Felix.java:1977) >>> E/SkiftaService(10175): ... 7 more >>> E/SkiftaService(10175): Caused by: java.lang.NullPointerException >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(Bund >>>le >>> WiringImpl.java:1626) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWi >>>ri >>> ngImpl.java:1603) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegati >>>on >>> (BundleWiringImpl.java:1439) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.BundleWiringImpl.getResourceByDelegation(Bundl >>>eW >>> iringImpl.java:1360) >>> E/SkiftaService(10175): at >>> >>>org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.getResource >>>(B >>> undleWiringImpl.java:2256) >>> E/SkiftaService(10175): at >>> java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:434) >>> E/SkiftaService(10175): at >>> java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:514) >>> E/SkiftaService(10175): at >>> java.util.ResourceBundle.getBundle(ResourceBundle.java:227) >>> E/SkiftaService(10175): at >>> java.util.ResourceBundle.getBundle(ResourceBundle.java:140) >>> E/SkiftaService(10175): at >>> javax.servlet.GenericServlet.<clinit>(GenericServlet.java:64) >>> E/SkiftaService(10175): ... 12 more >>> >>> >>> >>> On 10/11/2011 10:35, "Caunter, Mark" <[email protected]> wrote: >>> >>>>We've been trying out Skifta, our mobile app, which uses felix (v3.2.2) >>>>on >>>>the latest version of Android (v4.0 - Ice Cream Sandwich) and have found >>>>an issue when trying to start the jetty bundle (v2.2.0). We need some >>>>help to solve this problem given that Android v4.0 will be officially >>>>released soon. >>>> >>>>Below is the stack trace: >>>> >>>>11-09 12:03:36.507: E/SkiftaService(2979): unable to load and start >>>>bundle >>>>from org.apache.felix.http.jetty-2.2.0.jar >>>>11-09 12:03:36.507: E/SkiftaService(2979): >>>>org.osgi.framework.BundleException: Activator start error in bundle >>>>org.apache.felix.http.jetty [3]. >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.Felix.activateBundle(Felix.java:1951) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.Felix.startBundle(Felix.java:1822) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>com.skifta.android.client.SkiftaService.startOSGi(SkiftaService.java:120 >>>>8) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>com.skifta.android.client.SkiftaService.init(SkiftaService.java:675) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>com.skifta.android.client.SkiftaService$1.run(SkiftaService.java:384) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>java.lang.Thread.run(Thread.java:856) >>>>11-09 12:03:36.507: E/SkiftaService(2979): Caused by: >>>>java.lang.ExceptionInInitializerError >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.http.base.internal.AbstractHttpActivator.doStart(Abstra >>>>ct >>>>H >>>>ttpActivator.java:45) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.http.jetty.internal.JettyActivator.doStart(JettyActivat >>>>or >>>>. >>>>java:29) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.http.base.internal.AbstractActivator.start(AbstractActi >>>>va >>>>t >>>>or.java:41) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.util.SecureAction.startActivator(SecureAction >>>>.j >>>>a >>>>va:629) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.Felix.activateBundle(Felix.java:1904) >>>>11-09 12:03:36.507: E/SkiftaService(2979): ... 7 more >>>>11-09 12:03:36.507: E/SkiftaService(2979): Caused by: >>>>java.lang.NullPointerException >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.ModuleImpl.doImplicitBootDelegation(ModuleImp >>>>l. >>>>j >>>>ava:1531) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.ja >>>>va >>>>: >>>>1508) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(Mo >>>>du >>>>l >>>>eImpl.java:759) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.ModuleImpl.getResourceByDelegation(ModuleImpl >>>>.j >>>>a >>>>va:677) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>org.apache.felix.framework.ModuleImpl$ModuleClassLoader.getResource(Modu >>>>le >>>>I >>>>mpl.java:2061) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:434) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:514) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>java.util.ResourceBundle.getBundle(ResourceBundle.java:227) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>java.util.ResourceBundle.getBundle(ResourceBundle.java:140) >>>>11-09 12:03:36.507: E/SkiftaService(2979): at >>>>javax.servlet.GenericServlet.<clinit>(GenericServlet.java:64) >>>>11-09 12:03:36.507: E/SkiftaService(2979): ... 12 more >>>> >>>>We've been able to identify that the root cause of the problem is that >>>>SecurityManagerEx.getClassContext() is returning null. Looking at the >>>>framework code it doesn't look like it would ever expect to get back >>>>null, >>>>so we're not sure if this is a bug in felix or Android v4.0 is doing >>>>something unexpected. >>>> >>>>Points to note: >>>> >>>>- This only occurs on Android v4.0 and doesn't happen on previous >>>>versions >>>>of Android which work fine. >>>>- We've only seen this happen with the jetty bundle: it doesn't seem to >>>>be >>>>a problem for every bundle or at least the bundles we use. >>>>- We've tried different versions of the framework including the latest >>>>with the same result, so it isn't related to the framework version we're >>>>using. >>>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >> >> >>-- >>Karl Pauls >>[email protected] >>http://twitter.com/karlpauls >>http://www.linkedin.com/in/karlpauls >>https://profiles.google.com/karlpauls >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [email protected] >>For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Karl Pauls [email protected] http://twitter.com/karlpauls http://www.linkedin.com/in/karlpauls https://profiles.google.com/karlpauls --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

