Eclipse MicroProfile Metrics with SOAP-based web services

63 views
Skip to first unread message

eM Bee

unread,
Nov 25, 2019, 3:20:53 AM11/25/19
to Eclipse MicroProfile
Isn’t it possible to use Eclipse MicroProfile Metrics with SOAP-based web services on Payara Server 5.193.1? @Counted and @Timed don’t seem to work with @WebService and @WebMethod? Although, @Metric works. Is this by design or is it an issue?

Marc

Emily Jiang

unread,
Nov 26, 2019, 11:52:29 AM11/26/19
to Eclipse MicroProfile
Marc,

Since WebService supports injection and interceptor (see here https://javaee.github.io/javaee-spec/download/JavaEE8_Platform_Spec_FinalRelease.pdf), the annotation should work. The only thing is that you need to make sure it is a business method invocation and CDI is enabled. If you put the annotations on WebMethod, it should work as the container calls this method and it should be business method invocation. I cannot comment in the context of Payara. You might want to ask the question on Payara's mailing list.

Emily

eM Bee

unread,
Nov 27, 2019, 4:58:04 AM11/27/19
to Eclipse MicroProfile
I have put the annotations (Counted and Timed) on WebMethod and annotated my WebService with Stateless (EJB) and RequestScoped (CDI), but all make no difference. So I think this is an issue.

Op dinsdag 26 november 2019 17:52:29 UTC+1 schreef Emily Jiang:

Ondro Mihályi

unread,
Dec 4, 2019, 10:53:56 AM12/4/19
to Eclipse MicroProfile
Hi, it works, also in Payara, if the WS is an EJB. For CDI it doesn't work because, at least in Payara, nonEJB Web Services are implemented as Servlets, and they won't be turned into CDI beans.

Ondro

Werner Keil

unread,
Dec 4, 2019, 2:11:50 PM12/4/19
to Eclipse MicroProfile
Ondro,

What exactly did you do for SOAP on Java 9 or above, or does it only run on Java 8?

It sounds like a good case for that possible "Legacy profile" or whatever it ends up under of Jakarta EE. Which aims to make it easier to use all those specs like JAX-WS or JAXB, etc. hidden and removed from Java 9 onwards with Enterprise and Cloud Native Java.

Werner

Ondro Mihályi

unread,
Dec 5, 2019, 9:05:34 AM12/5/19
to MicroProfile
Hi Werner,

It's a little out of topic here, but to answer your question, I think we didn't do much in Payara Server to run SOAP on Java 9+ because the server uses the Metro RI and doesn't rely on the Java SE implementation.


st 4. 12. 2019 o 20:11 Werner Keil <werne...@gmail.com> napísal(a):
--
You received this message because you are subscribed to a topic in the Google Groups "Eclipse MicroProfile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/microprofile/wg2-gZQLxyA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to microprofile...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/microprofile/4b8f8036-f25d-4a7c-899a-e423510dd723%40googlegroups.com.

eM Bee

unread,
Dec 10, 2019, 9:29:54 AM12/10/19
to Eclipse MicroProfile
Adding @Stateless to the web service resulted in a ClassCastException (). Removing the deployment descriptor web.xml solved the problem of the ClassCastException. So, adding @Stateless to the web service was the right answer to my question.

Op woensdag 4 december 2019 16:53:56 UTC+1 schreef Ondro Mihályi:
Reply all
Reply to author
Forward
0 new messages