You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Micrometer 1.6.x (latest) doesn't support the Prometheus client 0.10.x and it causes a runtime error when we are using any other integration which uses prometheus like spring batch , spring cloud stream kafka.
Motivation for or Use Case
Reproduce the error
Create a microservice with Jhipster 7.0.1
Add spring-boot-starter-batch package
2021-04-09 04:25:14.299 ERROR 76876 --- [er-scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
java.lang.NoSuchFieldError: UNTYPED
at io.micrometer.prometheus.MicrometerCollector.describe(MicrometerCollector.java:100)
at io.prometheus.client.CollectorRegistry.collectorNames(CollectorRegistry.java:98)
at io.prometheus.client.CollectorRegistry.register(CollectorRegistry.java:50)
at io.prometheus.client.Collector.register(Collector.java:175)
at io.micrometer.prometheus.PrometheusMeterRegistry.lambda$applyToCollector$16(PrometheusMeterRegistry.java:412)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1947)
at io.micrometer.prometheus.PrometheusMeterRegistry.applyToCollector(PrometheusMeterRegistry.java:408)
at io.micrometer.prometheus.PrometheusMeterRegistry.newLongTaskTimer(PrometheusMeterRegistry.java:221)
at io.micrometer.core.instrument.MeterRegistry$More.lambda$longTaskTimer$0(MeterRegistry.java:878)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:614)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:568)
at io.micrometer.core.instrument.MeterRegistry.access$600(MeterRegistry.java:77)
at io.micrometer.core.instrument.MeterRegistry$More.longTaskTimer(MeterRegistry.java:876)
at io.micrometer.core.instrument.LongTaskTimer$Builder.register(LongTaskTimer.java:407)
at io.micrometer.core.instrument.composite.CompositeLongTaskTimer.registerNewMeter(CompositeLongTaskTimer.java:98)
at io.micrometer.core.instrument.composite.CompositeLongTaskTimer.registerNewMeter(CompositeLongTaskTimer.java:30)
at io.micrometer.core.instrument.composite.AbstractCompositeMeter.add(AbstractCompositeMeter.java:66)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at java.base/java.util.Collections$SetFromMap.forEach(Collections.java:5581)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$0(CompositeMeterRegistry.java:65)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lock(CompositeMeterRegistry.java:184)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$1(CompositeMeterRegistry.java:65)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:624)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:568)
at io.micrometer.core.instrument.MeterRegistry.access$600(MeterRegistry.java:77)
at io.micrometer.core.instrument.MeterRegistry$More.longTaskTimer(MeterRegistry.java:876)
at io.micrometer.core.instrument.LongTaskTimer$Builder.register(LongTaskTimer.java:407)
at org.springframework.batch.core.metrics.BatchMetrics.createLongTaskTimer(BatchMetrics.java:88)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:149)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:140)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:128)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy225.run(Unknown Source)
at com.vendorlytic.tracker.config.BatchConfiguration.run(BatchConfiguration.java:100)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
And for kafka
Caused by: java.lang.NoSuchFieldError: io/prometheus/client/Collector$Type.UNTYPED
at io.micrometer.prometheus.PrometheusMeterRegistry.newMeter(PrometheusMeterRegistry.java:253)
at io.micrometer.core.instrument.MeterRegistry.lambda$register$4(MeterRegistry.java:335)
at io.micrometer.core.instrument.MeterRegistry$$Lambda$2050/00000000FEC23520.apply(Unknown Source)
at io.micrometer.core.instrument.MeterRegistry.lambda$registerMeterIfNecessary$5(MeterRegistry.java:561)
at io.micrometer.core.instrument.MeterRegistry$$Lambda$701/0000000000000000.apply(Unknown Source)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:614)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:568)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:561)
at io.micrometer.core.instrument.MeterRegistry.register(MeterRegistry.java:335)
at io.micrometer.core.instrument.Meter$Builder.register(Meter.java:468)
at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.getCommonTags(KafkaMetrics.java:109)
at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.bindTo(KafkaMetrics.java:101)
at io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics.bindTo(KafkaClientMetrics.java:39)
at org.springframework.kafka.core.MicrometerProducerListener.producerAdded(MicrometerProducerListener.java:75)
at org.springframework.kafka.core.DefaultKafkaProducerFactory.lambda$doCreateProducer$14(DefaultKafkaProducerFactory.java:546)
at org.springframework.kafka.core.DefaultKafkaProducerFactory$$Lambda$2048/00000000FEC4E920.accept(Unknown Source)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1507)
at org.springframework.kafka.core.DefaultKafkaProducerFactory.doCreateProducer(DefaultKafkaProducerFactory.java:546)
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createProducer(DefaultKafkaProducerFactory.java:519)
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createProducer(DefaultKafkaProducerFactory.java:513)
at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.lambda$createProducerMessageHandler$0(KafkaMessageChannelBinder.java:396)
at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder$$Lambda$2042/00000000FC919D80.call(Unknown Source)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.lambda$getPartitionsForTopic$6(KafkaTopicProvisioner.java:535)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner$$Lambda$2043/00000000FEC22980.doWithRetry(Unknown Source)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:209)
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.getPartitionsForTopic(KafkaTopicProvisioner.java:530)
at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.createProducerMessageHandler(KafkaMessageChannelBinder.java:394)
at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.createProducerMessageHandler(KafkaMessageChannelBinder.java:158)
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindProducer(AbstractMessageChannelBinder.java:226)
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindProducer(AbstractMessageChannelBinder.java:91)
at org.springframework.cloud.stream.binder.AbstractBinder.bindProducer(AbstractBinder.java:152)
at org.springframework.cloud.stream.binding.BindingService.doBindProducer(BindingService.java:320)
at org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:285)
at org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:294)
at org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:298)
at org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.createAndBindOutputs(AbstractBindableProxyFactory.java:142)
at org.springframework.cloud.stream.binding.OutputBindingLifecycle.doStartWithBindable(OutputBindingLifecycle.java:58)
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle$$Lambda$1280/0000000000000000.accept(Unknown Source)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.start(AbstractBindingLifecycle.java:57)
at org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:34)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
... 14 common frames omitted
Related issues
Suggest a Fix
Explicitly add the Promethous client with version 0.9.0
Overview of the issue
Microservices depend , (created with Jhipster 7.0.1)
Micrometer 1.6.x (latest) doesn't support the Prometheus client 0.10.x and it causes a runtime error when we are using any other integration which uses prometheus like spring batch , spring cloud stream kafka.
Motivation for or Use Case
Reproduce the error
Create a microservice with Jhipster 7.0.1
Add spring-boot-starter-batch package
Or Just Create Add spring cloud stream kafka
Run ./mvnw
for spring batch
The jobs don't run
And for kafka
Related issues
Suggest a Fix
Explicitly add the Promethous client with version 0.9.0
Or use
Which is Already done By this https://github.com/jhipster/jhipster-bom/pull/262/commits
But This Commit Override that changes
jhipster/jhipster-bom@c0cac0e#diff-0d668ec3c10cccac1406ac2a804514459cae3804b12db7d87956ace40698a874
JHipster Version(s)
Jhipster 7.0.1
JHipster configuration
The text was updated successfully, but these errors were encountered: