Missing Beans or not monitoring DB Tables
Overview
This issue occurs in the following circumstances:
- An organization installs a vFunction Server
- The organization installs the vFunction Dynamic Agent on a Java Application
- The organization starts Learning in the vFunction Server UI
- The organization performs Smoke Tests to confirm functionality with the Application and vFunction
- The organization stops Learning in the vFunction Server UI
- The organization selects Analysis > Show Resources Report in the vFunction Server UI
- Unexpectedly, there are no Beans or no Database Tables listed in the Resources Report
Resolution
Review Logs for Errors
To understand the Root Cause of the issue, search the vFunction Agent’s logging for exceptions or errors. These logs are in:
Sudo Installation
- /var/log/vfunction/instances/default-java/vfagent.log
- /var/log/vfunction/instances/default-java/vfagent.log.dbtracking
- /var/log/vfunction/instances/default-java/vfagent.log.beanstracking
Sudoless Installation
- $BASE_DIR/vfunction/var/log/vfunction/instances/default-java/vfagent.log
- $BASE_DIR/vfunction/var/log/vfunction/instances/default-java/vfagent.log.dbtracking
- $BASE_DIR/vfunction/var/log/vfunction/instances/default-java/vfagent.log.beanstracking
Disable or Change Tracking Features in the vFunction Properties file
The vFunction Agent usesThe file /etc/sysconfig/vfunction/agent/instances/<instance_name>/vfunction-runtime-override.properties has runtime properties that control the analysis.
These values are set during the installation of the controller according to the file /etc/sysconfig/vfunction/installation/instances/default/installation.yaml. The parameters are application_server (under agent) and the override_properties.
It is recommended to ensure the application_server is set to the right application server type before changing the properties, and if not, set it correctly and run upgrade (/opt/vfunction/controller-installation/upgrade.sh)
Review the properties and make sure the relevant ones are set to true.
For example:
Section DB Tracking (Default)
com.vfunction.runtime.config.aop.xml.db.tracking.enabled=true
com.vfunction.runtime.config.aop.xml.db.tracking.jdbcdriver.enabled=false
Section Beans (Default)
com.vfunction.runtime.config.tracking.beans.ejb.stateless.enabled=true
com.vfunction.runtime.config.tracking.beans.ejb.stateful.enabled=true
com.vfunction.runtime.config.tracking.beans.ejb.singleton.enabled=true
com.vfunction.runtime.config.tracking.beans.ejb.interceptor.enabled=true
com.vfunction.runtime.config.tracking.beans.ejb.mdb.enabled=true
Handling Exceptions concerning DB connection classes
If the logs show exceptions concerning DB connections, for example:
java.lang.ClassCastException: vfrtshadow.com.p6spy.engine.wrapper.ConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
Then try to do DB tracking via JDBC:
-
Edit the file: etc/sysconfig/vfunction/agent/instances/<instance_name>/vfunction-runtime-override.properties
-
Set the properties values:
- com.vfunction.runtime.config.aop.xml.db.tracking.enabled=false
- com.vfunction.runtime.config.aop.xml.db.tracking.jdbcdriver.enabled=true
- Restart the application (the monolith)
Getting more debug messages for the database tracking
Turn on a flag to print debug messages into the logs.
Add -Dcom.vfunction.logging.level.dbtracking=DEBUG to the other vFunction JVM arguments set during the agent installation and restart the monolith. The logs will be added to the vfagent.log.dbtracking file.
Missing DB Tables due to errors in parsing SQL Queries
If you don’t see the tables you expect in the resources, there is a chance that there are some errors in parsing the SQL queries by vFunction
To check, look for SQL parsing error in /var/log/vfunction/instances/<instance_name>/vfagent.log.dbtracking
If such errors exist, open the file /etc/sysconfig/vfunction/agent/instances/