Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-15322

Internal Server Error when trying to start servlet due to missing CorsServiceConfig

    Details

    • Target Version/s:

      Description

      Bug description

      There is an intermittent failure where OpenAM will fail to start due to the following error:
      Error injecting constructor, java.lang.IllegalArgumentException: Not a registered service: interface org.forgerock.openam.cors.CorsServiceConfig

      Stacktrace:

      Exception
      javax.servlet.ServletException: Failed to load the Http Application class: null
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.load(HttpApplicationLoader.java:201)
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.access$100(HttpApplicationLoader.java:188)
      	org.forgerock.http.servlet.HttpApplicationLoader$3.load(HttpApplicationLoader.java:183)
      	org.forgerock.http.servlet.HttpFrameworkServlet.getApplication(HttpFrameworkServlet.java:220)
      	org.forgerock.http.servlet.HttpFrameworkServlet.init(HttpFrameworkServlet.java:162)
      	javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
      	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
      	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836)
      	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1839)
      	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	java.base/java.lang.Thread.run(Thread.java:834)
      Root Cause
      com.google.inject.ProvisionException: Unable to provision, see the following errors:
      
      1) Error injecting constructor, java.lang.IllegalArgumentException: Not a registered service: interface org.forgerock.openam.cors.CorsServiceConfig
        at org.forgerock.openam.cors.CorsFilter.<init>(Unknown Source)
        at org.forgerock.openam.cors.CorsFilter.class(Unknown Source)
        while locating org.forgerock.openam.cors.CorsFilter
          for the 1st parameter of org.forgerock.openam.oauth2.rest.OAuth2RouterProvider.setCorsFilter(Unknown Source)
        while locating org.forgerock.openam.oauth2.rest.OAuth2RouterProvider
        while locating org.forgerock.openam.http.HttpRouterProvider
        at org.forgerock.openam.http.HttpGuiceModule.configure(HttpGuiceModule.java:34)
        while locating org.forgerock.http.Handler annotated with @com.google.inject.name.Named(value="HttpHandler")
          for the 1st parameter of org.forgerock.openam.http.OpenAMHttpApplication.<init>(Unknown Source)
        at org.forgerock.openam.http.OpenAMHttpApplication.class(Unknown Source)
        while locating org.forgerock.openam.http.OpenAMHttpApplication
        while locating org.forgerock.http.HttpApplication
      
      1 error
      	com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
      	com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
      	com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
      	org.forgerock.guice.core.InjectorHolder.getInstance(InjectorHolder.java:72)
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.load(HttpApplicationLoader.java:193)
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.access$100(HttpApplicationLoader.java:188)
      	org.forgerock.http.servlet.HttpApplicationLoader$3.load(HttpApplicationLoader.java:183)
      	org.forgerock.http.servlet.HttpFrameworkServlet.getApplication(HttpFrameworkServlet.java:220)
      	org.forgerock.http.servlet.HttpFrameworkServlet.init(HttpFrameworkServlet.java:162)
      	javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
      	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
      	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836)
      	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1839)
      	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	java.base/java.lang.Thread.run(Thread.java:834)
      Root Cause
      java.lang.IllegalArgumentException: Not a registered service: interface org.forgerock.openam.cors.CorsServiceConfig
      	org.forgerock.util.Reject.ifFalse(Reject.java:183)
      	org.forgerock.openam.sm.SmsAnnotatedServiceRegistry.createListener(SmsAnnotatedServiceRegistry.java:230)
      	org.forgerock.openam.cors.CorsFilter.<init>(CorsFilter.java:52)
      	jdk.internal.reflect.GeneratedConstructorAccessor82.newInstance(Unknown Source)
      	java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      	com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126)
      	com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
      	com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
      	com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
      	com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
      	com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
      	com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
      	com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
      	com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:82)
      	com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:147)
      	com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:101)
      	com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:71)
      	com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:1014)
      	org.forgerock.openam.http.HttpRouterProvider.get(HttpRouterProvider.java:40)
      	org.forgerock.openam.http.HttpRouterProvider.get(HttpRouterProvider.java:25)
      	com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:85)
      	com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:77)
      	com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:59)
      	com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
      	com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
      	com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
      	com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
      	com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
      	com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
      	com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
      	com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
      	com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
      	com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
      	com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
      	com.google.inject.internal.ExposedKeyFactory.get(ExposedKeyFactory.java:57)
      	com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
      	com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
      	org.forgerock.guice.core.InjectorHolder.getInstance(InjectorHolder.java:72)
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.load(HttpApplicationLoader.java:193)
      	org.forgerock.http.servlet.HttpApplicationLoader$LazilyLinkGuice.access$100(HttpApplicationLoader.java:188)
      	org.forgerock.http.servlet.HttpApplicationLoader$3.load(HttpApplicationLoader.java:183)
      	org.forgerock.http.servlet.HttpFrameworkServlet.getApplication(HttpFrameworkServlet.java:220)
      	org.forgerock.http.servlet.HttpFrameworkServlet.init(HttpFrameworkServlet.java:162)
      	javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:49
      

      How to reproduce the issue

      Details steps outlining how to recreate the issue (remove this text)

      It's an intermittent failure and not sure how it is caused. Happened when creating a new FRaaS environment.

      A delete of the pod which created a new one fixed the issue,

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gilbert.holland-lloyd Gilbert Holland-Lloyd [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: