Glassfish allows to run multiple, independently configured application server domains. The default is domain1 and can be found at a location inside the glassfish installation like:
If you use Docker, see here.
To configure this domain for the use of inspectIT, there are two ways via editor and administration console. In both cases you need to copy the agent’s inspecit-agent.jar into the lib\ext directory of the domain:
This is necessary to assure the proper classloader creates the agent classes.
Configuration via editor:
Edit the config\domain.xml file of the domain and add three lines to the java-config element:
Configuration via administration console:
Open the administration console (typically http://localhost:4848/ ), log-in to the server and make sure you are in the right domain.
Then select Configuration>JVM Settings and switch to the tab JVM Options. Here add the three JVM Options like above with the proper paths inserted.
In both cases you have to restart the server for the changes to take effect. If you have configured your agent properly, you should see a message like
In the CMR console output. Also the inspectIT application should show your agent and the CPU usage of starting the server.
Configuring OSGi Containers
If you use GlassFish version 3.1.2+ and 4+ you should configure the OSCi Containers for our Javaagent classes. Not doing so might result in following kind of exceptions:
You should add the
to the [GlassFish-Home]/glassfish/config/osgi.properties file:
If you are running Eclipse Equinox or Apache Felix, you might need to add the same bootdelegation package specification to the container properties:
- for Equinox config file is: [GlassFish-Home]/glassfish/osgi/equinox/configuration/config.ini
- for Felix config file is: [GlassFish-Home]/glassfish/osgi/felix/conf/config.properties