Search
Calendar
June 2025
S M T W T F S
« May    
1234567
891011121314
15161718192021
22232425262728
2930  
Archives

PostHeaderIcon Configure JProfiler 5 to work with JOnAS 5

JOnAS 4 (and older) and JProfiler 4 (and older) were used to working smoothly. JOnAS 5 makes a large use of OSGi libraries… which may “blind” JProfiler.

Here is a workaround, slightly different from former version, to bypass this issue, in order to make JProfiler 5 work with JOnAS 5:

  • let’s assume you have installed JOnAS in a folder, let’s say JONAS_ROOT
  • install JProfiler 5 with default options, set the JDK, licence key, etc., let’s say in a folder C:\win32app\jprofiler5\ also known as JPROFILER_HOME.
  • edit %JONAS_ROOT%/bin/setEnv.bat:
    • set: JAVA_OPTS=-agentlib:jprofilerti=port=8849 "-Xbootclasspath/a:C:\win32app\jprofiler5\bin\agent.jar" %JAVA_OPTS%
  • edit %JONAS_ROOT%/conf/osgi/default.properties
    • in the property bootdelegation-packages, add the JProfiler packages:
bootdelegation-packages com.sun.corba, \
                              com.sun.corba.*, \
                              (...)
                              com.jprofiler, \
                              com.jprofiler.*, \
                              com.jprofiler.agent, \
                              com.jprofiler.agent.*
  • add JPROFILER_HOME\bin\windows to your environment variable PATH.
  • startup JOnAS, you should see the following block in standard output:
JProfiler> Protocol version 25
JProfiler> Using JVMTI
JProfiler> 32-bit library
JProfiler> Listening on port: 8849.
JProfiler> Native library initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Hotspot compiler enabled
JProfiler> Starting org/ow2/jonas/commands/admin/ClientAdmin ...
  • run JProfiler, follow the wizard, take caution to set JProfiler port at 8849 (or remain consistent with the port set in JOnAS config file)

Leave a Reply