-
1. Re: Could not connect to remote http://127.0.0.1:9999 port
guru.1306 Apr 7, 2016 12:14 PM (in response to guru.1306)Any help here?
-
2. Re: Could not connect to remote http://127.0.0.1:9999 port
erhard Apr 7, 2016 4:55 PM (in response to guru.1306)WildFly uses port 9990 for the native interface, not 9999:
jboss-cli.sh --connect --controller=localhost:9990 "/subsystem=logging/logger=my.test:add(level=DEBUG)"
That works out of the box.
-
3. Re: Could not connect to remote http://127.0.0.1:9999 port
ehugonnet Apr 11, 2016 1:43 AM (in response to guru.1306)You are not specifying which protocol you are using so it falls back to http-remote which is on port 9990.
ModelControllerClient.Factory.create("remote", InetAddress.getByName("127.0.0.1"), 9999); // NOSONAR
-
4. Re: Could not connect to remote http://127.0.0.1:9999 port
guru.1306 Apr 12, 2016 3:36 AM (in response to erhard)Is there a particular subsytem responsible for the native interface. I am upgrading from JBOSS 7.1. So I am using the 7.1 standalone.xml file and making the changes accordingly in Wildfly. I may have to add a susbsystem from wildfly standalone.xml.
Thanks
Guru
-
5. Re: Could not connect to remote http://127.0.0.1:9999 port
erhard Apr 13, 2016 11:42 AM (in response to guru.1306)I guess that the confusion comes from the fact that the documentation page The native management API - WildFly 9 - Project Documentation Editor was copied from The native management API - JBoss AS 7.1 - Project Documentation Editor and someone forgot to change port 9999 to 9990, since everything else is the same in WildFly compared to AS7. You don't have to configure anything special to use the native management API (on port 9990).
The CLI tool that comes with the application server uses this interface, and user can develop custom clients that use it as well.
Side note: I would strongly recommend not to use the standalone.xml from AS7 in WildFly9 but to start with the default configuration and make the changes your application needs. Personally I never edit the standalone.xml directly, but use scripts with "jboss-cli.sh --file=xxx" to do the changes. The commands for the CLI are much more stable than the XML-format and most configurations can be migrated to a newer version with no or only minor changes.
-
6. Re: Could not connect to remote http://127.0.0.1:9999 port
ehugonnet Apr 14, 2016 3:57 AM (in response to erhard)Hum I disagree. The native management use port 9999 if you configure a native interface. Now native is no longer the default way to connect, you should use the The HTTP management API - WildFly 10 - Project Documentation Editor . It is specified on the native management API that you have to create the interface (it's the first line actually). Maybe this is not enough visible but it is there
-
7. Re: Could not connect to remote http://127.0.0.1:9999 port
erhard Apr 16, 2016 12:21 PM (in response to ehugonnet)Well as I understand it the native management API is the thing that jboss-cli.sh uses and that can be used with java code. Maybe you can open another interface on port 9999, but I think for WildFly it is simpler to use the existing management port on 9990. But maybe it's better to look at an example. I have the following code with EAP6.2 (AS7):
package jbnative;
import java.io.IOException;
import java.net.InetAddress;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.dmr.ModelNode;
public class ReadVersion {
public static void main(String[] args) throws IOException {
ModelControllerClient client = ModelControllerClient.Factory
.create(InetAddress.getByName("localhost"), 9999);
ModelNode op = new ModelNode();
op.get("operation").set("read-attribute");
op.get("name").set("product-version");
ModelNode returnVal = client.execute(op);
System.out.println(returnVal.get("result").toString());
client.close();
}
}
and the following pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>at.gepardec.demo</groupId>
<artifactId>jbnative</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-controller-client</artifactId>
<version>7.2.0.Final</version>
</dependency>
</dependencies>
</project>
When I start EAP6 with default configuration and run this code I get:
"6.2.0.GA"
Now I want to migrate this to WildFly (I use EAP-7.0.0.Beta). I change the connect to:
ModelControllerClient client = ModelControllerClient.Factory
.create(InetAddress.getByName("localhost"), 9990);
and the dependency in pom.xml to:
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller-client</artifactId>
<version>2.0.3.Final-redhat-1</version>
</dependency>
I start WildFly with the default configuration, run the code and get:
"7.0.0.Beta1"
So I just have to change the port and use the current libraries. No fiddling with configuring additional interfaces. And to answer Gurus question, I would suggest he does just that.
-
8. Re: Could not connect to remote http://127.0.0.1:9999 port
ehugonnet Apr 16, 2016 2:59 PM (in response to erhard)Widlfy use http-remoting as its default remoting protocol where EAP 6/ AS7 used remote (from Jboss Remoting project).
You can use the remote protocol on 9999 but that will require some configuration change on WildFly.
Gurus has 2 options : change his code or change the configuration. Not knowing his constraints I left it to him to choose
-
9. Re: Could not connect to remote http://127.0.0.1:9999 port
guru.1306 Apr 29, 2016 1:20 AM (in response to erhard)Thanks . The issue is that I used the standalone.xml from 7.1 directly. Finally I had to edit the standalone.xml manually and it worked .
I will use the CLI instead of manually editing it..
Thanks
Guru