java.lang.IllegalStateException: Cannot inject a custom principal into unauthenticated request

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 1713#243804875
    via GitHub by ggrnd0
    ,
    • java.lang.IllegalStateException: Cannot inject a custom principal into unauthenticated request at io.dropwizard.auth.PrincipalContainerRequestValueFactory.provide(PrincipalContainerRequestValueFactory.java:20) at io.dropwizard.auth.PrincipalContainerRequestValueFactory.provide(PrincipalContainerRequestValueFactory.java:12) at org.glassfish.jersey.server.internal.inject.ParamInjectionResolver.resolve(ParamInjectionResolver.java:134) at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:211) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:234) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471) at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022) at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:692) at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:211) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:234) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471) at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022) at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:692) at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:211) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:234) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471) at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:679) at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:211) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:234) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471) at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022) at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:765) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:704) at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172) at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:284) at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:318) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:34) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:50) at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:44) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:240) at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:459) at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:68) at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56) at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:524) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) at java.lang.Thread.run(Thread.java:745)
    No Bugmate found.