I am trying to start jmx process trhough java ProcessBuilder in windows 2008, When I set jvmOpts.add( "-Dcom.sun.management.jmxremote.port=8999") The error message it shows is
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: hostName : hostName
When I remove jmdremote.port The error message it throws is
Error: Exception thrown by the agent : java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
My jmx options are
jvmOpts.add( "-Dcom.sun.management.jmxremote")
jvmOpts.add( "-Dcom.sun.management.jmxremote.authenticate=false" )
jvmOpts.add( "-Dcom.sun.management.jmxremote.ssl=false" )
jvmOpts.add( "-Dcom.sun.management.jmxremote.port=8999")
jvmOpts.add( "-Djava.rmi.server.hostname=hostName")
jvmOpts.add( "-Dcom.sun.management.jmxremote.local.only=false")
When I run the same program without using java processBuilder directly from command line it is working perfectly fine. When I execute the same progam using ProcessBuilder in Unix the program is working fine. Can any one please let me know what am I missing here. Do I need to load any windows environment variables to the ProcessBilder (As it is working fine from command line). Thanks in advance.