you can use bootdelegation for the sax parser. Just need to add it to bootdelegation by yourself instead of us doing the magic for you.
regards, Karl On Tue, Nov 22, 2011 at 1:27 PM, Caunter, Mark <[email protected]> wrote: > > Thanks everyone for your assistance - we can now at least get our app > started. > > However, there are a couple of issues that seem to be side effects to > having to use the felix.bootdelegation.implicit=false property to get past > the initial problem we reported at the start of the thread. > > 1. In the Android log we see the following error relating to a missing > class: org.apache.felix.eventadmin.impl.MetaTypeProviderImpl > > 11-22 11:44:32.432: I/dalvikvm(5046): Failed resolving > Lorg/apache/felix/eventadmin/impl/MetaTypeProviderImpl; interface 307 > 'Lorg/osgi/service/metatype/MetaTypeProvider;' > 11-22 11:44:32.432: W/dalvikvm(5046): Link of class > 'Lorg/apache/felix/eventadmin/impl/MetaTypeProviderImpl;' failed > 11-22 11:44:32.432: E/dalvikvm(5046): ERROR: defineClass(0x418e7dd8, > org.apache.felix.eventadmin.impl.MetaTypeProviderImpl, 0x4190c8a8, 0, 5027) > 11-22 11:44:32.432: E/dalvikvm(5046): Could not find class > 'org.apache.felix.eventadmin.impl.MetaTypeProviderImpl', referenced from > method > org.apache.felix.eventadmin.impl.Configuration.tryToCreateMetaTypeProvider > 11-22 11:44:32.432: W/dalvikvm(5046): VFY: unable to resolve new-instance > 239 (Lorg/apache/felix/eventadmin/impl/MetaTypeProviderImpl;) in > Lorg/apache/felix/eventadmin/impl/Configuration; > > 2. It would seem that the Android SAX parser can no longer be found by > Jetty (even though we're setting the system property org.xml.sax.driver > explicitly): > > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): XML parsing error: SAX2 > driver class org.xmlpull.v1.sax2.Driver not found > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): > java.lang.ClassNotFoundException: org.xmlpull.v1.sax2.Driver not found by > org.apache.felix.http.jetty [3] > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:191) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java: > 150) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > com.skifta.upnp.sax.SAXUtils.getParser(SAXUtils.java:217) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > com.skifta.upnp.servlethandlers.ControlHandler.handlePostRequest(ControlHan > dler.java:207) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > com.skifta.upnp.UPnPServlet.doPost(UPnPServlet.java:146) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > javax.servlet.http.HttpServlet.service(HttpServlet.java:727) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > com.skifta.upnp.UPnPServlet.service(UPnPServlet.java:84) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(Servlet > Handler.java:96) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHa > ndler.java:79) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(Servlet > Pipeline.java:42) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter > (InvocationFilterChain.java:49) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpF > ilterChain.java:33) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(Filter > Pipeline.java:48) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher > .java:39) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherSer > vlet.java:67) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.Server.handle(Server.java:326) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java > :943) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410 > ) > 11-22 11:45:30.674: E/SkiftaService-Generic(5046): at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:58 > 2) > > As stated before, when running our app on versions of Android earlier than > 4.0 (when we don't have to set felix.bootdelegation.implicit=false) we > don't see these problems at all and everything works fine. > > Is there a way to fix these issues and still have > felix.bootdelegation.implicit=false? Or is there a different approach > needed? > > > > On 22/11/2011 11:25, "Caspar MacRae" <[email protected]> wrote: > >>Nothing concrete but this sounds like a SecurityManager issue wrt to >>protocol handlers (specifically NetPermission("specifyStreamHandler") ), >>see this http://java.sun.com/developer/onlineTraining/protocolhandlers/ >> >>Try disabling Felix's url handling: *-Dfelix.service.urlhandlers=false* >> >> >> >>Caspar >> >> >>On 22 November 2011 10:56, 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:12 >>>>>08 >>> >>) >>> >> 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(Abstr >>>>>ac >>> >>tH >>> >> ttpActivator.java:45) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.http.jetty.internal.JettyActivator.doStart(JettyActiva >>>>>to >>> >>r. >>> >> java:29) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.http.base.internal.AbstractActivator.start(AbstractAct >>>>>iv >>> >>at >>> >> or.java:41) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.framework.util.SecureAction.startActivator(SecureActio >>>>>n. >>> >>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(Bu >>>>>nd >>> >>le >>> >> WiringImpl.java:1626) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(Bundle >>>>>Wi >>> >>ri >>> >> ngImpl.java:1603) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelega >>>>>ti >>> >>on >>> >> (BundleWiringImpl.java:1439) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.framework.BundleWiringImpl.getResourceByDelegation(Bun >>>>>dl >>> >>eW >>> >> iringImpl.java:1360) >>> >> E/SkiftaService(10175): at >>> >> >>> >>>>>org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.getResour >>>>>ce >>> >>(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:1 >>>>>>20 >>> >>>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(Abst >>>>>>ra >>> >>>ct >>> >>>H >>> >>>ttpActivator.java:45) >>> >>>11-09 12:03:36.507: E/SkiftaService(2979): at >>> >>>>>>org.apache.felix.http.jetty.internal.JettyActivator.doStart(JettyActiv >>>>>>at >>> >>>or >>> >>>. >>> >>>java:29) >>> >>>11-09 12:03:36.507: E/SkiftaService(2979): at >>> >>>>>>org.apache.felix.http.base.internal.AbstractActivator.start(AbstractAc >>>>>>ti >>> >>>va >>> >>>t >>> >>>or.java:41) >>> >>>11-09 12:03:36.507: E/SkiftaService(2979): at >>> >>>>>>org.apache.felix.framework.util.SecureAction.startActivator(SecureActi >>>>>>on >>> >>>.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(ModuleI >>>>>>mp >>> >>>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(ModuleIm >>>>>>pl >>> >>>.j >>> >>>a >>> >>>va:677) >>> >>>11-09 12:03:36.507: E/SkiftaService(2979): at >>> >>>>>>org.apache.felix.framework.ModuleImpl$ModuleClassLoader.getResource(Mo >>>>>>du >>> >>>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] >>> >>> > > > --------------------------------------------------------------------- > 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]

