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

OfflineServerVersion reports wrong version for WildFly 28+ #242

Open
simkam opened this issue Sep 10, 2024 · 1 comment
Open

OfflineServerVersion reports wrong version for WildFly 28+ #242

simkam opened this issue Sep 10, 2024 · 1 comment

Comments

@simkam
Copy link
Collaborator

simkam commented Sep 10, 2024

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
@marekkopecky
Copy link
Contributor

If we would be ok with introducing subsystem support in creaper core, one solution could be this. But I also think that we should evaluate whether subsystem detection is really needed, because creaper use in in one command only where is a check for >WF10 (extra old WF).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants