asbachb opened a new pull request, #6138:
URL: https://github.com/apache/netbeans/pull/6138
NetBeans communicates to Wildfly via management api. This functionality
depends
on several Wildfly classes which are pulled from the Wildfly installation.
It seems that in 28.0.1 some classes and jars were moved which prevents
NetBeans
from communicating to Wildfly.
This change simplify the current logic gathering different jars and just use
`jboss-cli-client` which should contain all necessary classes which are
needed
to connect to Wildflys management interface.
I did some manual testing:
* Start / Stop /Deploy Wildfly 28.0.1
* Start / Stop / Deploy Wildfly 27.0.1
* I checked for classes loaded by plugin
* Downloaded all available Wildfly & JBoss EAP servers
* Created a test file which creates a Classloader per server and try to load
the found classes
```java
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.javaee.wildfly;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Collections;
import org.junit.Test;
import org.netbeans.junit.NbTestCase;
import org.openide.util.Exceptions;
/**
*
* @author Benjamin Asbach
*/
public class WildflyClassLoaderTest extends NbTestCase {
public WildflyClassLoaderTest(String name) {
super(name);
}
@Test
public void testSomeMethod() throws IOException {
String[] classesUsedByModule = new String[]{
"org.jboss.dmr.ModelNode",
"org.jboss.as.controller.client.Operation",
"org.jboss.as.controller.client.OperationMessageHandler",
"org.jboss.as.controller.client.ModelControllerClient$Factory",
"org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder",
"org.jboss.as.controller.client.ModelControllerClientConfiguration",
"org.jboss.as.controller.PathAddress",
"org.jboss.as.controller.PathElement",
"org.jboss.as.controller.client.helpers.Operations"
};
Path wildflyInstallations =
Paths.get("/home/asbachb/dev/tmp/wildfly");
Files.walkFileTree(wildflyInstallations, Collections.emptySet(), 1,
new SimpleFileVisitor<Path>(){
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes
attrs) throws IOException {
WildflyClassLoader classloader =
WildflyClassLoader.createWildFlyClassLoader(file.toString());
System.out.print("Testing " + file.toString() + "...");
for (String classUsedByModule : classesUsedByModule) {
try {
classloader.loadClass(classUsedByModule);
} catch (ClassNotFoundException ex) {
System.out.println("FAILED!");
System.out.println("Could not load " +
classUsedByModule);
Exceptions.printStackTrace(ex);
return FileVisitResult.CONTINUE;
}
}
System.out.println("OK!");
return FileVisitResult.CONTINUE;
}
});
}
}
```
Results:
```
Testing /home/asbachb/dev/tmp/wildfly/wildfly-10.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-10.1.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-11.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-12.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-13.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-14.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-14.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-15.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-15.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-16.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-17.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-17.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-18.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-18.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-19.1.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-20.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-20.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-21.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-21.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-21.0.2.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-22.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-22.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-23.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-23.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-23.0.2.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-24.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-24.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-25.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-25.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.1.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.1.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.1.2.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-26.1.3.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-27.0.0.Alpha5...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-27.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-27.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-28.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-28.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-8.0.0.Final...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/wildfly-8.1.0.Final...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/wildfly-8.2.0.Final...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/wildfly-8.2.1.Final...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/wildfly-9.0.0.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-9.0.1.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/wildfly-9.0.2.Final...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-6.1...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-6.2...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-6.3...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-6.4...FAILED!
Could not load
org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-7.0...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-7.1...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-7.2...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-7.3...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-7.4...OK!
Testing /home/asbachb/dev/tmp/wildfly/jboss-eap-8.0...OK!
```
I assume this would be ok as
`org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder`
seems to be not available on the servers classpath and so the module shouldn't
be compatible with these servers anyways.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists