0

we migrate from JBoss 7 to WildFly 9.0.2 and have a problem with the Windows Service on Shutdown. The start of the service works but when stop the service it stopped with the message (from the wildfly_app-stdout.2022-06-01.log):

Failed to connect to the controller: The controller is not available at localhost:9990: java.net.ConnectException: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out

When i try to connect with the CLI i got the same message. The WildFly-Console works in a Browser with http://localhost:9990/console!

This is the Configuration:

standalone.xml:

<subsystem xmlns="urn:jboss:domain:remoting:3.0">
    <endpoint worker="default"/>
    <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
    <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
</subsystem>

<subsystem xmlns="urn:jboss:domain:undertow:2.0">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="http" socket-binding="system-http" max-post-size="0"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" max-post-size="0"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                    <single-sign-on path="/" http-only="true" secure="true"/>
                </host>
            </server>
            <servlet-container name="default" default-encoding="UTF-8" disable-caching-for-secured-pages="false">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
            </handlers>
            <filters>
                <response-header name="server-header" header-name="Server" header-value="WildFly/9"/>
                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/2"/>
            </filters>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:webservices:2.0">
            <modify-wsdl-address>true</modify-wsdl-address>
            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
            <client-config name="Standard-Client-Config"/>
        </subsystem>
...
    <interfaces>
        <interface name="management">
            <any-address/>
        </interface>
        <interface name="public">
            <any-address/>
        </interface>
        <interface name="unsecure">
            <any-address/>
        </interface>
        <interface name="system">
            <inet-address value="127.0.0.1"/>
        </interface>
    </interfaces>

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="system-http" interface="system" port="8080"/>
        <socket-binding name="https" port="8443"/>
        <socket-binding name="osgi-http" interface="management" port="8090"/>
        <socket-binding name="remoting" port="4447"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <socket-binding name="messaging" port="5445"/>
        <socket-binding name="messaging-throughput" port="5455"/>
        <socket-binding name="remote-messaging" port="5545" fixed-port="true"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
    </socket-binding-group>

jboss-cli.xml:

    <default-protocol use-legacy-override="true">http-remoting</default-protocol>

    <!-- The default controller to connect to when 'connect' command is executed w/o arguments -->
    <default-controller>
        <protocol>http-remoting</protocol>
        <host>localhost</host>
        <port>9990</port>
    </default-controller>

service-bat:

set STOPPARAM="/c \"set NOPAUSE=Y ^^^&^^^& jboss-cli.bat --timeout=30000 --controller=%CONTROLLER% --connect %CREDENTIALS% --command=:shutdown\""

I don´t know if it is a problem with the CLI, with the service or a Port/Firewall Problem. But we need the service to work (f.e. Windows Updates and restart).

So the first challenge is to connect to the console with the jboss-cli.bat.

I tried also:

  • increase Timeout with "jboss-cli.bat --timeout=30000 -c"
  • change http and management Ports
  • remove the "management-native"-entry

Please help us!

1 Answers1

0

When you are trying to connect to your wildfly server, if you send "connect" without parameters, jboss-cli connects you to "localhost" (on default). You may choose - send connect with the "127.0.0.1:9990" parameter or edit your hosts file in Windows\System32\drivers\etc folder (to append or uncomment the string "127.0.0.1 localhost"). I hope it will help someone, because I've resolved the same problem ))) Sorry for my English)