Open ulisse1996 opened 5 months ago
Providing stacktrace when JacksonSupport gets instanced to know what can be done regarding CDI:
Thread [main] (Suspended (breakpoint at line 44 in io.helidon.http.media.jackson.JacksonMediaSupportProvider))
owns: org.jboss.weld.Container (id=117)
io.helidon.http.media.jackson.JacksonMediaSupportProvider.create(io.helidon.common.config.Config, java.lang.String) line: 44
io.helidon.http.media.jackson.JacksonMediaSupportProvider.create(io.helidon.common.config.Config, java.lang.String) line: 27
io.helidon.builder.api.ProvidedUtil.lambda$servicesFromObject$2(java.util.Map, java.util.Set, java.util.Set, boolean, java.util.Set, java.util.List, io.helidon.common.config.Config, io.helidon.common.config.ConfiguredProvider) line: 205
io.helidon.builder.api.ProvidedUtil$$Lambda.0x00007f5888367d28.accept(java.lang.Object) line: not available
java.util.LinkedList<E>(java.lang.Iterable<T>).forEach(java.util.function.Consumer<? super T>) line: 75
io.helidon.common.HelidonServiceLoader<T>.forEach(java.util.function.Consumer<? super T>) line: 123
io.helidon.builder.api.ProvidedUtil.servicesFromObject(io.helidon.common.config.Config, io.helidon.common.HelidonServiceLoader<? extends io.helidon.common.config.ConfiguredProvider<T>>, java.lang.Class<? extends io.helidon.common.config.ConfiguredProvider<T>>, java.lang.Class<T>, java.util.List<io.helidon.builder.api.ProvidedUtil.ConfiguredService>, boolean, java.util.Set<io.helidon.builder.api.ProvidedUtil.TypeAndName>) line: 194
io.helidon.builder.api.ProvidedUtil.discoverServices(io.helidon.common.config.Config, java.lang.String, io.helidon.common.HelidonServiceLoader<? extends io.helidon.common.config.ConfiguredProvider<T>>, java.lang.Class<? extends io.helidon.common.config.ConfiguredProvider<T>>, java.lang.Class<T>, boolean, java.util.List<T>) line: 168
io.helidon.http.media.MediaContextConfig$Builder(io.helidon.builder.api.Prototype$ConfiguredBuilder<BUILDER,PROTOTYPE>).discoverServices(io.helidon.common.config.Config, java.lang.String, io.helidon.common.HelidonServiceLoader<T>, java.lang.Class<T>, java.lang.Class<S>, boolean, java.util.List<S>) line: 122
io.helidon.http.media.MediaContextConfig$Builder(io.helidon.http.media.MediaContextConfig$BuilderBase<BUILDER,PROTOTYPE>).preBuildPrototype() line: 342
io.helidon.http.media.MediaContextConfig$Builder.buildPrototype() line: 452
io.helidon.http.media.MediaContextConfig$Builder.build() line: 459
io.helidon.http.media.MediaContext.create() line: 38
io.helidon.webserver.LoomServer$$Lambda.0x00007f588837de10.get() line: not available
java.util.Optional<T>.orElseGet(java.util.function.Supplier<? extends T>) line: 364
io.helidon.webserver.LoomServer.lambda$new$1(io.helidon.webserver.ServerFeatureContextImpl, java.util.Map, java.util.Timer, io.helidon.webserver.WebServerConfig, java.lang.String, io.helidon.webserver.ListenerConfig) line: 98
io.helidon.webserver.LoomServer$$Lambda.0x00007f5888376b38.accept(java.lang.Object, java.lang.Object) line: not available
java.util.HashMap<K,V>.forEach(java.util.function.BiConsumer<? super K,? super V>) line: 1429
io.helidon.webserver.LoomServer.<init>(io.helidon.webserver.WebServerConfig) line: 90
io.helidon.webserver.WebServer.create(io.helidon.webserver.WebServerConfig) line: 45
io.helidon.webserver.WebServerConfig$Builder.build() line: 662
io.helidon.microprofile.server.ServerCdiExtension.startServer(java.lang.Object, jakarta.enterprise.inject.spi.BeanManager) line: 460
java.lang.invoke.DirectMethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) line: not available
java.lang.invoke.LambdaForm$MH.0x00007f58882bc800.invoke(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) line: not available
java.lang.invoke.LambdaForm$MH.0x00007f5888265400.invokeExact_MT(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) line: not available
jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.lang.Object, java.lang.Object[]) line: 155
jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.lang.Object, java.lang.Object[]) line: 103
java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 580
org.jboss.weld.injection.VirtualMethodInjectionPoint<T,X>(org.jboss.weld.injection.StaticMethodInjectionPoint<T,X>).invoke(java.lang.Object, java.lang.Object[], java.lang.Class<? extends java.lang.RuntimeException>) line: 95
org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(java.lang.Object, org.jboss.weld.injection.MethodInjectionPoint<?,?>, T, org.jboss.weld.manager.BeanManagerImpl, jakarta.enterprise.context.spi.CreationalContext<?>) line: 187
org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>(org.jboss.weld.event.ObserverMethodImpl<T,X>).sendEvent(T, java.lang.Object, jakarta.enterprise.context.spi.CreationalContext<?>) line: 330
org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>.sendEvent(T, java.lang.Object, jakarta.enterprise.context.spi.CreationalContext<?>) line: 126
org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>(org.jboss.weld.event.ObserverMethodImpl<T,X>).sendEvent(T) line: 308
org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>(org.jboss.weld.event.ObserverMethodImpl<T,X>).notify(T) line: 286
org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>(jakarta.enterprise.inject.spi.ObserverMethod<T>).notify(jakarta.enterprise.inject.spi.EventContext<T>) line: 142
org.jboss.weld.util.Observers.notify(jakarta.enterprise.inject.spi.ObserverMethod<? super T>, T, jakarta.enterprise.inject.spi.EventMetadata) line: 166
org.jboss.weld.event.ObserverNotifier.notifySyncObservers(java.util.List<jakarta.enterprise.inject.spi.ObserverMethod<? super T>>, T, jakarta.enterprise.inject.spi.EventMetadata, org.jboss.weld.event.ObserverNotifier.ObserverExceptionHandler) line: 285
org.jboss.weld.event.ObserverNotifier.notify(org.jboss.weld.event.ResolvedObservers<T>, T, jakarta.enterprise.inject.spi.EventMetadata) line: 273
org.jboss.weld.event.EventImpl<T>.fire(T) line: 96
io.helidon.microprofile.cdi.HelidonContainerImpl.doStart() line: 311
io.helidon.microprofile.cdi.HelidonContainerImpl$$Lambda.0x00007f58882b6038.call() line: not available
io.helidon.common.context.Contexts.runInContext(io.helidon.common.context.Context, java.util.concurrent.Callable<T>) line: 137
io.helidon.microprofile.cdi.HelidonContainerImpl.start() line: 258
io.helidon.microprofile.server.ServerImpl.start() line: 78
io.helidon.microprofile.server.JaxRsJacksonTest.beforeAll() line: 49
java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object) line: not available
java.lang.invoke.LambdaForm$MH.0x00007f58880b8400.invoke(java.lang.Object, java.lang.Object) line: not available
java.lang.invoke.Invokers$Holder.invokeExact_MT(java.lang.Object, java.lang.Object, java.lang.Object) line: not available
jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.lang.Object, java.lang.Object[]) line: 153
jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.lang.Object, java.lang.Object[]) line: 103
java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 580
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(java.lang.reflect.Method, java.lang.Object, java.lang.Object...) line: 727
org.junit.jupiter.engine.execution.MethodInvocation<T>.proceed() line: 60
org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation<T>.proceed() line: 131
org.junit.jupiter.engine.extension.TimeoutExtension.intercept(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>, org.junit.jupiter.api.extension.ReflectiveInvocationContext<java.lang.reflect.Method>, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.engine.extension.TimeoutDuration, org.junit.jupiter.engine.extension.TimeoutExtension.TimeoutProvider) line: 156
org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void>, org.junit.jupiter.api.extension.ReflectiveInvocationContext<java.lang.reflect.Method>, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.engine.extension.TimeoutExtension.TimeoutProvider) line: 128
org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void>, org.junit.jupiter.api.extension.ReflectiveInvocationContext<java.lang.reflect.Method>, org.junit.jupiter.api.extension.ExtensionContext) line: 70
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$$Lambda.0x00007f58880b1c68.apply(org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor$Invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext, org.junit.jupiter.api.extension.ExtensionContext) line: not available
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall<E,T>.lambda$ofVoidMethod$0(org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall, org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor$Invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext, org.junit.jupiter.api.extension.ExtensionContext) line: 103
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda.0x00007f5888083b70.apply(org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor$Invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext, org.junit.jupiter.api.extension.ExtensionContext) line: not available
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall, org.junit.jupiter.api.extension.ReflectiveInvocationContext, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor$Invocation) line: 93
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda.0x00007f58880b2700.apply(org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor$Invocation) line: not available
org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation<T>.proceed() line: 106
org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>) line: 64
org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>, org.junit.jupiter.engine.execution.InvocationInterceptorChain.InterceptorCall<T>, java.util.List<org.junit.jupiter.api.extension.InvocationInterceptor>) line: 45
org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>, org.junit.jupiter.engine.extension.ExtensionRegistry, org.junit.jupiter.engine.execution.InvocationInterceptorChain.InterceptorCall<T>) line: 37
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>, org.junit.jupiter.api.extension.ReflectiveInvocationContext<E>, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.engine.extension.ExtensionRegistry, org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.ReflectiveInterceptorCall<E,T>) line: 92
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(java.lang.reflect.Method, java.lang.Object, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.engine.extension.ExtensionRegistry, org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.ReflectiveInterceptorCall<java.lang.reflect.Method,T>) line: 86
org.junit.jupiter.engine.descriptor.ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor).lambda$invokeBeforeAllMethods$13(java.lang.reflect.Method, java.lang.Object, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.engine.extension.ExtensionRegistry) line: 411
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$$Lambda.0x00007f58880b1a48.execute() line: not available
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector(org.junit.platform.engine.support.hierarchical.ThrowableCollector).execute(org.junit.platform.engine.support.hierarchical.ThrowableCollector$Executable) line: 73
org.junit.jupiter.engine.descriptor.ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor).invokeBeforeAllMethods(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext) line: 409
org.junit.jupiter.engine.descriptor.ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor).before(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext) line: 215
org.junit.jupiter.engine.descriptor.ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor).before(org.junit.platform.engine.support.hierarchical.EngineExecutionContext) line: 84
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$6() line: 148
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a46a8.execute() line: not available
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector(org.junit.platform.engine.support.hierarchical.ThrowableCollector).execute(org.junit.platform.engine.support.hierarchical.ThrowableCollector$Executable) line: 73
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$8(org.junit.platform.engine.support.hierarchical.EngineExecutionContext) line: 141
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a4488.invoke(org.junit.platform.engine.support.hierarchical.EngineExecutionContext) line: not available
org.junit.jupiter.engine.descriptor.ClassTestDescriptor(org.junit.platform.engine.support.hierarchical.Node<C>).around(C, org.junit.platform.engine.support.hierarchical.Node.Invocation<C>) line: 137
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$9() line: 139
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a4070.execute() line: not available
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector(org.junit.platform.engine.support.hierarchical.ThrowableCollector).execute(org.junit.platform.engine.support.hierarchical.ThrowableCollector$Executable) line: 73
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.executeRecursively() line: 138
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.execute() line: 95
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda.0x00007f58880a5198.accept(java.lang.Object) line: not available
java.util.ArrayList<E>.forEach(java.util.function.Consumer<? super E>) line: 1596
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(java.util.List<? extends org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.TestTask>) line: 41
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$6() line: 155
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a46a8.execute() line: not available
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector(org.junit.platform.engine.support.hierarchical.ThrowableCollector).execute(org.junit.platform.engine.support.hierarchical.ThrowableCollector$Executable) line: 73
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$8(org.junit.platform.engine.support.hierarchical.EngineExecutionContext) line: 141
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a4488.invoke(org.junit.platform.engine.support.hierarchical.EngineExecutionContext) line: not available
org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor(org.junit.platform.engine.support.hierarchical.Node<C>).around(C, org.junit.platform.engine.support.hierarchical.Node.Invocation<C>) line: 137
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.lambda$executeRecursively$9() line: 139
org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda.0x00007f58880a4070.execute() line: not available
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector(org.junit.platform.engine.support.hierarchical.ThrowableCollector).execute(org.junit.platform.engine.support.hierarchical.ThrowableCollector$Executable) line: 73
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.executeRecursively() line: 138
org.junit.platform.engine.support.hierarchical.NodeTestTask<C>.execute() line: 95
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.TestTask) line: 35
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor<C>.execute() line: 57
org.junit.jupiter.engine.JupiterTestEngine(org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine<C>).execute(org.junit.platform.engine.ExecutionRequest) line: 54
org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.EngineExecutionListener, org.junit.platform.engine.ConfigurationParameters, org.junit.platform.engine.TestEngine) line: 147
org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(org.junit.platform.launcher.core.LauncherDiscoveryResult, org.junit.platform.engine.EngineExecutionListener) line: 127
org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(org.junit.platform.launcher.core.InternalTestPlan, org.junit.platform.engine.EngineExecutionListener, org.junit.platform.launcher.TestExecutionListener) line: 90
org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(org.junit.platform.launcher.core.InternalTestPlan, org.junit.platform.launcher.TestExecutionListener) line: 55
org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda.0x00007f5888092180.accept(java.lang.Object) line: not available
org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(org.junit.platform.engine.ConfigurationParameters, org.junit.platform.launcher.core.ListenerRegistry<org.junit.platform.launcher.TestExecutionListener>, java.util.function.Consumer<org.junit.platform.launcher.TestExecutionListener>) line: 102
org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(org.junit.platform.launcher.core.InternalTestPlan, org.junit.platform.launcher.TestExecutionListener...) line: 54
org.junit.platform.launcher.core.DefaultLauncher.execute(org.junit.platform.launcher.core.InternalTestPlan, org.junit.platform.launcher.TestExecutionListener[]) line: 114
org.junit.platform.launcher.core.DefaultLauncher.execute(org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.TestExecutionListener...) line: 86
org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.TestExecutionListener...) line: 86
org.apache.maven.surefire.junitplatform.LazyLauncher.execute(org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.TestExecutionListener...) line: 50
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(org.apache.maven.surefire.api.util.TestsToRun, org.apache.maven.surefire.junitplatform.RunListenerAdapter) line: 184
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(org.apache.maven.surefire.api.util.TestsToRun, org.apache.maven.surefire.junitplatform.RunListenerAdapter) line: 148
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(java.lang.Object) line: 122
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess() line: 385
org.apache.maven.surefire.booter.ForkedBooter.execute() line: 162
org.apache.maven.surefire.booter.ForkedBooter.run(org.apache.maven.surefire.booter.ForkedBooter, java.lang.String[]) line: 507
org.apache.maven.surefire.booter.ForkedBooter.main(java.lang.String[]) line: 495
SE media support and Jersey media support have nothing in common since MP media support comes from Jersey. Having an SPI that would provide something for both would be a bit weird.
Right now Helidon MP provide a way of using using jackson with jersey (using jersey-media-json-jackson) but it's missing a way of providing a customizer for ObjectMapper as other framework (like Quarkus) do for other use cases.
The main concept is:
For jersey, provide a ContextResolver to resolve the produced ObjectMapper
The best approach would be to make this integration using SPI so it can be used for both MP (with CDI) and SE (using the standard SPI)
Environment Details
Problem Description
Steps to reproduce
None