Reputation: 21
Does anyone have ideas how to get closer to solve my issue?
I am struggeling with a remote connection to jmx of my Wildfly server .
WildFly 10.0.0 Final
JDK 1.8.0_66
Domain Mode
dedicated remoting socket
dedicated remoting connector
I introduced a dedicated remoting connector, since I want to give access to jmx only by this port and keep my management on another port. I defined the security-realm as well as some users in there.
I tried several connection strings in the syntax "service:jmx:://:. But no protocol works:
This appears in the server.log of my WF server
DEBUG [org.jboss.remoting.remote.connection] (default I/O-5) JBREM000200: Remote connection failed: java.io.IOException: XNIO000804: Received an invalid message length of 1195725856
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
<endpoint/>
<connector name="remoting" socket-binding="remoting" security-realm="ApplicationRealm"/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
</subsystem>
I would like to use VisualVM on my Windows client to connect, so I used the Wildfly jconsole.bat and adjusted the executables for using VisualVM.
@echo off
rem -------------------------------------------------------------------------
rem jconsole script for Windows
rem -------------------------------------------------------------------------
rem
rem A script for running jconsole with the remoting-jmx libraries on the classpath.
rem $Id$
set JBOSS_HOME="C:\local\wildfly_10.0"
set JAVA_HOME="C:\Programme\Java\jdk1.8.0_66"
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
if "x%JAVA_HOME%" =="x" (
echo JAVA_HOME environment variable has not been set - please set and re-run!
goto :EOF
)
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%"
) else (
set DIRNAME=.\
)
pushd %DIRNAME%..
set "RESOLVED_JBOSS_HOME=%CD%"
popd
if "x%JBOSS_HOME%" == "x" (
set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
)
pushd "%JBOSS_HOME%"
set "SANITIZED_JBOSS_HOME=%CD%"
popd
if "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
echo WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
)
set DIRNAME=
if "%OS%" == "Windows_NT" (
set "PROGNAME=%~nx0%"
) else (
set "PROGNAME=jdr.bat"
)
rem Setup JBoss specific properties
if "%JAVA_HOME%" == "x" (
echo JAVA_HOME is not set. Unable to locate the jars needed to run jconsole.
goto END
)
rem Find jboss-modules.jar, or we can't continue
if exist "%JBOSS_HOME%\jboss-modules.jar" (
set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
) else (
echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
echo Please check that you are in the bin directory when running this script.
goto END
)
rem Set default module root paths
if "x%JBOSS_MODULEPATH%" == "x" (
set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
)
rem Setup The Classpath
set CLASSPATH=
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\remoting\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\remoting-jmx\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\remoting3\remoting-jmx\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\remoting3\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\logging\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\xnio\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\xnio\nio\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\sasl\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\marshalling\main
call :SearchForJars %JBOSS_MODULEPATH%\system\layers\base\org\jboss\marshalling\river\main
"%JAVA_HOME%\bin\jvisualvm.exe" "-cp:a" "%CLASSPATH%"
:END
goto :EOF
:SearchForJars
pushd %1
for %%j in (*.jar) do call :ClasspathAdd %1\%%j
popd
goto :EOF
:ClasspathAdd
SET CLASSPATH=%CLASSPATH%;%1
:EOF
Upvotes: 2
Views: 8904
Reputation: 1985
For Wildfly 10.1:
Run jconsole.sh from the wildfly/bin directory.
Connect with service:jmx:remote+http://server:port
and the management user you added.
You can see the port in the log output
10:20:36,785 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://server:10090/management
Upvotes: 4