javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present

Java.net JIRA | systemniq | 5 years ago
  1. 0

    I've found a problem with the Jersey implementation running on OSGi that's tricky. The problem is not always reproducible! The problem is that jersey jars(com.sun.jersey.jersey-core_1.9.1.jar, com.sun.jersey.jersey-json_1.9.1.jar, com.sun.jersey.jersey-server_1.9.1.jar) use internally something called JAR Service Provider, also known as the META-INF/services system which is not OSGI friendly or this is the JDK (non OSGI ) way of defining dependencies to services -> http://weblogs.java.net/blog/bondolo/archive/2007/09/jxse_25_whats_c_2.html What I think happens: Jersey jars depend on these services and we use them indirectly as well. As we do not have explicit dependency(in the form of component.xml or something) that says to OSGI to start us when these services are available we receive exceptions due to not yet powered on services. Do you have any ideas,suggestions,comments? The full stacktrace: HTTP ERROR 503 Problem accessing /test_url. Reason: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present Caused by: javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:394) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:439) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:245) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:694) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:193) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:966) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:37) at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:182) at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498) at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:136) at org.eclipse.jetty.osgi.boot.OSGiAppProvider.addContext(OSGiAppProvider.java:154) at org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:522) at org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:438) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker.serviceChanged(JettyContextHandlerServiceTracker.java:189) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:756) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525) at org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.registerWebapplication(JettyBootstrapActivator.java:166) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.register(JettyContextHandlerExtender.java:153) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.bundleChanged(JettyContextHandlerExtender.java:63) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)

    Java.net JIRA | 5 years ago | systemniq
    javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present
  2. 0

    I've found a problem with the Jersey implementation running on OSGi that's tricky. The problem is not always reproducible! The problem is that jersey jars(com.sun.jersey.jersey-core_1.9.1.jar, com.sun.jersey.jersey-json_1.9.1.jar, com.sun.jersey.jersey-server_1.9.1.jar) use internally something called JAR Service Provider, also known as the META-INF/services system which is not OSGI friendly or this is the JDK (non OSGI ) way of defining dependencies to services -> http://weblogs.java.net/blog/bondolo/archive/2007/09/jxse_25_whats_c_2.html What I think happens: Jersey jars depend on these services and we use them indirectly as well. As we do not have explicit dependency(in the form of component.xml or something) that says to OSGI to start us when these services are available we receive exceptions due to not yet powered on services. Do you have any ideas,suggestions,comments? The full stacktrace: HTTP ERROR 503 Problem accessing /test_url. Reason: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present Caused by: javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:394) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:439) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:245) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:694) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:193) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:966) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:37) at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:182) at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498) at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:136) at org.eclipse.jetty.osgi.boot.OSGiAppProvider.addContext(OSGiAppProvider.java:154) at org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:522) at org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:438) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker.serviceChanged(JettyContextHandlerServiceTracker.java:189) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:756) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525) at org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.registerWebapplication(JettyBootstrapActivator.java:166) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.register(JettyContextHandlerExtender.java:153) at org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.bundleChanged(JettyContextHandlerExtender.java:63) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)

    Java.net JIRA | 5 years ago | systemniq
    javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    [Neo4j] Issue in accessing the Neo4j Graph DB in Console - Grokbase

    grokbase.com | 8 months ago
    javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present
  5. 0

    Issue in accessing the Neo4j Graph DB in Console

    Stack Overflow | 3 years ago | p.lokeshreddy
    javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.servlet.UnavailableException

      com.sun.jersey.api.container.ContainerException: No WebApplication provider is present

      at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable()
    2. Jetty
      DeploymentManager.addApp
      1. org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:394)
      2. org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:439)
      3. org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:245)
      4. org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      5. org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:694)
      6. org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:193)
      7. org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:966)
      8. org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586)
      9. org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349)
      10. org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      11. org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:37)
      12. org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:182)
      13. org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)
      14. org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:136)
      14 frames
    3. org.eclipse.jetty
      JettyContextHandlerServiceTracker.serviceChanged
      1. org.eclipse.jetty.osgi.boot.OSGiAppProvider.addContext(OSGiAppProvider.java:154)
      2. org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:522)
      3. org.eclipse.jetty.osgi.boot.internal.webapp.WebappRegistrationHelper.registerWebapplication(WebappRegistrationHelper.java:438)
      4. org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker.serviceChanged(JettyContextHandlerServiceTracker.java:189)
      4 frames
    4. Eclipse OSGi
      FilteredServiceListener.serviceChanged
      1. org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
      1 frame
    5. Eclipse OSGi
      BundleContextImpl.dispatchEvent
      1. org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933)
      1 frame
    6. Eclipse OSGi
      ServiceRegistry.registerService
      1. org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
      2. org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
      3. org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:756)
      4. org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711)
      5. org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
      6. org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206)
      6 frames
    7. Eclipse OSGi
      BundleContextImpl.registerService
      1. org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507)
      2. org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525)
      2 frames
    8. org.eclipse.jetty
      JettyContextHandlerExtender.bundleChanged
      1. org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.registerWebapplication(JettyBootstrapActivator.java:166)
      2. org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.register(JettyContextHandlerExtender.java:153)
      3. org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerExtender.bundleChanged(JettyContextHandlerExtender.java:63)
      3 frames
    9. Eclipse OSGi
      BundleContextImpl.dispatchEvent
      1. org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
      1 frame
    10. Eclipse OSGi
      EventManager$EventThread.run
      1. org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
      2. org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
      2 frames