License Type | SaaS & On-Premise |
Agent Mode | Assess & Protect |
Main Product Category | Java Agent |
Sub Category | Runtime Exception |
Issue
When starting the Contrast agent, you see an error containing the following:
java.lang.NoClassDefFoundError:com/contrastsecurity/
Cause
[1] This error often indicates you've renamed your agent jar from its original name, contrast.jar
. The contrast.jar
file name has to match a file that's already inside the jar.
[2] It might also mean that you're using an OSGi container, like Felix or Equinox, and the agent has been unable to inject it's classes into the the OSGi boot delegation.
Resolution
[1] Unzip contrast.jar and open the META-INF/MANIFEST.mf
. If the current file name of the agent does not match the name here, rename the agent to name provided in MANIFEST.mf
.
[2] Starting with version 3.5.4, you can try running with -Dcontrast.automaticbootdelegation=true
, which will attempt to supplement classloading behavior to increase the visibility of Contrast agent classes.