[
https://issues.apache.org/jira/browse/SOLR-16840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17737690#comment-17737690
]
Jason Gerlowski commented on SOLR-16840:
----------------------------------------
Looks like the same behavior reported in Jersey's issue tracker
https://github.com/eclipse-ee4j/jersey/issues/3503 and
https://github.com/eclipse-ee4j/jersey/issues/3498. The root problem, a bug in
how Jersey orders various "RequestScoped" object creations hasn't been fixed
yet by Jersey, but it looks like there's a pretty straightforward workaround.
Essentially, rather than injecting a "ContainerRequestContext" in several
factories, we can lookup the CRC lazily via a "ServiceLocator" instance. This
isn't ideal, but it's a solid workaround until Jersey fixes the bug upstream,
and I've verified that it works for us. Will push up a PR for review shortly.
> Fix overly verbose v2 API console logging
> -----------------------------------------
>
> Key: SOLR-16840
> URL: https://issues.apache.org/jira/browse/SOLR-16840
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: v2 API
> Reporter: Jason Gerlowski
> Priority: Major
>
> Currently, Solr has some v2 APIs (particularly our "admin" APIs) that appear
> to work just fine, but produce some scary looking stacktraces in the console
> log that appear to be dependency-injection related. (See below for an
> example)
> These don't appear to have any impact on the successful execution of the API,
> but we should understand why these are printed and either fix the problem (if
> there is one) or suppress the logging to avoid causing users undue concern.
> Example 1:
> {code}
> WARNING: The following warnings have been detected: WARNING: HK2 failure has
> been detected in a code that does not run in an active Jersey Error scope.
> WARNING: Unknown HK2 failure detected:
> MultiException stack 1 of 1
> java.lang.NullPointerException
> at
> org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator$ContainerRequestFactory.get(RequestProcessingConfigurator.java:67)
> at
> org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator$ContainerRequestFactory.get(RequestProcessingConfigurator.java:56)
> at
> org.glassfish.jersey.inject.hk2.SupplierFactoryBridge.provide(SupplierFactoryBridge.java:76)
> at
> org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:129)
> at
> org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
> at
> org.glassfish.jersey.inject.hk2.RequestContext.findOrCreate(RequestContext.java:59)
> at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
> at
> org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:679)
> at
> org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:54)
> at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:188)
> at
> org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:205)
> at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)
> at
> org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
> at
> org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
> at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
> at
> org.jvnet.hk2.internal.FactoryCreator.dispose(FactoryCreator.java:151)
> at
> org.jvnet.hk2.internal.SystemDescriptor.dispose(SystemDescriptor.java:518)
> at
> org.glassfish.jersey.inject.hk2.RequestContext.lambda$findOrCreate$0(RequestContext.java:60)
> at
> org.glassfish.jersey.internal.inject.ForeignDescriptorImpl.dispose(ForeignDescriptorImpl.java:63)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.remove(Hk2RequestScope.java:126)
> at java.base/java.lang.Iterable.forEach(Iterable.java:75)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.release(Hk2RequestScope.java:143)
> at
> org.glassfish.jersey.process.internal.RequestScope.release(RequestScope.java:246)
> at
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:267)
> at
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
> at
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:384)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:348)
> at org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:433)
> at
> org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:870)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:541)
> at
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)
> at
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)
> at
> org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)
> at
> org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)
> at
> org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
> at
> org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
> {code}
> Example 2:
> {code}
> MultiException stack 1 of 1
> java.lang.NullPointerException
> at
> org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator$ContainerRequestFactory.get(RequestProcessingConfigurator.java:67)
> at
> org.glassfish.jersey.server.internal.process.RequestProcessingConfigurator$ContainerRequestFactory.get(RequestProcessingConfigurator.java:56)
> at
> org.glassfish.jersey.inject.hk2.SupplierFactoryBridge.provide(SupplierFactoryBridge.java:76)
> at
> org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:129)
> at
> org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
> at
> org.glassfish.jersey.inject.hk2.RequestContext.findOrCreate(RequestContext.java:59)
> at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
> at
> org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:679)
> at
> org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:54)
> at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:188)
> at
> org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:205)
> at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)
> at
> org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
> at
> org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
> at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
> at
> org.jvnet.hk2.internal.FactoryCreator.dispose(FactoryCreator.java:151)
> at
> org.jvnet.hk2.internal.SystemDescriptor.dispose(SystemDescriptor.java:518)
> at
> org.glassfish.jersey.inject.hk2.RequestContext.lambda$findOrCreate$0(RequestContext.java:60)
> at
> org.glassfish.jersey.internal.inject.ForeignDescriptorImpl.dispose(ForeignDescriptorImpl.java:63)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.remove(Hk2RequestScope.java:126)
> at java.base/java.lang.Iterable.forEach(Iterable.java:75)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.release(Hk2RequestScope.java:143)
> at
> org.glassfish.jersey.process.internal.RequestScope.release(RequestScope.java:246)
> at
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:267)
> at
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
> at
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:384)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:348)
> at org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:433)
> at
> org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:870)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:541)
> at
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)
> at
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)
> at
> org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)
> at
> org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)
> ...
> MultiException stack 2 of 3
> java.lang.IllegalArgumentException: While attempting to resolve the
> dependencies of
> org.apache.solr.jersey.InjectionFactories$SolrQueryRequestFactory errors were
> found
> at
> org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:224)
> at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)
> at
> org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
> at
> org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
> at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
> at
> org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
> at
> org.jvnet.hk2.internal.FactoryCreator.dispose(FactoryCreator.java:151)
> at
> org.jvnet.hk2.internal.SystemDescriptor.dispose(SystemDescriptor.java:518)
> at
> org.glassfish.jersey.inject.hk2.RequestContext.lambda$findOrCreate$0(RequestContext.java:60)
> at
> org.glassfish.jersey.internal.inject.ForeignDescriptorImpl.dispose(ForeignDescriptorImpl.java:63)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.remove(Hk2RequestScope.java:126)
> at java.base/java.lang.Iterable.forEach(Iterable.java:75)
> at
> org.glassfish.jersey.inject.hk2.Hk2RequestScope$Instance.release(Hk2RequestScope.java:143)
> at
> org.glassfish.jersey.process.internal.RequestScope.release(RequestScope.java:246)
> at
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:267)
> at
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
> at
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:384)
> at
> org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:348)
> at org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:433)
> at
> org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:870)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:541)
> at
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)
> at
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]