aeron-io/aeron · error · IllegalArgumentException

className is empty

Error message

className is empty

What it means

Checksums.newInstance(String) resolves a checksum implementation by class name for archive recording checksums. The library throws IllegalArgumentException when the className argument is null or the empty string, because no checksum can be resolved from a blank name. This is an eager argument validation done before any class lookup.

Solutions

  1. Set the checksum class name property to a valid value, e.g. io.aeron.archive.checksum.Crc32 or io.aeron.archive.checksum.Crc32c, or use the CRC32()/CRC32C() factory helpers
  2. Guard with Strings.isEmpty(className) or check for null/blank before calling newInstance
  3. If checksumming is not required, avoid resolving an instance at all instead of passing an empty name

Example fix

// before
Checksum checksum = Checksum.newInstance(System.getProperty("aeron.archive.checksum.class.name", ""));
// after
String name = System.getProperty("aeron.archive.checksum.class.name");
Checksum checksum = (name != null && !name.isEmpty()) ? Checksum.newInstance(name) : Checksum.crc32();
Defensive patterns

Strategy: validation

Validate before calling

if (className == null || className.isEmpty()) {
    throw new IllegalArgumentException("checksum className must be non-empty");
}
Checksum checksum = Checksum.newInstance(className);

Prevention

When it happens

Trigger: Calling Checksum.newInstance(null) or Checksum.newInstance("") — typically when the archive's recording checksum class name config property is unset or empty and is passed straight through.

Common situations: Configuration mistakes: the 'aeron.archive.recording.checksum.class.name' style system property not set (null) or set to an empty value, then fed to newInstance; or programmatic Context setup passing an empty checksum class name.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12). Data as JSON: /api/errors/51c14080ece8a3a3. Report an issue: GitHub.

Appendix: source

Thrown at aeron-archive/src/main/java/io/aeron/archive/checksum/Checksums.java:69

        return CRC_32C;
    }

    /**
     * Factory method to create an instance of the {@link Checksum} interface.
     *
     * @param className fully qualified class name or an alias of the {@link Checksum} implementation.
     * @return a {@link Checksum} instance.
     * @throws IllegalArgumentException if {@code className == null} or empty.
     * @throws IllegalStateException    if an attempt was made to acquire CRC-32C while running on JDK 8.
     * @throws IllegalArgumentException if an error occurs while creating a {@link Checksum} instance.
     * @throws ClassCastException       if created instance does not implement the {@link Checksum} interface.
     * @see #crc32c()
     */
    public static Checksum newInstance(final String className)
    {
        if (Strings.isEmpty(className))
        {
            throw new IllegalArgumentException("className is empty");
        }

        return switch (className)
        {
            case "CRC-32":
            case "io.aeron.archive.checksum.Crc32":
            case "org.agrona.checksum.Crc32":
                yield crc32();
            case "CRC-32C":
            case "io.aeron.archive.checksum.Crc32c":
            case "org.agrona.checksum.Crc32c":
                yield crc32c();
            default:
            {
                try
                {
                    final Class<?> klass = Class.forName(className);
                    final Object instance = klass.getDeclaredConstructor().newInstance();

View on GitHub (pinned to 6d60124e15)