Java instrumentation

The Antithesis platform can automatically instrument compiled Java code by means of bytecode weaving. No changes to your source code or build system are required. Simply tell us which directories of your container image contain the JARs you wish to instrument, and whether you want to instrument only certain JARs. For example, you may want to exclude log4j-*, spring-*, or commons-* JARs from instrumentation. It is possible to separately instrument different Java applications in a single image, say, a client and a server, or applications in different images.

It is also possible to instrument JARs within a WAR. Instrumenting separate .class files is not currently supported.

Starting your JARs

The Antithesis instrumentor will create additional dependencies for the application. Antithesis injects these dependency JARs at the same path as the main application JAR, so you will need to add that folder to your classpath.

For example, if you are starting the app in /opt/app/bin/sample_app.jar, then we will require /opt/app/bin/* to be on the classpath.

This means invoking your app JAR like:

java -ea -cp "/opt/app/bin/*" com.your_org.sample_app.controller.Method

This ensures that you are scanning the classpath that includes the Antithesis-injected dependencies, as well as invoking the main program method.

The following invocation will not work:

java -jar /opt/app/bin/sample_app.jar

Symbolization

Antithesis will automatically gather the symbol information from your code. You do not need to separately provide us with symbol files.

Help

Contact us if you need help with this.

  • Introduction
  • How Antithesis Works
  • Getting started
  • Package your software
  • Make it go
  • Deploy to Antithesis
  • Launch a test run
  • User manual
  • Properties and Assertions
  • Properties in Antithesis
  • Assertions in Antithesis
  • Properties to Test For
  • Sometimes Assertions
  • Test Composer
  • Test Composer Basics
  • Test Composer Reference
  • Principles of Test Composition
  • Checking Test Templates Locally
  • Webhooks
  • Launching a test
  • Retrieving logs
  • Launching a debugging session
  • Webhook API
  • Reports
  • Triage report
  • Bug report
  • Multiverse debugging
  • Overview
  • Exploring the multiverse
  • Querying with event sets
  • The Environment and its utilities
  • Using the Antithesis Notebook
  • Cookbook
  • The Environment and Multiverse
  • The Antithesis Environment
  • Fault Injection
  • CPUID
  • Reference
  • Handling External Dependencies
  • SDK reference
  • Go
  • Tutorial
  • Instrumentor
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Java
  • Tutorial
  • Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • C
  • C++
  • Tutorial
  • C/C++ Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • JavaScript
  • Python
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Rust
  • Tutorial
  • Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • .NET
  • Languages not listed above
  • Assert (reference)
  • Lifecycle (reference)
  • Tooling integrations
  • CI integration
  • Discord and Slack integrations
  • Configuring Antithesis
  • Instrumentation
  • User management
  • Sizing your deployment
  • Best practices
  • Is Antithesis working?
  • Optimizing for Antithesis
  • Finding more bugs
  • Release notes
  • Release notes