Cannot create JMX connection from JProfiler - jprofiler

I am trying to connect JProfiler (10.0.1) to JMX port using quick attach -> another computer.
I can connect to JMX port using jvisualvm and JConsole easily, all I have to do is put in host and port. But on jprofiler I get following error
"Another appliction is running on port 19002. Please check your port
configuration".
I am using oracle JDK jdk1.8.0_181. Below are the JXM options i am using for server startup.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=19002
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

JProfiler does not connect to profiled JVMs via JMX, the agent opens a server socket on a dedicated port, by default 8849.
If you use quick attach, you do not have to specify a port at all, but select a JVM from a list of running JVMs. For the selected JVM, the profiling agent will be loaded and a port will be assigned automatically in such a way that you do not have to deal with it at all.
I would also recommend to use the latest version, not 10.0.1.

Related

various issues when setting up visualvm remote JVM connection with jstatd

statd on remote machine may not be starting up correctly and visualvm user interface does not add connections.
On the remote machine, I created a policy file for jstatd:
grant codebase "file:/home/jonathan/jdk1.8.0_191/lib/tools.jar" {
permission java.security.AllPermission;
};
I then execute jstatd: ./jstatd -p 1199 -J-Djava.security.policy=/home/jonathan/jstatd.policy
It seems to be running and there are no errors which I got when not specifying a port number or policy file.
In visualvm, I'm able to add the remote host but when I try to create a jstatd connection and fill the information, when clicking "ok", the popup just disappears. No errors, no connections under the node, no nothing. I enabled logging and there are no errors.
My questions:
1. Does jstatd REQUIRES an rmiregistry to work? Not specifying a port, will it attempt to connect to a default one (on port 1099)?
2. Running netstat doesn't show any binding on port 1199 which I've designated.
3. Why does visualvm not allow connections to be created?
I think that jstatd man page should answer most of your questions. Regarding connection from visualvm - check VisualVM log file. Are there firewall(s) between visualvm and jstatd?

How can I use the Apache Ignite.NET Thin client to connect to a specific grid

The Server and Client (setclientmode(true)) modes need Java and take quite a while to startup (Ignition.Start). The server is the one that holds the cache. I presume that the client node is like a 'local' copy of the cache.
However, Ignite also supports a ThinClient - where we can 'open a connection' and run queries from Ignite.NET without having Java installed. The only configuration required by a ThinClient is the Host IP Address. How can we connect to a specific grid on the ignite server using the Thin Client?
Is this something that is expected to come in the upcoming releases?
Every server node is listening to some specific port for connections from thin clients. By default this is port 10800, but it can be changed. If this port is occupied, then next available is used.
So, if you want to connect to some specific node, then you should specify its IP and port, that will be used for connection.
Documentation: https://apacheignite-net.readme.io/docs/thin-client#section-configuring-server-nodes

How to automatically start a tunnel when a session is opened in MobaXterm?

I use MobaXterm for remote access to servers running in the cloud. For development and admin purposes, these servers expose admin application on local network interfaces. For example, Tomcat will expose 127.0.0.1/manager.
Since I prefer not to have to expose these services to the internet, I've set up ssh tunnels in MobaXterm to connect to these web applications on a local port through local port forwarding, which is easy to set up with the application itself.
My question: How can you get MobaXterm to automatically start a tunnel when a session is opened and to stop/close them when the session is ended?
I know a client like Putty would do this by default, but I don't want to use different clients for different jobs if I don't have to and MobaXterm has other features I need that Putty doesn't.
You can setup new SSH tunnels in Tunneling section (or from the MobaXterm's Tools menu, you can start MobaSSHTunnel). This will show a graphical port forwarding tool, where you can setup a new SSH tunnels which can be configured to be started automatically at MobaXterm startup by selecting Autostart from the tunnel settings.
Try to use MyEn Tunnel:
https://myentunnel.informer.com/
There is an option to Connect on Startup

Attaching IntelliJ IDEA debugger to Wildfly Docker image started by Arquillian

I'm trying to create Arquillian unit test using http://arquillian.org/arquillian-cube extension where you can set a breakpoint on the server side.
I've created a project which executes a simple test successfully (all details are here):
https://github.com/scetix/arquillian-cube-wildfly-quickstart
Is there any way of automatically attaching IntelliJ IDEA debugger to Wildfly running in Docker container when the test starts?
Automatically, I don't think so. In case of the Docker example, from the point of view of the IDE that is considered a remote server.
So what you need to do is first of all start Wildfly with debug enabled (http://tools.jboss.org/blog/2015-03-17-debugging-an-externally-launched-wildfly.html) and expose the debugger port correctly (https://github.com/scetix/arquillian-cube-wildfly-quickstart/blob/master/src/test/resources/Dockerfile#L12). Put these lines into you Dockerfile:
# Expose JBoss/Wildfly management port
EXPOSE 9990
# Expose JBoss/Wildfly debug port
EXPOSE 8787
You also need to set the port binding for Docker Compose (https://github.com/scetix/arquillian-cube-wildfly-quickstart/blob/master/src/test/resources/docker-compose.yml#L5). Add port 8787 for the debugger to the YAML file (first number - 58787 here - may be any number you prefer):
ports:
- 58787:8787/tcp
And finally start IntelliJ as a remote debugger, setting the IP of the Docker host (localhost in case of native Docker, Docker Machine IP in case of Docker Machine).
You can see how to do this with IntelliJ: http://blog.trifork.com/2014/07/14/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea/. The example is for Tomcat; specify JBoss instead.

How can I connect to Weblogic remotely using JConsole?

Which URL, port and weblogic server side settings do I need to use?
It depends if you want to connect to a WebLogic MBean server (Domain, Runtime, Edit) or platform (JDK) MBean server (See MBean Servers).
Connecting with JConsole to a WebLogic MBean server is usually a real pain:
Enable Anonymous Admin Lookup if version is lower than 10.3 (See WebLogic anonymous user permissioning)
Enable IIOP Protocol for Admin Server and Application Servers (See Enable and configure IIOP)
Launch jconsole with a custom commandline (See Managing WebLogic servers with JConsole)
Connecting to platform MBean server is like any other JVM (See How to activate JMX on my JVM for access with jconsole), but you would not see any WebLogic MBeans unless you configure WebLogic to use it (See Registering MBeans in the JVM Platform MBean Server).
Try adding this to your server start-up parameters. Change the port (7011) to whatever you prefer. You should be able to use JConsole then by specifying the remote server "{host}:{port}"
Note: the {host} does not include a "http://" prefix.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=7011
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Also, you probably don't want to disable authentication like this in a production environment, but the parameters above should help you with testing. When using this, you won't need to specify a username/password in JConsole.
You'll have to enable the remote server to listen on a specific port for JMX -http://download.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote
URL would be your server's listen address. You also have the option to require authentication to limit the usage of the debug port.