License Type | SaaS & On-Premise |
Agent Mode | Assess & Protect |
Main Product Category | Contrast UI & Java Agent |
Sub Category | Library Analysis |
Issue
Your application has started successfully with the Contrast agent. However, the Application and the Server entry in the Contrast UI is reporting 0 libraries and/or lines of code for the app.
Cause
The inventory data, which includes the libraries and line of code count is sent when we see the first http traffic hit the application. As such, one of the most common causes of this issue is that the application has not yet been browsed/exercised.
Resolution
Please hit any URL from your application. This can be via a browser or simply with CURL or similar tool. Once the site is visited for the first time, Contrast will spend a few seconds analyzing it before sending the inventory information to the Contrast server. You should then see the inventory data appear in the Contrast UI.
If you're still not seeing this data after exercising the application, we'll need a little more information to figure out why:
- What frameworks is the application using?
- Check out supported frameworks here
- What app server is the application running on and how is it started? For example: Springboot, DropWizard etc. The agent hooks into the class loader when reporting libraries, so if it's unrecognized that can prevent us from sending the inventory data to the Contrast server.
- How is the application packaged? For example: fat jar, .war, .ear, etc.
- The actual location/path to the libraries within the application.
- If the libraries are located in a shared folder the following property can be utilized to point to them:
-Dcontrast.agent.java.websphere_shared_libs_directory
- We'll likely need to take a look at a debug log to see exactly what's happening during the startup. If possible, please add the following properties to the JVM options and restart the app:
-Dcontrast.level=DEBUG -Dcontrast.log=/path/to/contrast.log
Please submit a ticket with you answers and a member of the Contrast Support team will be able to assist further.