Error 'Invalid Byte Tag in Constant Pool' when Java Agent added to Tomcat Application Server


Overview of the Issue

This issue occurs in the following circumstances:

  1. An organization adds the vFunction Agent to an application running on a Tomcat Application Server version 8.0.53 and earlier
  2. The Tomcat does not start or crashes
  3. The Tomcat logging throws an exception that, “Invalid byte tag in constant pool” as described in this Stackoverflow article

Steps to Resolve the Issue

  1. Add vFunction’s runtime-agent-dependencies.jar to the Exceptions List under the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in the catalina.properties file
  2. Restart the Tomcat Application Server and confirm whether or not the Tomcat starts as expected
  3. If the issue persists, change the vFunction Database Tracking mechanism:
  1. In an editor, open the installation.yaml:

Replace $INSTANCE_NAME with the actual name, such as “default-java”

vi /etc/sysconfig/vfunction/installation/instances/$INSTANCE_NAME/installation.yaml
  1. Add entries to change the vFunction Database Tracking mechanism in the agent.override_properties:
## Before
agent:
  override_properties:
  #  - key=value


## After
agent:
  override_properties:
    - com.vfunction.runtime.config.aop.xml.db.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.db.tracking.jdbcdriver.enabled=true
  1. Save and close the file
  2. Upgrade the vFunction Controller instance

Replace $INSTANCE_NAME with the actual name, such as “default-java”

bash /opt/vfunction/controller-installation/upgrade.sh -i $INSTANCE_NAME
  1. Restart the Tomcat Application Server and confirm whether or not the Tomcat starts as expected
  1. If the issue persists, remove the vFunction parameters in the JVM arguments, restart the Tomcat Application Server, and contact support@vfunction.com