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:
- An organization adds the vFunction Agent to an application running on a Tomcat Application Server version 8.0.53 and earlier
- The Tomcat does not start or crashes
- The Tomcat logging throws an exception that, “Invalid byte tag in constant pool” as described in this Stackoverflow article
Steps to Resolve the Issue
- Add vFunction’s runtime-agent-dependencies.jar to the Exceptions List under the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in the catalina.properties file
- Restart the Tomcat Application Server and confirm whether or not the Tomcat starts as expected
- If the issue persists, change the vFunction Database Tracking mechanism:
- 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
- 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
- Save and close the file
- 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
- Restart the Tomcat Application Server and confirm whether or not the Tomcat starts as expected
- If the issue persists, remove the vFunction parameters in the JVM arguments, restart the Tomcat Application Server, and contact support@vfunction.com