jersey
  1. jersey
  2. JERSEY-709

unnecessary alarm raised by message: No OAuthProvider implementation found in the list of providers.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: security
    • Labels:
      None
    • Environment:

      Linux Ubuntu 9.10.

      Description

      I have a JUnit test that starts a Jetty server for serving a hello world resource using Jersey (included below).

      When my server starts, it prints out the following exception message:

      SEVERE: The provider class, class com.sun.jersey.oauth.server.OAuthProviderInjectionProvider, \
      could not be instantiated. Processing will continue but the class will not be utilized
      java.lang.RuntimeException: No OAuthProvider implementation found in the list of providers.
      at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider.<init> \
      (OAuthProviderInjectionProvider.java:71)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      Full stack trace below.

      I am using OAuth 1.6.

      The exception seems harmless but appears if the OAuth 1.6 jar file is in the server classpath and goes away when the OAuth 1.6 server jar file is removed from the classpath.

      Note that the test itself as shown does not directly do anything with OAuth. I can extend this test to use OAuth in the client and the server OK. Nevertheless, the message is an eysore and can raise unnecessary alarm to a system administrator or a new developer. And I have not been able to figure out how to avoid it.

      Having raised this issue in the users mailing list, I was advised to report it as a bug.

      Here is the test case:

      public class TrialTest extends TestCase
      {
      public void testStartServer() throws Exception

      { Server instance = new Server(8181); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath("/services"); instance.setHandler(context); Servlet servlet = new com.sun.jersey.spi.container.servlet.ServletContainer(); ServletHolder servletHolder = new ServletHolder(servlet); Map<String, String> initParameters = new HashMap<String, String>(); initParameters.put("com.sun.jersey.config.property.packages", HelloWorldResource.class.getPackage().getName()); servletHolder.setInitParameters(initParameters); context.addServlet(servletHolder, "/rest/*"); instance.start(); }

      }

      And the server output.

      2011-04-07 00:30:11.433:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
      2011-04-07 00:30:11.488:INFO::jetty-7.0.2.v20100331
      Apr 7, 2011 12:30:11 AM com.sun.jersey.api.core.PackagesResourceConfig init
      INFO: Scanning for root resource and provider classes in the packages:
      com.bolour.trial.jersey.resources
      Apr 7, 2011 12:30:11 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
      INFO: Root resource classes found:
      class com.bolour.trial.jersey.resources.HelloWorldResource
      Apr 7, 2011 12:30:11 AM com.sun.jersey.api.core.ScanningResourceConfig init
      INFO: No provider classes found.
      Apr 7, 2011 12:30:11 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
      INFO: Initiating Jersey application, version 'Jersey: 1.6-SNAPSHOT 03/24/2011 01:01 PM'
      Apr 7, 2011 12:30:11 AM com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider
      SEVERE: The provider class, class com.sun.jersey.oauth.server.OAuthProviderInjectionProvider,
      could not be instantiated. Processing will continue but the class will not be utilized
      java.lang.RuntimeException: No OAuthProvider implementation found in the list of providers.
      at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider.<init>(OAuthProviderInjectionProvider.java:71)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:198)
      at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:169)
      at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
      at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
      at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)
      at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:205)
      at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:106)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1017)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.access$600(WebApplicationImpl.java:159)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:693)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:690)
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:690)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:685)
      at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:601)
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:421)
      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.server.handler.ContextHandler.doStart(ContextHandler.java:586)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
      at org.eclipse.jetty.server.Server.doStart(Server.java:230)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at com.bolour.trial.jersey.TrialTest.testStartServer(TrialTest.java:30)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at junit.framework.TestCase.runTest(TestCase.java:164)
      at junit.framework.TestCase.runBare(TestCase.java:130)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:120)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      2011-04-07 00:30:12.272:INFO::Started SelectChannelConnector@0.0.0.0:8181

        Activity

        Hide
        azadbolour added a comment -

        Sorry. Should have been assigned to Martin Matula. Not sure if I have permission to change default assignment.

        Show
        azadbolour added a comment - Sorry. Should have been assigned to Martin Matula. Not sure if I have permission to change default assignment.
        Hide
        Pavel Bucek added a comment -

        assigning

        Show
        Pavel Bucek added a comment - assigning
        Hide
        Martin Matula added a comment -

        Fixed in rev. 4931.

        Show
        Martin Matula added a comment - Fixed in rev. 4931.
        Hide
        jp.pellerin added a comment -

        Still getting this error using jersey 1.17 on Glassfish 3.1.2.2.

        Show
        jp.pellerin added a comment - Still getting this error using jersey 1.17 on Glassfish 3.1.2.2.

          People

          • Assignee:
            Martin Matula
            Reporter:
            azadbolour
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: