Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require io.vertx.auth.common module #2716

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

tsegismont
Copy link
Contributor

Currently, io.vertx.auth.common is required only for compilation.

However, it contains the io.vertx.ext.auth.audit.SecurityAudit class, that is used in io.vertx.ext.web.impl.RoutingContextImplBase.

Consequently, if users don't add the module requirement in their application, it fails when the first request is sent with:

Feb 07, 2025 10:54:29 AM io.vertx.core.impl.ContextImpl SEVERE: Unhandled exception
java.lang.NoClassDefFoundError: Lio/vertx/ext/auth/audit/SecurityAudit;
        at java.base/java.lang.Class.getDeclaredFields0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
        at java.base/java.lang.Class.getDeclaredField(Class.java:2409)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:398)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:396)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:395)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:94)
        at [email protected]/io.vertx.ext.web.impl.RoutingContextImplBase.<clinit>(RoutingContextImplBase.java:43)

So this is a buggy module declaration, because Auth Common is not only required by Vert.x Web during compilation, it's required at runtime.

Currently, io.vertx.auth.common is required only for compilation.

However, it contains the io.vertx.ext.auth.audit.SecurityAudit class, that is used in io.vertx.ext.web.impl.RoutingContextImplBase.

Consequently, if users don't add the module requirement in their application, it fails when the first request is sent with:

Feb 07, 2025 10:54:29 AM io.vertx.core.impl.ContextImpl
SEVERE: Unhandled exception
java.lang.NoClassDefFoundError: Lio/vertx/ext/auth/audit/SecurityAudit;
        at java.base/java.lang.Class.getDeclaredFields0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
        at java.base/java.lang.Class.getDeclaredField(Class.java:2409)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:398)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:396)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:395)
        at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:94)
        at [email protected]/io.vertx.ext.web.impl.RoutingContextImplBase.<clinit>(RoutingContextImplBase.java:43)

So this is a buggy module declaration, because Auth Common is not only required by Vert.x Web during compilation, it's required at runtime.

Signed-off-by: Thomas Segismont <[email protected]>
@tsegismont tsegismont force-pushed the auth-common-required branch from 8a886ce to b9d3631 Compare February 7, 2025 10:10
@tsegismont tsegismont merged commit 94d4175 into vert-x3:master Feb 10, 2025
7 checks passed
@tsegismont tsegismont deleted the auth-common-required branch February 10, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants