Javamelody and javax.ejb.Asynchronous

18 views
Skip to first unread message

ala...@gmail.com

unread,
Apr 29, 2020, 6:11:11 AM4/29/20
to javamelody
Hello,

We use javamelody as monitoring tool with our web application, using Tomcat 8, CDI et JSF 2.

Recently, we wanted to upgrade javamelody from version 1.56 to 1.74 or above (for security issues) and I followed the documentation to add the .jar et to modify the web.xml.
<!-- javamelody -->
<filter>
<filter-name>javamelody</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>storage-directory</param-name>
<param-value>javamelodyStats</param-value>
</init-param>
<init-param>
<param-name>quartz-default-listener-disabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>sampling-seconds</param-name>
<param-value>5</param-value>
</init-param>
<init-param>
<param-name>sampling-included-packages</param-name>
<param-value>com.lswe,com.tswe</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>javamelody</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>

<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>

 
I get now an error when I start the application:
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: WELD-ENV-000015: Unable to load annotation: javax.ejb.Asynchronous


Our application doesn't use EJB or the annotation "@net.bull.javamelody.Monitored". We only use CDI annotations (@SessionScoped, ...)

Is there a way to deactivate the use of this annotation ? or what would be the dependencies to add ?

Thanking you for your reply,
Regards,
Alain Grunwald


evernat

unread,
Apr 29, 2020, 7:04:29 AM4/29/20
to javamelody
Hi Alain,

I suggest to upgrade to the latest javamelody version (1.82.0).

There was a fix for CDI in version 1.76.0, so I think that it will fix your case.

bye,
Emeric

Alain G

unread,
May 4, 2020, 7:27:29 AM5/4/20
to javam...@googlegroups.com
Hi Emeric,

I tried with version 1.82 and I have the same error.

Thanks,
Regards,
Alain


--

---
You received this message because you are subscribed to a topic in the Google Groups "javamelody" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javamelody/nO65LeUJBmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to javamelody+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/javamelody/8851ed2e-d84a-444e-8539-b387134565ac%40googlegroups.com.

evernat

unread,
May 4, 2020, 7:36:30 AM5/4/20
to javamelody
Hi Alain,

Can you give the whole stack-trace of the exception, when using version 1.82 ?
And is it possible to have the source of a simple project to reproduce the issue ?

Thank you,
Emeric

Le lundi 4 mai 2020 13:27:29 UTC+2, Alain G a écrit :
Hi Emeric,

I tried with version 1.82 and I have the same error.

Thanks,
Regards,
Alain


Alain G

unread,
May 6, 2020, 5:27:16 AM5/6/20
to javam...@googlegroups.com
Hi Emeric,

Attached is the log I get when I try to start my application. Our application is complex with a lot of dependencies, so it is difficult to give you a simple project.

However, it works if the project has the following dependency:
<dependency>
 <groupId>javax.ejb</groupId>
 <artifactId>javax.ejb-api</artifactId>
 <version>3.2.2</version>
</dependency>

but it doesn't work when I try to use the provided scope.

Is this dependency mandatory ?

Thanks
Regards,
Alain


--

---
You received this message because you are subscribed to a topic in the Google Groups "javamelody" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javamelody/nO65LeUJBmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to javamelody+...@googlegroups.com.
eServices-1.5-tags.log

evernat

unread,
May 6, 2020, 8:38:57 AM5/6/20
to javamelody
Hi Alain,

No, the javax.ejb-api dependency is not supposed to be mandatory and in most cases, it is not included in webapps with javamelody.
But your are using CDI with Weld in Tomcat, not in WildFly or something like that. And the scan of classes by Weld and Jandex stumbles on the javamelody MonitoringAsynchronousCdiInterceptor and Weld tries to load the class javax.ejb.Asynchronous, which is not found.
Weld fails to start because of that.
(You are also using Java 8 from Open J9. It is unusual enough to be a corner case maybe.)

I do not reproduce the issue, but I think that adding the following in META-INF/beans.xml of javamelody would fix the issue:
    <scan>
        <exclude name="net.bull.javamelody.MonitoringAsynchronousCdiInterceptor" />
    </scan>
To test this change, can you try this snapshot build instead of javamelody 1.82 :

bye,
Emeric

Le mercredi 6 mai 2020 11:27:16 UTC+2, Alain G a écrit :
Hi Emeric,

Attached is the log I get when I try to start my application. Our application is complex with a lot of dependencies, so it is difficult to give you a simple project.

However, it works if the project has the following dependency:
<dependency>
 <groupId>javax.ejb</groupId>
 <artifactId>javax.ejb-api</artifactId>
 <version>3.2.2</version>
</dependency>

but it doesn't work when I try to use the provided scope.

Is this dependency mandatory ?

Thanks
Regards,
Alain

Alain G

unread,
May 7, 2020, 6:56:27 AM5/7/20
to javam...@googlegroups.com
Hi Emeric,

I can't download the jar as it is blocked by our firewall. I think if you send it as a zip file, it should work.

However, when I add manually the scan element to the beans.xml file in javamelody-core-1.82.0.jar, it works.

Thanks,
Regards,
Alain

 


--

---
You received this message because you are subscribed to a topic in the Google Groups "javamelody" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javamelody/nO65LeUJBmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to javamelody+...@googlegroups.com.

evernat

unread,
May 7, 2020, 7:41:27 PM5/7/20
to javamelody
Hi Alain,

It's fixed for the next release, with the exclude in META-INF/beans.xml. See https://github.com/javamelody/javamelody/issues/912

Thanks,
Emeric

Le jeudi 7 mai 2020 12:56:27 UTC+2, Alain G a écrit :
Hi Emeric,

Alain G

unread,
May 13, 2020, 6:05:05 AM5/13/20
to javam...@googlegroups.com
Hi Emeric,

Thank you very much for your reactivity.

Alain


--

---
You received this message because you are subscribed to a topic in the Google Groups "javamelody" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javamelody/nO65LeUJBmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to javamelody+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages