Skip to content

OfflineServerVersion reports wrong version for WildFly 28+ #242

@simkam

Description

@simkam

The last time WildFly updated the domain namespace in the configuration file was with WildFly 27 (Version 20.0). There has been no change since then, so OfflineServerVersion reports version 20.0 for WildFly 27 (currently -33). Version updates are no longer needed after WFCORE-5640.

<server xmlns="urn:jboss:domain:20.0">

One option to get a version might be

URLClassLoader cl = new URLClassLoader(new URL[] {"server_root/modules/.../.../wildfly-version".toURI().toURL()},
        this.getClass().getClassLoader()
);

Class<?> versionClass = Class.forName("org.jboss.as.version.Version", true, cl);
Field majorVersionField = versionClass.getDeclaredField("MANAGEMENT_MAJOR_VERSION");
return  majorVersionField.getInt(null);

but Creaper doesn't always have path to the server, only path to configuration file be used.

Another approach might be adding support for versioned subsystems instead of relying on the root version.

Or only documenting current behavior and leaving it to OfflineCommand implementations to handle different subsystems versions. One example is #235

stringSubsystemValues = datasources.'@xmlns'.text().tokenize(":")[-1].tokenize(".")
major = stringSubsystemValues[0].toInteger()
minor = stringSubsystemValues[1].toInteger()
securityParamsAsElements = major <= 7 && minor < 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions