Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Can't integrate with Tomcat4

Moderators: Vladimir Kondratyev, Anton Katilin

Can't integrate with Tomcat4

Postby Centaur » Tue Apr 19, 2005 1:48 pm


I use Tomcat 4.0.1, JDK 1.4.2_04
I run Tools/Integrate with J2EE server, chose Tomcat, and it generates new start batch file (see below). When I run it, Tomcat starts successfully, but the tool still answers that "No application being profiled found".

How this can be resolved?


Generated startup_with_yjp.bat
rem Generated with YourKit Java Profiler 4.0.8

set PATH=D:\Program Files\YourKit Java Profiler 4.0.8\bin\win32;%PATH%
set JAVA_TOOL_OPTIONS=-agentlib:yjpagent=sessionname=Tomcat %JAVA_TOOL_OPTIONS%
@echo off
rem ---------------------------------------------------------------------------
rem startup.bat - Start Script for the CATALINA Server
rem $Id: startup.bat,v 2001/10/12 16:48:57 remm Exp $
rem ---------------------------------------------------------------------------

if not "%CATALINA_HOME%" == "" goto gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto gotHome
echo Unable to determine the value of CATALINA_HOME
goto cleanup
"%CATALINA_HOME%\bin\catalina" start %1 %2 %3 %4 %5 %6 %7 %8 %9
Posts: 1
Joined: Tue Apr 19, 2005 1:45 pm

Postby Vladimir Kondratyev » Thu Apr 21, 2005 1:35 pm

If Tomcat starts successfully with profiler agent, it should prints in console (or log file) port number which is used by agent. Please try to connect to this port (as remote application on localhost:port)
Vladimir Kondratyev
Posts: 1519
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby adelhaj » Thu May 05, 2005 8:27 pm

Vladimir Kondratyev wrote:If Tomcat starts successfully with profiler agent, it should prints in console (or log file) port number which is used by agent. Please try to connect to this port (as remote application on localhost:port)

My tomcat starts with the modified tomcat .bat file generated from your software, however it look like its not instrumenting it correctly. The server starts but no port number is getting printed.

.bat file after modifications is:
rem Generated with YourKit Java Profiler 4.0.10

set PATH=D:\Program Files\YourKit Java Profiler 4.0.10\bin\win32;%PATH%
set JAVA_TOOL_OPTIONS=-agentlib:yjpagent=sessionname=Tomcat %JAVA_TOOL_OPTIONS%
set CATALINA_HOME=d:\dev\tomcat\v4.1.24
set JAVA_OPTS=-server -Xmx256M

rem to perform remote debugging, change the JPDA
rem transport to dt_socket and set the JPDA_ADDRESS
rem to a port like 53002. Then, in karmira, connect
rem via socket.
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=53000
set DEBUG=
if not ""%1"" == ""-debug"" goto doStart

set DEBUG=jpda
echo %DEBUG%

%CATALINA_HOME%\bin\catalina %DEBUG% start -config %CATALINA_BASE%\conf\server.xml
goto end


my tomcat home is:
set CATALINA_HOME=d:\dev\tomcat\v4.1.24

my site directory is:

Any help would be great, we are having a major issue on a customer site and I need to get this tool working, specially its remote connection abilities. Once the issue above is resolved, do I need to install the profiling tool ( yourkit) on the application server, or I can work with it remotely?
Posts: 8
Joined: Wed May 04, 2005 10:38 pm
Location: California

Postby RangerRob » Tue May 10, 2005 11:44 pm

adelhaj, have you tried specifying a port in your Tomcat startup file for loading YourKit? This is how the versions prior to 4.0 used to work and I find that sometimes it can solve the problem of it not allocating it's own port.

The syntax is as follows:

set PATH=C:\Programs\YourKit-4.0.10\bin\win32;%PATH%
set JAVA_OPTS=-Xrunyjpagent:port=10100,sessionname=Tomcat %JAVA_OPTS%

Also to answer your subsequent question, you do not need the UI componants on the web server, these go on your local machine for remote access. You will however need to make sure the required libraries (DLLs on Windows) are in the directory set in the PATH environment variable which must be local to the web server. You should be able to delete the executable.
Posts: 64
Joined: Wed Oct 06, 2004 7:56 am
Location: United States

Postby Anton Katilin » Wed May 11, 2005 7:20 am

Hello adelhaj

It is intended to select in the integration wizard the file startup.bat, and then run the generated startup_with_yjp.bat.

I have just checked it with Tomcat 4.1.29, and it works fine for me.

Furthermore, I see that your modified .bat file does not look like startup.bat from that Tomcat version.

Best regards,
Anton Katilin
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest


YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.