You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Ivan Junckes Filho <iv...@gmail.com> on 2018/11/19 11:31:31 UTC

Re: TomEE8 RC2: MP Metrics @Counted throws 500

Hey guys, I also had the same issue here.

The application metrics do not work. Base and Vendor metrics are fine.

I am troubleshooting to see if I can find the issue. I will let you know if
I find something.

Please if you already had the chance to look into this let me know.

On Tue, Oct 16, 2018 at 5:58 PM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Did you clean up your lib folder to kot provide mp libs?
>
> Le mar. 16 oct. 2018 19:18, César Hernández Mendoza <ce...@gmail.com>
> a écrit :
>
> > Hi Romain,
> >
> > On this commit to master:
> >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/commit/37e40dfc4fbdc65e95f90f3651b186aa2652c89f
> >
> > I added @ApplicationScoped to the resource, removed the monotonic and
> added
> > beans.xml but still, the issue arises
> >
> >
> > El lun., 15 oct. 2018 a las 16:21, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) escribió:
> >
> > > Hey César,
> > >
> > > not sure the link with monotonic - there is none - but the issue is
> when
> > > using a name which does not exist then the endpoint fail with a 500
> > >
> > > Your endpoint not being a CDI bean it does not support MP metrics so
> just
> > > adding @ApplicationScoped is enough to fix it.
> > > On another side i'll try to make the endpoint not failing this way on
> > > geronimo-metrics side.
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <
> > > https://github.com/rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > >
> > >
> > >
> > > Le lun. 15 oct. 2018 à 22:58, César Hernández Mendoza <
> > > cesarguate@gmail.com>
> > > a écrit :
> > >
> > > > Thanks for the reply, this is the repo I created with the minimal
> > > > configuration to show the issue:
> > > > https://github.com/cesarhernandezgt/tomee-mp-metrics-examples
> > > >
> > > > El lun., 15 oct. 2018 a las 13:18, Romain Manni-Bucau (<
> > > > rmannibucau@gmail.com>) escribió:
> > > >
> > > > > Can you push your app on github with tomee maven plugin set up?
> Will
> > be
> > > > > easier to check.
> > > > >
> > > > > Le lun. 15 oct. 2018 19:46, César Hernández Mendoza <
> > > > cesarguate@gmail.com>
> > > > > a écrit :
> > > > >
> > > > > >
> > > > > >> I noticed that on my previous email I paste I paste the
> exception
> > > from
> > > > > > the HTTP response and not the one from the log (attached).
> > > > > >
> > > > > > Some other things I did without success:
> > > > > > * Added `geronimo.metrics.jaxrs.activated=true` to tomee
> > > > > system.properties.
> > > > > > * Make the Resource @ApplicationScoped
> > > > > > * Debugged geronimo-metrics code and for some reason I couldn't
> > > > identify
> > > > > > so far, this is where we get the Nullpointer:
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/geronimo-metrics/blob/master/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/PrometheusFormatter.java#L55
> > > > > > it  seems like if the annotation was not added.
> > > > > > * The same issue arise when you try to use @Gauge annotation. I
> > > haven't
> > > > > > check the others types of metrics.
> > > > > >
> > > > > >
> > > > > > El dom., 14 oct. 2018 a las 23:01, Romain Manni-Bucau (<
> > > > > > rmannibucau@gmail.com>) escribió:
> > > > > >
> > > > > >> Hi César,
> > > > > >>
> > > > > >> the actual error is in the cause - available in logs.
> > > > > >>
> > > > > >> Romain Manni-Bucau
> > > > > >> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > > >> <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > >> <http://rmannibucau.wordpress.com> | Github <
> > > > > >> https://github.com/rmannibucau> |
> > > > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > >> <
> > > > > >>
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >> Le lun. 15 oct. 2018 à 06:24, César Hernández Mendoza <
> > > > > >> cesarguate@gmail.com>
> > > > > >> a écrit :
> > > > > >>
> > > > > >> > Any opinion on this issue?
> > > > > >> > Base on your expertise-instinct do you think this is not Tomee
> > but
> > > > > >> > geronimo MP Metrics related?
> > > > > >> >
> > > > > >> > El vie., 12 oct. 2018 a las 17:27, César Hernández Mendoza (<
> > > > > >> > cesarguate@gmail.com>) escribió:
> > > > > >> >
> > > > > >> > > Hi,
> > > > > >> > >
> > > > > >> > > Within a JAX-RS resource I annotated the following method:
> > > > > >> > >
> > > > > >> > > @Counted(name = "cesar", absolute = true, monotonic = true)
> > > > > >> > > @GET
> > > > > >> > > public String message() {
> > > > > >> > >     return "Hi Microprofile JWT!";
> > > > > >> > > }
> > > > > >> > >
> > > > > >> > >
> > > > > >> > > Metric endpoint
> http://localhost:8181/moviefun/rest/metrics/
> > > > works
> > > > > >> fine.
> > > > > >> > >
> > > > > >> > > GET to
> > http://localhost:8181/moviefun/rest/metrics/application
> > > > > >> returns
> > > > > >> > > 200 without any payload back.
> > > > > >> > >
> > > > > >> > > But when I try to do a GET to
> > > > > >> > >
> http://localhost:8181/moviefun/rest/metrics/application/cesar
> > I
> > > > > got:
> > > > > >> > > <!doctype html><html lang="en"><head><title>HTTP Status 500
> –
> > > > > Internal
> > > > > >> > > Server Error</title><style type="text/css">h1
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> > > > > >> > > h2
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> > > > > >> > > h3
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> > > > > >> > > body
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> > > > > >> > > p
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
> > > > > >> > > a {color:black;} a.name {color:black;} .line
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP
> > > > > >> > > Status 500 – Internal Server Error</h1><hr class="line"
> > > > > >> /><p><b>Type</b>
> > > > > >> > > Exception Report</p><p><b>Message</b> Error processing
> > > webservice
> > > > > >> > > request</p><p><b>Description</b> The server encountered an
> > > > > unexpected
> > > > > >> > > condition that prevented it from fulfilling the
> > > > > >> > >
> > > > > >>
> > > >
> request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException:
> > > > > >> > > Error processing webservice request
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
> > > > > >> > >
> > > > >
> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > >> > >
> > > > org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > >> > > </pre><p><b>Root
> > > Cause</b></p><pre>java.lang.NullPointerException
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.lambda$toText$0(PrometheusFormatter.java:55)
> > > > > >> > >
> > > > > >>
> > > > >
> > >
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> > > > > >> > > java.util.Collections$2.tryAdvance(Collections.java:4717)
> > > > > >> > >
> > java.util.Collections$2.forEachRemaining(Collections.java:4725)
> > > > > >> > >
> > > > >
> java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> > > > > >> > >
> > > > >
> java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> > > > > >> > >
> > > > >
> > java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:510)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.toText(PrometheusFormatter.java:106)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter$$OwbNormalScopeProxy0.toText(org&#47;apache&#47;geronimo&#47;microprofile&#47;metrics&#47;jaxrs&#47;PrometheusFormatter.java)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints.getText(MetricsEndpoints.java:114)
> > > > > >> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > > > > >> > > java.lang.reflect.Method.invoke(Method.java:498)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.PojoInvoker.performInvocation(PojoInvoker.java:43)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
> > > > > >> > >
> > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193)
> > > > > >> > >
> > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
> > > > > >> > >
> > > > >
> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > >> > >
> > > > org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > >> > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > >> > > </pre><p><b>Note</b> The full stack trace of the root cause
> is
> > > > > >> available
> > > > > >> > > in the server logs.</p><hr class="line" /><h3>Apache Tomcat
> > > > > >> > (TomEE)/9.0.12
> > > > > >> > > (8.0.0-RC2-SNAPSHOT)</h3></body></html>
> > > > > >> > >
> > > > > >> > > In the pom I'm using:
> > > > > >> > >
> > > > > >> > > <dependency>
> > > > > >> > >   <groupId>org.eclipse.microprofile.jwt</groupId>
> > > > > >> > >   <artifactId>microprofile-jwt-auth-api</artifactId>
> > > > > >> > >   <version>${mp-jwt.version}</version>
> > > > > >> > >   <scope>provided</scope>
> > > > > >> > > </dependency>
> > > > > >> > >
> > > > > >> > > <mp-metric.version>1.1</mp-metric.version>
> > > > > >> > >
> > > > > >> > >
> > > > > >> > > I notice that if I remove the monotonic = true
> > > > > >> > > Then both endpoint returns empty json response.
> > > > > >> > >
> > > > > >> > > Is there any flag I missed to use during tomee:run ?
> > > > > >> > > --
> > > > > >> > > Atentamente:
> > > > > >> > > César Hernández Mendoza.
> > > > > >> > >
> > > > > >> >
> > > > > >> >
> > > > > >> > --
> > > > > >> > Atentamente:
> > > > > >> > César Hernández Mendoza.
> > > > > >> >
> > > > > >>
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Atentamente:
> > > > > > César Hernández Mendoza.
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Atentamente:
> > > > César Hernández Mendoza.
> > > >
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>

Re: Re: TomEE8 RC2: MP Metrics @Counted throws 500

Posted by César Hernández Mendoza <ce...@gmail.com>.
Hi,

I checked your example Ivan and I performed a couple of updates on my
example project and now I have successful results.
Following Roman feedback about lib folder issue, I  specified in
arquilliam.xml the microprofile classifier and also the project now uses
Arquillian remote instead of embedded.

In case someone finds useful the changes I made to the project, this is the
PR that fixed the issues described at the beginning of this thread:
https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/commit/1cb4d894239b9d74ed0ad950be6b53d67eba0417

Thanks for guys the help!


El mar., 20 nov. 2018 a las 10:45, Ivan Junckes Filho (<
ivanjunckes@gmail.com>) escribió:

> @César Hernandez <ch...@tomitribe.com> , FYI the 500 / null pointer
> doesn't happen in the master. So it should be fixed in the next release of
> geronimo-metrics /  TomEE MP.
>
> If you want to check a working example of metrics see
> https://github.com/apache/tomee/pull/207.
>
> On Tue, Nov 20, 2018 at 1:11 PM MoreFlavor <su...@moreflavor.com> wrote:
>
> > Hello Ivan Junckes Filho,
> > https://www.morebeer.com/category/kit-week.html?ref=2C
> >
> > Cheers
> >
> > Mike Albrecht
> > Customer Service Representative
> > MoreFlavor! Inc.
> > 1-800-600-0033
> >
> > On Tue, Nov 20 at 3:28 AM , Ivan Junckes Filho <iv...@gmail.com>
> > wrote:
> > Hey Cesar, I was able to make it work with my example. Take a look there
> >
> > I found a bug with geronimo-metrics-1.0.0 throwing a null pointer when
> the
> > app metric is not found instead of returning a blank page. I am not sure
> if
> > it happens in master. I will be looking into it.
> >
> > On Mon, Nov 19, 2018 at 8:49 PM César Hernández Mendoza <
> > cesarguate@gmail.com> wrote:
> >
> > > >
> > > > Did you clean up your lib folder to kot provide mp libs?
> > >
> > > No, I didn't clean up the lib folder intentionally.... but now that I'm
> > > looking again this thread. I may have one more chance to test in the
> > > project I shared.
> > > I'm going to try to specify in arquilliam.xml [1] the microprofile
> > > classifier and try to use Arquillian remote instead of embed in the pom
> > > file [2].
> > >
> > > [1]
> > >
> > >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/src/test/resources/arquillian.xml
> > > [2]
> > >
> > >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/pom.xml
> > > ]
> > >
> > >
> > >
> > > El mar., 16 oct. 2018 a las 14:58, Romain Manni-Bucau (<
> > > rmannibucau@gmail.com>) escribió:
> > >
> > > > Did you clean up your lib folder to kot provide mp libs?
> > > >
> > > > Le mar. 16 oct. 2018 19:18, César Hernández Mendoza <
> > > cesarguate@gmail.com>
> > > > a écrit :
> > > >
> > > > > Hi Romain,
> > > > >
> > > > > On this commit to master:
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/commit/37e40dfc4fbdc65e95f90f3651b186aa2652c89f
> > > > >
> > > > > I added @ApplicationScoped to the resource, removed the monotonic
> and
> > > > added
> > > > > beans.xml but still, the issue arises
> > > > >
> > > > >
> > > > > El lun., 15 oct. 2018 a las 16:21, Romain Manni-Bucau (<
> > > > > rmannibucau@gmail.com>) escribió:
> > > > >
> > > > > > Hey César,
> > > > > >
> > > > > > not sure the link with monotonic - there is none - but the issue
> is
> > > > when
> > > > > > using a name which does not exist then the endpoint fail with a
> 500
> > > > > >
> > > > > > Your endpoint not being a CDI bean it does not support MP metrics
> > so
> > > > just
> > > > > > adding @ApplicationScoped is enough to fix it.
> > > > > > On another side i'll try to make the endpoint not failing this
> way
> > on
> > > > > > geronimo-metrics side.
> > > > > >
> > > > > > Romain Manni-Bucau
> > > > > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > > <http://rmannibucau.wordpress.com> | Github <
> > > > > > https://github.com/rmannibucau> |
> > > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > > <
> > > > > >
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > > >
> > > > > >
> > > > > >
> > > > > > Le lun. 15 oct. 2018 à 22:58, César Hernández Mendoza <
> > > > > > cesarguate@gmail.com>
> > > > > > a écrit :
> > > > > >
> > > > > > > Thanks for the reply, this is the repo I created with the
> minimal
> > > > > > > configuration to show the issue:
> > > > > > > https://github.com/cesarhernandezgt/tomee-mp-metrics-examples
> > > > > > >
> > > > > > > El lun., 15 oct. 2018 a las 13:18, Romain Manni-Bucau (<
> > > > > > > rmannibucau@gmail.com>) escribió:
> > > > > > >
> > > > > > > > Can you push your app on github with tomee maven plugin set
> up?
> > > > Will
> > > > > be
> > > > > > > > easier to check.
> > > > > > > >
> > > > > > > > Le lun. 15 oct. 2018 19:46, César Hernández Mendoza <
> > > > > > > cesarguate@gmail.com>
> > > > > > > > a écrit :
> > > > > > > >
> > > > > > > > >
> > > > > > > > >> I noticed that on my previous email I paste I paste the
> > > > exception
> > > > > > from
> > > > > > > > > the HTTP response and not the one from the log (attached).
> > > > > > > > >
> > > > > > > > > Some other things I did without success:
> > > > > > > > > * Added `geronimo.metrics.jaxrs.activated=true` to tomee
> > > > > > > > system.properties.
> > > > > > > > > * Make the Resource @ApplicationScoped
> > > > > > > > > * Debugged geronimo-metrics code and for some reason I
> > couldn't
> > > > > > > identify
> > > > > > > > > so far, this is where we get the Nullpointer:
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/geronimo-metrics/blob/master/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/PrometheusFormatter.java#L55
> > > > > > > > > it seems like if the annotation was not added.
> > > > > > > > > * The same issue arise when you try to use @Gauge
> > annotation. I
> > > > > > haven't
> > > > > > > > > check the others types of metrics.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > El dom., 14 oct. 2018 a las 23:01, Romain Manni-Bucau (<
> > > > > > > > > rmannibucau@gmail.com>) escribió:
> > > > > > > > >
> > > > > > > > >> Hi César,
> > > > > > > > >>
> > > > > > > > >> the actual error is in the cause - available in logs.
> > > > > > > > >>
> > > > > > > > >> Romain Manni-Bucau
> > > > > > > > >> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > > > > >> <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > > > > >> <http://rmannibucau.wordpress.com> | Github <
> > > > > > > > >> https://github.com/rmannibucau> |
> > > > > > > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > > > > >> <
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >> Le lun. 15 oct. 2018 à 06:24, César Hernández Mendoza <
> > > > > > > > >> cesarguate@gmail.com>
> > > > > > > > >> a écrit :
> > > > > > > > >>
> > > > > > > > >> > Any opinion on this issue?
> > > > > > > > >> > Base on your expertise-instinct do you think this is not
> > > Tomee
> > > > > but
> > > > > > > > >> > geronimo MP Metrics related?
> > > > > > > > >> >
> > > > > > > > >> > El vie., 12 oct. 2018 a las 17:27, César Hernández
> Mendoza
> > > (<
> > > > > > > > >> > cesarguate@gmail.com>) escribió:
> > > > > > > > >> >
> > > > > > > > >> > > Hi,
> > > > > > > > >> > >
> > > > > > > > >> > > Within a JAX-RS resource I annotated the following
> > method:
> > > > > > > > >> > >
> > > > > > > > >> > > @Counted(name = "cesar", absolute = true, monotonic =
> > > true)
> > > > > > > > >> > > @GET
> > > > > > > > >> > > public String message() {
> > > > > > > > >> > > return "Hi Microprofile JWT!";
> > > > > > > > >> > > }
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> > > Metric endpoint
> > > > http://localhost:8181/moviefun/rest/metrics/
> > > > > > > works
> > > > > > > > >> fine.
> > > > > > > > >> > >
> > > > > > > > >> > > GET to
> > > > > http://localhost:8181/moviefun/rest/metrics/application
> > > > > > > > >> returns
> > > > > > > > >> > > 200 without any payload back.
> > > > > > > > >> > >
> > > > > > > > >> > > But when I try to do a GET to
> > > > > > > > >> > >
> > > > http://localhost:8181/moviefun/rest/metrics/application/cesar
> > > > > I
> > > > > > > > got:
> > > > > > > > >> > > <!doctype html><html lang="en"><head><title>HTTP
> Status
> > > 500
> > > > –
> > > > > > > > Internal
> > > > > > > > >> > > Server Error</title><style type="text/css">h1
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> > > > > > > > >> > > h2
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> > > > > > > > >> > > h3
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> > > > > > > > >> > > body
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> > > > > > > > >> > > p
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
> > > > > > > > >> > > a {color:black;} a.name {color:black;} .line
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP
> > > > > > > > >> > > Status 500 – Internal Server Error</h1><hr
> class="line"
> > > > > > > > >> /><p><b>Type</b>
> > > > > > > > >> > > Exception Report</p><p><b>Message</b> Error processing
> > > > > > webservice
> > > > > > > > >> > > request</p><p><b>Description</b> The server
> encountered
> > an
> > > > > > > > unexpected
> > > > > > > > >> > > condition that prevented it from fulfilling the
> > > > > > > > >> > >
> > > > > > > > >>
> > > > > > >
> > > >
> request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException:
> > > > > > > > >> > > Error processing webservice request
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
> > > > > > > > >> > >
> > > > > > > >
> > > > >
> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > > >> > >
> > > > > > >
> > org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > > >> > > </pre><p><b>Root
> > > > > > Cause</b></p><pre>java.lang.NullPointerException
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.lambda$toText$0(PrometheusFormatter.java:55)
> > > > > > > > >> > >
> > > > > > > > >>
> > > > > > > >
> > > > > >
> > > >
> > java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> > > > > > > > >> > >
> > java.util.Collections$2.tryAdvance(Collections.java:4717)
> > > > > > > > >> > >
> > > > > java.util.Collections$2.forEachRemaining(Collections.java:4725)
> > > > > > > > >> > >
> > > > > > > >
> > > > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> > > > > > > > >> > >
> > > > > > > >
> > > > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> > > > > > > > >> > >
> > > > > > > >
> > > > >
> > java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:510)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.toText(PrometheusFormatter.java:106)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter$$OwbNormalScopeProxy0.toText(org&#47;apache&#47;geronimo&#47;microprofile&#47;metrics&#47;jaxrs&#47;PrometheusFormatter.java)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints.getText(MetricsEndpoints.java:114)
> > > > > > > > >> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > Method)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > > > > > > > >> > > java.lang.reflect.Method.invoke(Method.java:498)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.PojoInvoker.performInvocation(PojoInvoker.java:43)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
> > > > > > > > >> > >
> > > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193)
> > > > > > > > >> > >
> > > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
> > > > > > > > >> > >
> > > > > > > >
> > > > >
> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > > >> > >
> > > > > > >
> > org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > > >> > > </pre><p><b>Note</b> The full stack trace of the root
> > > cause
> > > > is
> > > > > > > > >> available
> > > > > > > > >> > > in the server logs.</p><hr class="line" /><h3>Apache
> > > Tomcat
> > > > > > > > >> > (TomEE)/9.0.12
> > > > > > > > >> > > (8.0.0-RC2-SNAPSHOT)</h3></body></html>
> > > > > > > > >> > >
> > > > > > > > >> > > In the pom I'm using:
> > > > > > > > >> > >
> > > > > > > > >> > > <dependency>
> > > > > > > > >> > > <groupId>org.eclipse.microprofile.jwt</groupId>
> > > > > > > > >> > > <artifactId>microprofile-jwt-auth-api</artifactId>
> > > > > > > > >> > > <version>${mp-jwt.version}</version>
> > > > > > > > >> > > <scope>provided</scope>
> > > > > > > > >> > > </dependency>
> > > > > > > > >> > >
> > > > > > > > >> > > <mp-metric.version>1.1</mp-metric.version>
> > > > > > > > >> > >
> > > > > > > > >> > >
> > > > > > > > >> > > I notice that if I remove the monotonic = true
> > > > > > > > >> > > Then both endpoint returns empty json response.
> > > > > > > > >> > >
> > > > > > > > >> > > Is there any flag I missed to use during tomee:run ?
> > > > > > > > >> > > --
> > > > > > > > >> > > Atentamente:
> > > > > > > > >> > > César Hernández Mendoza.
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >> > --
> > > > > > > > >> > Atentamente:
> > > > > > > > >> > César Hernández Mendoza.
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Atentamente:
> > > > > > > > > César Hernández Mendoza.
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Atentamente:
> > > > > > > César Hernández Mendoza.
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Atentamente:
> > > > > César Hernández Mendoza.
> > > > >
> > > >
> > >
> > >
> > > --
> > > Atentamente:
> > > César Hernández Mendoza.
> > >
> >
> > ------------------------------
> >
> > Please tell us what you think of your support experience.
> > Awesome
> > <
> https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_happy/new>
> Just
> > Okay
> > <
> https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/neutral/new>
> Not
> > Good
> > <
> https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_unhappy/new
> >
> > 414950:343773
> >
>


-- 
Atentamente:
César Hernández Mendoza.

Re: Re: TomEE8 RC2: MP Metrics @Counted throws 500

Posted by Ivan Junckes Filho <iv...@gmail.com>.
@César Hernandez <ch...@tomitribe.com> , FYI the 500 / null pointer
doesn't happen in the master. So it should be fixed in the next release of
geronimo-metrics /  TomEE MP.

If you want to check a working example of metrics see
https://github.com/apache/tomee/pull/207.

On Tue, Nov 20, 2018 at 1:11 PM MoreFlavor <su...@moreflavor.com> wrote:

> Hello Ivan Junckes Filho,
> https://www.morebeer.com/category/kit-week.html?ref=2C
>
> Cheers
>
> Mike Albrecht
> Customer Service Representative
> MoreFlavor! Inc.
> 1-800-600-0033
>
> On Tue, Nov 20 at 3:28 AM , Ivan Junckes Filho <iv...@gmail.com>
> wrote:
> Hey Cesar, I was able to make it work with my example. Take a look there
>
> I found a bug with geronimo-metrics-1.0.0 throwing a null pointer when the
> app metric is not found instead of returning a blank page. I am not sure if
> it happens in master. I will be looking into it.
>
> On Mon, Nov 19, 2018 at 8:49 PM César Hernández Mendoza <
> cesarguate@gmail.com> wrote:
>
> > >
> > > Did you clean up your lib folder to kot provide mp libs?
> >
> > No, I didn't clean up the lib folder intentionally.... but now that I'm
> > looking again this thread. I may have one more chance to test in the
> > project I shared.
> > I'm going to try to specify in arquilliam.xml [1] the microprofile
> > classifier and try to use Arquillian remote instead of embed in the pom
> > file [2].
> >
> > [1]
> >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/src/test/resources/arquillian.xml
> > [2]
> >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/pom.xml
> > ]
> >
> >
> >
> > El mar., 16 oct. 2018 a las 14:58, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) escribió:
> >
> > > Did you clean up your lib folder to kot provide mp libs?
> > >
> > > Le mar. 16 oct. 2018 19:18, César Hernández Mendoza <
> > cesarguate@gmail.com>
> > > a écrit :
> > >
> > > > Hi Romain,
> > > >
> > > > On this commit to master:
> > > >
> > > >
> > >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/commit/37e40dfc4fbdc65e95f90f3651b186aa2652c89f
> > > >
> > > > I added @ApplicationScoped to the resource, removed the monotonic and
> > > added
> > > > beans.xml but still, the issue arises
> > > >
> > > >
> > > > El lun., 15 oct. 2018 a las 16:21, Romain Manni-Bucau (<
> > > > rmannibucau@gmail.com>) escribió:
> > > >
> > > > > Hey César,
> > > > >
> > > > > not sure the link with monotonic - there is none - but the issue is
> > > when
> > > > > using a name which does not exist then the endpoint fail with a 500
> > > > >
> > > > > Your endpoint not being a CDI bean it does not support MP metrics
> so
> > > just
> > > > > adding @ApplicationScoped is enough to fix it.
> > > > > On another side i'll try to make the endpoint not failing this way
> on
> > > > > geronimo-metrics side.
> > > > >
> > > > > Romain Manni-Bucau
> > > > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > <http://rmannibucau.wordpress.com> | Github <
> > > > > https://github.com/rmannibucau> |
> > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > <
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > >
> > > > >
> > > > >
> > > > > Le lun. 15 oct. 2018 à 22:58, César Hernández Mendoza <
> > > > > cesarguate@gmail.com>
> > > > > a écrit :
> > > > >
> > > > > > Thanks for the reply, this is the repo I created with the minimal
> > > > > > configuration to show the issue:
> > > > > > https://github.com/cesarhernandezgt/tomee-mp-metrics-examples
> > > > > >
> > > > > > El lun., 15 oct. 2018 a las 13:18, Romain Manni-Bucau (<
> > > > > > rmannibucau@gmail.com>) escribió:
> > > > > >
> > > > > > > Can you push your app on github with tomee maven plugin set up?
> > > Will
> > > > be
> > > > > > > easier to check.
> > > > > > >
> > > > > > > Le lun. 15 oct. 2018 19:46, César Hernández Mendoza <
> > > > > > cesarguate@gmail.com>
> > > > > > > a écrit :
> > > > > > >
> > > > > > > >
> > > > > > > >> I noticed that on my previous email I paste I paste the
> > > exception
> > > > > from
> > > > > > > > the HTTP response and not the one from the log (attached).
> > > > > > > >
> > > > > > > > Some other things I did without success:
> > > > > > > > * Added `geronimo.metrics.jaxrs.activated=true` to tomee
> > > > > > > system.properties.
> > > > > > > > * Make the Resource @ApplicationScoped
> > > > > > > > * Debugged geronimo-metrics code and for some reason I
> couldn't
> > > > > > identify
> > > > > > > > so far, this is where we get the Nullpointer:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/geronimo-metrics/blob/master/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/PrometheusFormatter.java#L55
> > > > > > > > it seems like if the annotation was not added.
> > > > > > > > * The same issue arise when you try to use @Gauge
> annotation. I
> > > > > haven't
> > > > > > > > check the others types of metrics.
> > > > > > > >
> > > > > > > >
> > > > > > > > El dom., 14 oct. 2018 a las 23:01, Romain Manni-Bucau (<
> > > > > > > > rmannibucau@gmail.com>) escribió:
> > > > > > > >
> > > > > > > >> Hi César,
> > > > > > > >>
> > > > > > > >> the actual error is in the cause - available in logs.
> > > > > > > >>
> > > > > > > >> Romain Manni-Bucau
> > > > > > > >> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > > > >> <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > > > >> <http://rmannibucau.wordpress.com> | Github <
> > > > > > > >> https://github.com/rmannibucau> |
> > > > > > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > > > >> <
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> Le lun. 15 oct. 2018 à 06:24, César Hernández Mendoza <
> > > > > > > >> cesarguate@gmail.com>
> > > > > > > >> a écrit :
> > > > > > > >>
> > > > > > > >> > Any opinion on this issue?
> > > > > > > >> > Base on your expertise-instinct do you think this is not
> > Tomee
> > > > but
> > > > > > > >> > geronimo MP Metrics related?
> > > > > > > >> >
> > > > > > > >> > El vie., 12 oct. 2018 a las 17:27, César Hernández Mendoza
> > (<
> > > > > > > >> > cesarguate@gmail.com>) escribió:
> > > > > > > >> >
> > > > > > > >> > > Hi,
> > > > > > > >> > >
> > > > > > > >> > > Within a JAX-RS resource I annotated the following
> method:
> > > > > > > >> > >
> > > > > > > >> > > @Counted(name = "cesar", absolute = true, monotonic =
> > true)
> > > > > > > >> > > @GET
> > > > > > > >> > > public String message() {
> > > > > > > >> > > return "Hi Microprofile JWT!";
> > > > > > > >> > > }
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > Metric endpoint
> > > http://localhost:8181/moviefun/rest/metrics/
> > > > > > works
> > > > > > > >> fine.
> > > > > > > >> > >
> > > > > > > >> > > GET to
> > > > http://localhost:8181/moviefun/rest/metrics/application
> > > > > > > >> returns
> > > > > > > >> > > 200 without any payload back.
> > > > > > > >> > >
> > > > > > > >> > > But when I try to do a GET to
> > > > > > > >> > >
> > > http://localhost:8181/moviefun/rest/metrics/application/cesar
> > > > I
> > > > > > > got:
> > > > > > > >> > > <!doctype html><html lang="en"><head><title>HTTP Status
> > 500
> > > –
> > > > > > > Internal
> > > > > > > >> > > Server Error</title><style type="text/css">h1
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> > > > > > > >> > > h2
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> > > > > > > >> > > h3
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> > > > > > > >> > > body
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> > > > > > > >> > > p
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
> > > > > > > >> > > a {color:black;} a.name {color:black;} .line
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP
> > > > > > > >> > > Status 500 – Internal Server Error</h1><hr class="line"
> > > > > > > >> /><p><b>Type</b>
> > > > > > > >> > > Exception Report</p><p><b>Message</b> Error processing
> > > > > webservice
> > > > > > > >> > > request</p><p><b>Description</b> The server encountered
> an
> > > > > > > unexpected
> > > > > > > >> > > condition that prevented it from fulfilling the
> > > > > > > >> > >
> > > > > > > >>
> > > > > >
> > > request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException:
> > > > > > > >> > > Error processing webservice request
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
> > > > > > > >> > >
> > > > > > >
> > > >
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > >> > >
> > > > > >
> org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > > </pre><p><b>Root
> > > > > Cause</b></p><pre>java.lang.NullPointerException
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.lambda$toText$0(PrometheusFormatter.java:55)
> > > > > > > >> > >
> > > > > > > >>
> > > > > > >
> > > > >
> > >
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> > > > > > > >> > >
> java.util.Collections$2.tryAdvance(Collections.java:4717)
> > > > > > > >> > >
> > > > java.util.Collections$2.forEachRemaining(Collections.java:4725)
> > > > > > > >> > >
> > > > > > >
> > > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> > > > > > > >> > >
> > > > > > >
> > > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> > > > > > > >> > >
> > > > > > >
> > > >
> java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:510)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.toText(PrometheusFormatter.java:106)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter$$OwbNormalScopeProxy0.toText(org&#47;apache&#47;geronimo&#47;microprofile&#47;metrics&#47;jaxrs&#47;PrometheusFormatter.java)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints.getText(MetricsEndpoints.java:114)
> > > > > > > >> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > > > > > > >> > > java.lang.reflect.Method.invoke(Method.java:498)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.PojoInvoker.performInvocation(PojoInvoker.java:43)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
> > > > > > > >> > >
> > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193)
> > > > > > > >> > >
> > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
> > > > > > > >> > >
> > > > > > >
> > > >
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > >> > >
> > > > > >
> org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > > </pre><p><b>Note</b> The full stack trace of the root
> > cause
> > > is
> > > > > > > >> available
> > > > > > > >> > > in the server logs.</p><hr class="line" /><h3>Apache
> > Tomcat
> > > > > > > >> > (TomEE)/9.0.12
> > > > > > > >> > > (8.0.0-RC2-SNAPSHOT)</h3></body></html>
> > > > > > > >> > >
> > > > > > > >> > > In the pom I'm using:
> > > > > > > >> > >
> > > > > > > >> > > <dependency>
> > > > > > > >> > > <groupId>org.eclipse.microprofile.jwt</groupId>
> > > > > > > >> > > <artifactId>microprofile-jwt-auth-api</artifactId>
> > > > > > > >> > > <version>${mp-jwt.version}</version>
> > > > > > > >> > > <scope>provided</scope>
> > > > > > > >> > > </dependency>
> > > > > > > >> > >
> > > > > > > >> > > <mp-metric.version>1.1</mp-metric.version>
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > I notice that if I remove the monotonic = true
> > > > > > > >> > > Then both endpoint returns empty json response.
> > > > > > > >> > >
> > > > > > > >> > > Is there any flag I missed to use during tomee:run ?
> > > > > > > >> > > --
> > > > > > > >> > > Atentamente:
> > > > > > > >> > > César Hernández Mendoza.
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > --
> > > > > > > >> > Atentamente:
> > > > > > > >> > César Hernández Mendoza.
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Atentamente:
> > > > > > > > César Hernández Mendoza.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Atentamente:
> > > > > > César Hernández Mendoza.
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Atentamente:
> > > > César Hernández Mendoza.
> > > >
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>
> ------------------------------
>
> Please tell us what you think of your support experience.
> Awesome
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_happy/new> Just
> Okay
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/neutral/new> Not
> Good
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_unhappy/new>
> 414950:343773
>

Re: Re: TomEE8 RC2: MP Metrics @Counted throws 500

Posted by Ivan Junckes Filho <iv...@gmail.com>.
@César Hernandez <ch...@tomitribe.com> , FYI the 500 / null pointer
doesn't happen in the master. So it should be fixed in the next release of
geronimo-metrics /  TomEE MP.

If you want to check a working example of metrics see
https://github.com/apache/tomee/pull/207.

On Tue, Nov 20, 2018 at 1:11 PM MoreFlavor <su...@moreflavor.com> wrote:

> Hello Ivan Junckes Filho,
> https://www.morebeer.com/category/kit-week.html?ref=2C
>
> Cheers
>
> Mike Albrecht
> Customer Service Representative
> MoreFlavor! Inc.
> 1-800-600-0033
>
> On Tue, Nov 20 at 3:28 AM , Ivan Junckes Filho <iv...@gmail.com>
> wrote:
> Hey Cesar, I was able to make it work with my example. Take a look there
>
> I found a bug with geronimo-metrics-1.0.0 throwing a null pointer when the
> app metric is not found instead of returning a blank page. I am not sure if
> it happens in master. I will be looking into it.
>
> On Mon, Nov 19, 2018 at 8:49 PM César Hernández Mendoza <
> cesarguate@gmail.com> wrote:
>
> > >
> > > Did you clean up your lib folder to kot provide mp libs?
> >
> > No, I didn't clean up the lib folder intentionally.... but now that I'm
> > looking again this thread. I may have one more chance to test in the
> > project I shared.
> > I'm going to try to specify in arquilliam.xml [1] the microprofile
> > classifier and try to use Arquillian remote instead of embed in the pom
> > file [2].
> >
> > [1]
> >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/src/test/resources/arquillian.xml
> > [2]
> >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/blob/master/pom.xml
> > ]
> >
> >
> >
> > El mar., 16 oct. 2018 a las 14:58, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) escribió:
> >
> > > Did you clean up your lib folder to kot provide mp libs?
> > >
> > > Le mar. 16 oct. 2018 19:18, César Hernández Mendoza <
> > cesarguate@gmail.com>
> > > a écrit :
> > >
> > > > Hi Romain,
> > > >
> > > > On this commit to master:
> > > >
> > > >
> > >
> >
> https://github.com/cesarhernandezgt/tomee-mp-metrics-examples/commit/37e40dfc4fbdc65e95f90f3651b186aa2652c89f
> > > >
> > > > I added @ApplicationScoped to the resource, removed the monotonic and
> > > added
> > > > beans.xml but still, the issue arises
> > > >
> > > >
> > > > El lun., 15 oct. 2018 a las 16:21, Romain Manni-Bucau (<
> > > > rmannibucau@gmail.com>) escribió:
> > > >
> > > > > Hey César,
> > > > >
> > > > > not sure the link with monotonic - there is none - but the issue is
> > > when
> > > > > using a name which does not exist then the endpoint fail with a 500
> > > > >
> > > > > Your endpoint not being a CDI bean it does not support MP metrics
> so
> > > just
> > > > > adding @ApplicationScoped is enough to fix it.
> > > > > On another side i'll try to make the endpoint not failing this way
> on
> > > > > geronimo-metrics side.
> > > > >
> > > > > Romain Manni-Bucau
> > > > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > <http://rmannibucau.wordpress.com> | Github <
> > > > > https://github.com/rmannibucau> |
> > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > <
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > >
> > > > >
> > > > >
> > > > > Le lun. 15 oct. 2018 à 22:58, César Hernández Mendoza <
> > > > > cesarguate@gmail.com>
> > > > > a écrit :
> > > > >
> > > > > > Thanks for the reply, this is the repo I created with the minimal
> > > > > > configuration to show the issue:
> > > > > > https://github.com/cesarhernandezgt/tomee-mp-metrics-examples
> > > > > >
> > > > > > El lun., 15 oct. 2018 a las 13:18, Romain Manni-Bucau (<
> > > > > > rmannibucau@gmail.com>) escribió:
> > > > > >
> > > > > > > Can you push your app on github with tomee maven plugin set up?
> > > Will
> > > > be
> > > > > > > easier to check.
> > > > > > >
> > > > > > > Le lun. 15 oct. 2018 19:46, César Hernández Mendoza <
> > > > > > cesarguate@gmail.com>
> > > > > > > a écrit :
> > > > > > >
> > > > > > > >
> > > > > > > >> I noticed that on my previous email I paste I paste the
> > > exception
> > > > > from
> > > > > > > > the HTTP response and not the one from the log (attached).
> > > > > > > >
> > > > > > > > Some other things I did without success:
> > > > > > > > * Added `geronimo.metrics.jaxrs.activated=true` to tomee
> > > > > > > system.properties.
> > > > > > > > * Make the Resource @ApplicationScoped
> > > > > > > > * Debugged geronimo-metrics code and for some reason I
> couldn't
> > > > > > identify
> > > > > > > > so far, this is where we get the Nullpointer:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/geronimo-metrics/blob/master/src/main/java/org/apache/geronimo/microprofile/metrics/jaxrs/PrometheusFormatter.java#L55
> > > > > > > > it seems like if the annotation was not added.
> > > > > > > > * The same issue arise when you try to use @Gauge
> annotation. I
> > > > > haven't
> > > > > > > > check the others types of metrics.
> > > > > > > >
> > > > > > > >
> > > > > > > > El dom., 14 oct. 2018 a las 23:01, Romain Manni-Bucau (<
> > > > > > > > rmannibucau@gmail.com>) escribió:
> > > > > > > >
> > > > > > > >> Hi César,
> > > > > > > >>
> > > > > > > >> the actual error is in the cause - available in logs.
> > > > > > > >>
> > > > > > > >> Romain Manni-Bucau
> > > > > > > >> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > > > > > >> <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > > > >> <http://rmannibucau.wordpress.com> | Github <
> > > > > > > >> https://github.com/rmannibucau> |
> > > > > > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > > > >> <
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> Le lun. 15 oct. 2018 à 06:24, César Hernández Mendoza <
> > > > > > > >> cesarguate@gmail.com>
> > > > > > > >> a écrit :
> > > > > > > >>
> > > > > > > >> > Any opinion on this issue?
> > > > > > > >> > Base on your expertise-instinct do you think this is not
> > Tomee
> > > > but
> > > > > > > >> > geronimo MP Metrics related?
> > > > > > > >> >
> > > > > > > >> > El vie., 12 oct. 2018 a las 17:27, César Hernández Mendoza
> > (<
> > > > > > > >> > cesarguate@gmail.com>) escribió:
> > > > > > > >> >
> > > > > > > >> > > Hi,
> > > > > > > >> > >
> > > > > > > >> > > Within a JAX-RS resource I annotated the following
> method:
> > > > > > > >> > >
> > > > > > > >> > > @Counted(name = "cesar", absolute = true, monotonic =
> > true)
> > > > > > > >> > > @GET
> > > > > > > >> > > public String message() {
> > > > > > > >> > > return "Hi Microprofile JWT!";
> > > > > > > >> > > }
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > Metric endpoint
> > > http://localhost:8181/moviefun/rest/metrics/
> > > > > > works
> > > > > > > >> fine.
> > > > > > > >> > >
> > > > > > > >> > > GET to
> > > > http://localhost:8181/moviefun/rest/metrics/application
> > > > > > > >> returns
> > > > > > > >> > > 200 without any payload back.
> > > > > > > >> > >
> > > > > > > >> > > But when I try to do a GET to
> > > > > > > >> > >
> > > http://localhost:8181/moviefun/rest/metrics/application/cesar
> > > > I
> > > > > > > got:
> > > > > > > >> > > <!doctype html><html lang="en"><head><title>HTTP Status
> > 500
> > > –
> > > > > > > Internal
> > > > > > > >> > > Server Error</title><style type="text/css">h1
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> > > > > > > >> > > h2
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> > > > > > > >> > > h3
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> > > > > > > >> > > body
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> > > > > > > >> > > p
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
> > > > > > > >> > > a {color:black;} a.name {color:black;} .line
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP
> > > > > > > >> > > Status 500 – Internal Server Error</h1><hr class="line"
> > > > > > > >> /><p><b>Type</b>
> > > > > > > >> > > Exception Report</p><p><b>Message</b> Error processing
> > > > > webservice
> > > > > > > >> > > request</p><p><b>Description</b> The server encountered
> an
> > > > > > > unexpected
> > > > > > > >> > > condition that prevented it from fulfilling the
> > > > > > > >> > >
> > > > > > > >>
> > > > > >
> > > request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException:
> > > > > > > >> > > Error processing webservice request
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
> > > > > > > >> > >
> > > > > > >
> > > >
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > >> > >
> > > > > >
> org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > > </pre><p><b>Root
> > > > > Cause</b></p><pre>java.lang.NullPointerException
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.lambda$toText$0(PrometheusFormatter.java:55)
> > > > > > > >> > >
> > > > > > > >>
> > > > > > >
> > > > >
> > >
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> > > > > > > >> > >
> java.util.Collections$2.tryAdvance(Collections.java:4717)
> > > > > > > >> > >
> > > > java.util.Collections$2.forEachRemaining(Collections.java:4725)
> > > > > > > >> > >
> > > > > > >
> > > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> > > > > > > >> > >
> > > > > > >
> > > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> > > > > > > >> > >
> > > > > > >
> > > >
> java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:510)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter.toText(PrometheusFormatter.java:106)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.PrometheusFormatter$$OwbNormalScopeProxy0.toText(org&#47;apache&#47;geronimo&#47;microprofile&#47;metrics&#47;jaxrs&#47;PrometheusFormatter.java)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints.getText(MetricsEndpoints.java:114)
> > > > > > > >> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > > > > > > >> > > java.lang.reflect.Method.invoke(Method.java:498)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.PojoInvoker.performInvocation(PojoInvoker.java:43)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
> > > > > > > >> > >
> > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193)
> > > > > > > >> > >
> > > > org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
> > > > > > > >> > >
> > > > > > >
> > > >
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
> > > > > > > >> > >
> > > > > >
> org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.geronimo.microprofile.opentracing.microprofile.server.OpenTracingFilter.doFilter(OpenTracingFilter.java:126)
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.tomee.microprofile.jwt.MPJWTFilter.doFilter(MPJWTFilter.java:72)
> > > > > > > >> > > </pre><p><b>Note</b> The full stack trace of the root
> > cause
> > > is
> > > > > > > >> available
> > > > > > > >> > > in the server logs.</p><hr class="line" /><h3>Apache
> > Tomcat
> > > > > > > >> > (TomEE)/9.0.12
> > > > > > > >> > > (8.0.0-RC2-SNAPSHOT)</h3></body></html>
> > > > > > > >> > >
> > > > > > > >> > > In the pom I'm using:
> > > > > > > >> > >
> > > > > > > >> > > <dependency>
> > > > > > > >> > > <groupId>org.eclipse.microprofile.jwt</groupId>
> > > > > > > >> > > <artifactId>microprofile-jwt-auth-api</artifactId>
> > > > > > > >> > > <version>${mp-jwt.version}</version>
> > > > > > > >> > > <scope>provided</scope>
> > > > > > > >> > > </dependency>
> > > > > > > >> > >
> > > > > > > >> > > <mp-metric.version>1.1</mp-metric.version>
> > > > > > > >> > >
> > > > > > > >> > >
> > > > > > > >> > > I notice that if I remove the monotonic = true
> > > > > > > >> > > Then both endpoint returns empty json response.
> > > > > > > >> > >
> > > > > > > >> > > Is there any flag I missed to use during tomee:run ?
> > > > > > > >> > > --
> > > > > > > >> > > Atentamente:
> > > > > > > >> > > César Hernández Mendoza.
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > --
> > > > > > > >> > Atentamente:
> > > > > > > >> > César Hernández Mendoza.
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Atentamente:
> > > > > > > > César Hernández Mendoza.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Atentamente:
> > > > > > César Hernández Mendoza.
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Atentamente:
> > > > César Hernández Mendoza.
> > > >
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>
> ------------------------------
>
> Please tell us what you think of your support experience.
> Awesome
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_happy/new> Just
> Okay
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/neutral/new> Not
> Good
> <https://moreflavor.freshdesk.com/support/custom_surveys/9dec79583bfe67ea1988dd2fb2c0f318/extremely_unhappy/new>
> 414950:343773
>