ClassNotFoundException: java.security.acl.Group on WildFly 19.1 using Java 14

Viewed 3816

I migrated a Web application that worked fine on WildFly 17 on Java 11 to the latest versions of both: WildFly 19 on Java 14. In the end I'm getting a ClassNotFoundException: java.security.acl.Group, probably because the Web application uses JAAS.

Note that a similar Web application built following a tutorial of my own worked fine, but it doesn't use JAAS. That and the package java.security.acl made me think JAAS is related.

Searching the Web I found issue WFCORE-4282 at WildFly's JIRA which seems to imply that although they knew this java.security.acl.Group class was deprecated more than a year ago, WildFly 19 still requires it and Java 14 did actually remove it, thus causing the ClassNotFoundException for me.

Is my interpretation correct? Does WildFly 19 + Java 14 + JAAS = ClassNotFoundException necessarily or has anyone managed to make it work? Or maybe I'm doing something wrong? It just seems to me such a huge problem for JBoss to have overlooked on WildFly...

Update: I removed Java 14, installed Java 13, reinstalled Eclipse and WildFly and redeployed de application and it worked, so WildFly 19 + Java 13 + JAAS = OK!

3 Answers

This has been resolved as of late 2021 (better late than never!). So you can now use JDK 17+ with WildFly 26+. Note, however, you have to make the non-trivial move from:

<subsystem xmlns="urn:jboss:domain:security:1.2">
...
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
...
</login-module>
</subsystem>

...to...

<subsystem xmlns="urn:wildfly:elytron:15.0">
...
<security-realms>
    <jdbc-realm>
    ...
    </jdbc-realm>
</security-realms>
</subsystem>

YMMV depending on your architecture, but basically you have to embrace Elytron.

Error: java.lang.NoClassDefFoundError: java/security/acl/Group 19:23:14,951 ERROR [org.apache.activemq.artemis.core.client] (default I/O-11) AMQ214013: Failed to decode packet: java.lang.NoClassDefFoundError: java/security/acl/Group

Please try following workaround update standalone.xml and restart Server

add xml tag <security enabled="false"/>

<server name="default">
<security enabled="false"/>
<statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
<security-setting name="#">
    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
Related