Simple Jprofiler setup not working

I am trying to start a simple local JProfiler session. I created a session, the host is 127.0.0.1, the default port is 8849, and I pointed the start / shutdown commands to the local installation of tomcat startup.sh/shutdown.sh. I click OK, and I get "Connect to 127.0.0.1:8849", and after 150 seconds (I changed the timeout), it expires and says:

Failed to connect to 127.0.0.1:8849. Verify that the remote address is correct, that the remote program is running correctly, and that the network route allows socket connections.

The address cannot be wrong, and I checked (ps -ef | grep tomcat) that the process has completed, and also checked the tomcat log and is waiting for requests:

INFO: Starting Coyote HTTP/1.1 on http-8080 Apr 15, 2011 7:49:13 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Apr 15, 2011 7:49:13 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/21 config=null Apr 15, 2011 7:49:13 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 47312 ms 

Is there anything else I need to do to open the port? For example, should I change the JAVA_OPTS that are passed to tomcat?

+2
source share
4 answers

Yes. you need something like this (for OS X)

 export JAVA_OPTS="-agentlib:jprofilerti=port=8849 \ -Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar" export DYLD_LIBRARY_PATH=/Applications/jprofiler5/bin/macos 

Usually, when you set up a new session using the wizard in JProfiler, it will tell you the exact parameters that you need to make.

For me, this wizard is StartCenter → New Session, then select "New Remote Integration". He then asks for local / remote, startup mode, jvm type, profiling port and on page 6 “Making necessary changes”, and he lists them.

Alternatively, you can select the “Integration Wizard” in the menu bar.

+4
source

Step 1: On a Linux machine, open the .bash_profile file from the /root directory. Enter the location of jprofiller (using the export command below) in the enter code here .bash_profile file

 export LD_LIBRARY_PATH=/dsvol/jprofiler6/bin/linux-x86 

Step 2. Go to the Tomcat installation directory. Open the catalina.sh file from the bin folder. Enter the data below in the catalina.sh file (only information about the red color and the default black color can be found in the catalina.sh file)

 export JPROFILER_HOME JAVA_OPTS="-Xms768m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -agentpath:/opt/Performance/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849 $CATALINA_OPTS" 

Step 3: Start the server from the bin folder by running the starup.sh command

+1
source

The easiest way to configure this is to follow the wizards provided by JProfiler, which are described here, there are also wizards without a GUI, which are very convenient:

http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/sessions/remote.html

For example, for Tomcat, the following is automatically added to the Tomcat startup.sh script, which means you don't need to guess:

 # The following lines have been added by the # application server integration wizard of JProfiler CATALINA_OPTS="-agentpath:/local/jprofiler8/bin/linux-x64/libjprofilerti.so=port=8849,nowait $CATALINA_OPTS" export CATALINA_OPTS # end of modifications exec "$PRGDIR"/"$EXECUTABLE" run " $@ " 

Good luck.

+1
source
 -agentpath:/Applications/JProfiler.app/Contents/Resources/app/bin/macos/libjprofilerti.jnilib -Xbootclasspath/a:/Applications/JProfiler.app/Contents/Resources/app/bin/agent.jar 

This works for me, JProfiler 9.1.1; OSX 10.11.3

-1
source

Source: https://habr.com/ru/post/901043/


All Articles