Re: Errors with Spring Boot 3.0.3 and Wildfly 27

694 views
Skip to first unread message

Emmanuel Hugonnet

unread,
Feb 27, 2023, 5:51:58 AM2/27/23
to Francesco Chicchiriccò, WildFly
Hello
Could you provide your jboss-deployment-structure.xml and te list of jars in your application ?
Emmanuel

Le 27/02/2023 à 10:41, Francesco Chicchiriccò a écrit :
> Hi there,
> I have an application based on Spring Boot 3.0.2 which works fine with Wildfly 27.
>
> When upgrading to Spring Boot 3.0.3, however, we start getting the following error:
>
> java.util.ServiceConfigurationError: jakarta.activation.spi.MailcapRegistryProvider:
> com.sun.activation.registries.MailcapRegistryProviderImpl not a subtype
>         at java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[?:?]
>         at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) ~[?:?]
>         at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[?:?]
>         at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[?:?]
>         at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[?:?]
>         at jakarta.activation.ServiceLoaderUtil.firstByServiceLoader(ServiceLoaderUtil.java:33)
> ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>         at jakarta.activation.FactoryFinder.find(FactoryFinder.java:77) ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>         at jakarta.activation.MailcapCommandMap.getImplementation(MailcapCommandMap.java:705)
> ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>         at jakarta.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:284)
> ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>         at jakarta.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:154)
> ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>         at jakarta.activation.CommandMap.getDefaultCommandMap(CommandMap.java:60)
> ~[jakarta.activation-api-2.1.1.jbossorg-1.jar!/:2.1.1.jbossorg-1]
>
> We had the same error with Tomcat deployment, which was fixed by avoiding some dependencies to pull angus-activation-1.0.0.jar
> as angus-activation-2.0.0.jar comes via Spring Boot 3.0.3.
>
> For this reason, we have added the following exclusions to our jboss-deployment-structure.xml:
>
> +      <module name="jakarta.activation.api"/>
> +      <module name="org.eclipse.angus.activation"/>
> +      <module name="org.eclipse.angus.mail"/>
>
> Nothing seems to change, however: any idea?
> Thanks in advance.
>
> Regards.
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/5a1af6d6-bea3-482a-bf09-82711a5829c5n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/5a1af6d6-bea3-482a-bf09-82711a5829c5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Francesco Chicchiriccò

unread,
Feb 27, 2023, 6:14:31 AM2/27/23
to WildFly
Hi Emmanuel,
thanks for your reply.

Our current jboss-deployment-structure.xml (without the additions mentioned in my initial email) is at [1].
The list of JAR files is at [2].

Regards.

Emmanuel Hugonnet

unread,
Feb 27, 2023, 8:50:43 AM2/27/23
to Francesco Chicchiriccò, WildFly
Hello,
I see that you are providing a lot of jakartaEE API jars
 * jakarta.activation-api-2.1.1.jar
 * jakarta.annotation-api-2.1.1.jar
 * jakarta.mail-1.0.0.jar <--- which is surprising as i didn't find any java mail implementation
 * jakarta.persistence-api-3.1.0.jar
 * jakarta.transaction-api-2.0.1.jar
 * jakarta.validation-api-3.0.2.jar
which might be a bit problematic.
I think you should either rely on WildFly for those or exclude the mail subsystem and maybe the org.eclipse.angus.mail and
org.eclipse.angus.activation modules.

Emmanuel
> <https://groups.google.com/d/msgid/wildfly/5a1af6d6-bea3-482a-bf09-82711a5829c5n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/98b309b8-b464-412f-b9e3-ae57bdce3209n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/98b309b8-b464-412f-b9e3-ae57bdce3209n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Wei Nan Li

unread,
Feb 27, 2023, 9:19:29 AM2/27/23
to Francesco Chicchiriccò, WildFly
Spring has its own support for context injection, which conflicts with
CDI in WildFly. If you need to use Spring inside WildFly, you'd better
to disabled the CDI related subsystems.

I have written a blog related with this topic:

- https://weinan.io/2023/01/22/resteasy-spring-wildfly.html
> To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/5a1af6d6-bea3-482a-bf09-82711a5829c5n%40googlegroups.com.



--
Cheers,
Wei Nan | JBoss

Francesco Chicchiriccò

unread,
Feb 27, 2023, 9:24:35 AM2/27/23
to WildFly
>* jakarta.mail-1.0.0.jar <--- which is surprising as i didn't find any java mail implementation

This file is the artifact

org.eclipse.angus:jakarta.mail:jar

As I was writing in my first mail here, I have these local additions to jboss-deployment-structure.xml:


> +      <module name="jakarta.activation.api"/>
> +      <module name="org.eclipse.angus.activation"/>
> +      <module name="org.eclipse.angus.mail"/>

I will try to exclude the mail subsystem completely to see if it makes any difference.

Thank you.
Regards.

Francesco Chicchiriccò

unread,
Feb 27, 2023, 9:25:28 AM2/27/23
to WildFly
Thank you Wei Nan Li,
I will try those exclusions too - though as said above, all works as expected up to Spring Boot 3.0.2.

Regards.

Francesco Chicchiriccò

unread,
Feb 27, 2023, 10:17:01 AM2/27/23
to WildFly
Nope, nothing seems to work.

The core issue here seems the inability to exclude angus-activation 1.0.0 defined by Wildfly and to load instead angus-activation 2.0.0 from application's classpath.

But shouldn't Wildfly upgrade anyway itself to angus-activation 2.0.0?

Thanks anyway for your support.
Regards.

Hantsy Bai

unread,
Feb 27, 2023, 9:26:33 PM2/27/23
to WildFly
From my experience before with Spring Boot 2.x and WildFly, you can mix Spring and CDI in the same project, and Spring Data itself provides CDI Extension(1.x compatible, you have to set the scan scope to all instead of the `annotated`), you can call any Spring Data Repository as a CDI bean in your Jakarta EE components.

And you can create a JPA etc, resources from WildFly container managed resource(JPA, JTA, JMS, etc) directly instead of the your application properties.

Reply all
Reply to author
Forward
0 new messages