Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE is thrown when running in spring-boot #8

Open
ralf0131 opened this issue Mar 14, 2019 · 0 comments
Open

NPE is thrown when running in spring-boot #8

ralf0131 opened this issue Mar 14, 2019 · 0 comments

Comments

@ralf0131
Copy link
Collaborator

A java application running under spring boot:

2019-03-14 11:46:07.202 ERROR 20364 --- [rter-1-thread-1] com.alibaba.metrics.tomcat.HttpGaugeSet  : Exception occur when getting connector global stats: 

java.lang.NullPointerException: null
  at com.alibaba.metrics.tomcat.HttpGaugeSet.getValueInternal(HttpGaugeSet.java:87)
  at com.alibaba.metrics.CachedMetricSet.refreshIfNecessary(CachedMetricSet.java:48)
  at com.alibaba.metrics.tomcat.HttpGaugeSet$HttpStatGauge.getValue(HttpGaugeSet.java:169)
  at com.alibaba.metrics.reporter.bin.StructMetricManagerReporter.report(StructMetricManagerReporter.java:123)
  at com.alibaba.metrics.reporter.MetricManagerReporter.report(MetricManagerReporter.java:249)
  at com.alibaba.metrics.reporter.MetricManagerReporter$1.run(MetricManagerReporter.java:67)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)

image

It looks when populating metrics, there was only 1 connector returned by calling JMXUtils.getObjectNames(globalReqProcessor), however, during runtime, there is 2 connectors returned by calling the same method.

I think the code should check for possible newly added connectors during runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant