Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Short answer: java.lang.NoClassDefFoundError: com/itextpdf/kernel/counter/event/IMetaInfo means the JVM cannot load an iText kernel class at runtime. The usual causes are an old iText Core release such as 7.0.4, mismatched iText modules, or a deployment classpath that differs from the one used to compile the application. Upgrade the iText line required by your add-on (the documented cases were fixed by 7.1.7 and, for an html2pdf case, kernel 7.2.5), align every iText artifact to one compatible version, remove duplicate JARs, then inspect the runtime dependency tree.

What the exception actually means

IMetaInfo belongs to iText Kernel under com.itextpdf.kernel.counter.event. A NoClassDefFoundError is thrown after compilation, when the JVM tries to load a class that was available (or assumed available) during compilation but is not available in the running class loader. It is therefore a runtime packaging or version problem, not an HTML syntax error.

In the commonly reported iText 7.0.4 plus html2pdf scenario, upgrading to iText 7.1.7 fixed the missing class. A later html2pdf report was resolved by upgrading Kernel to 7.2.5. Those versions are evidence for those individual dependency sets, not a universal instruction to choose one number blindly. Select a release supported by your Java runtime and by the html2pdf or other add-on version you use, and keep all iText modules on that same compatible line.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why IMetaInfo disappears

An old Core release

Projects pinned to 7.0.4 predate fixes and dependency arrangements used by later iText add-ons. If an add-on was built against a newer Core API, an older Kernel JAR can leave the class absent at runtime.

Mixed iText module versions

iText 7 is split into independent parts. Replacing one artifact without coordinating the others can produce an internally inconsistent classpath. For a basic Java setup, iText’s installation guidance identifies kernel, io, and layout as required; features such as forms, PDF/A, signing, or the Bouncy Castle adapter add more modules.

Compile-time and runtime classpaths differ

The dependency can appear in Maven or Gradle yet be absent from the deployed application server, shaded JAR, Docker image, or IDE launch configuration. Conversely, an application server can inject an older iText JAR ahead of the one packaged by your application.

Remediation plan

  1. Identify the complete iText set. Record direct dependencies and add-ons such as html2pdf, then inspect transitive dependencies.
  2. Choose one compatible version property. Do not set a different version for Kernel, IO, Layout, or an add-on’s Core dependency.
  3. Declare the modules your code actually uses. At minimum, basic Java use normally includes Kernel, IO, and Layout; add feature modules deliberately.
  4. Exclude or remove conflicting artifacts. Check application-server libraries, shaded/fat JAR contents, Docker layers, and IDE run configurations.
  5. Rebuild from a clean state. Package the application again, deploy that package, and verify the resolved runtime classpath rather than relying on the build file alone.
  6. Test the add-on path. If html2pdf is involved, follow its compatibility requirements and keep its iText Core modules synchronized.

Maven: keep every iText module on one version

Use a single property and reference it from every iText dependency. The coordinates below show the pattern; add only modules required by your application and use a release compatible with your add-on.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<properties>
  <itext.version>7.2.5</itext.version>
</properties>

<dependencies>
  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>kernel</artifactId>
    <version>${itext.version}</version>
  </dependency>
  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>io</artifactId>
    <version>${itext.version}</version>
  </dependency>
  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>layout</artifactId>
    <version>${itext.version}</version>
  </dependency>
</dependencies>

The value 7.2.5 reflects the cited html2pdf fix; it is not a requirement for every project. The release index currently lists iText Core 9.7.0 and 7.2.6, so release selection is time-sensitive. Before changing a production application, check the compatibility of your Java runtime, add-ons, and other PDF modules.

Inspect Maven’s resolved graph

mvn dependency:tree -Dincludes=com.itextpdf
mvn dependency:tree -Dverbose -Dincludes=com.itextpdf

Look for multiple versions of kernel, io, or layout, omitted conflicts, and an html2pdf dependency pulling a different Core line. If an older version wins mediation, manage the version centrally or exclude the unwanted transitive dependency, then run the tree command again.

Gradle: enforce a consistent iText line

Define one version and reuse it. The same rule applies whether you use the Groovy or Kotlin DSL.

ext {
    itextVersion = '7.2.5'
}

dependencies {
    implementation "com.itextpdf:kernel:${itextVersion}"
    implementation "com.itextpdf:io:${itextVersion}"
    implementation "com.itextpdf:layout:${itextVersion}"
}

For Kotlin DSL:

val itextVersion = "7.2.5"

dependencies {
    implementation("com.itextpdf:kernel:$itextVersion")
    implementation("com.itextpdf:io:$itextVersion")
    implementation("com.itextpdf:layout:$itextVersion")
}

Inspect Gradle’s runtime classpath

./gradlew dependencies --configuration runtimeClasspath
./gradlew dependencyInsight --dependency com.itextpdf --configuration runtimeClasspath

The second command identifies why a particular version was selected. Repeat the check for the packaged artifact if you build a fat JAR; a correct resolution report does not prove that a custom shading rule copied the expected classes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the JAR that is really running

Application servers

Search the server’s shared library directories as well as your application’s WEB-INF/lib (or equivalent). Remove obsolete iText JARs or adjust class-loader precedence according to the server’s documented mechanism. Restart the server after replacing libraries; hot redeploy can retain an old class loader.

Fat JARs and shaded builds

List the archive contents and check that the class exists exactly at com/itextpdf/kernel/counter/event/IMetaInfo.class:

jar tf build/libs/your-app-all.jar | grep 'com/itextpdf/kernel/counter/event/IMetaInfo.class'

If the command returns nothing, the packaging step omitted the class or included an incompatible Kernel. If it returns the class but the error persists, inspect the launch command and classpath for another older JAR loaded first.

Docker images

Inspect the final image, not only the build stage. Confirm that the copied application artifact is the rebuilt one and that no base-image or mounted directory contributes an older iText JAR. Rebuild without stale layers when diagnosing a version change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Class-loader evidence

Run with class-loading diagnostics supported by your Java version (for example, the unified logging class-load option on modern JDKs) and identify which JAR supplies com.itextpdf.kernel. This distinguishes “class absent” from “wrong JAR loaded first.”

html2pdf-specific compatibility

html2pdf is an add-on layered on iText Core. Its classes may compile while a different Core version is selected at runtime. Check the add-on’s compatibility guidance, then use one synchronized Core version across Kernel, IO, Layout, and any additional modules. Do not solve the exception by upgrading only one arbitrary JAR unless the add-on documentation explicitly requires that combination.

For the reported cases, 7.1.7 fixed a 7.0.4 project and Kernel 7.2.5 fixed a later html2pdf variant. Treat those as case-specific upgrade paths: reproduce the dependency graph, select the supported line for your application, and test PDF generation, HTML conversion, fonts, forms, and signing features that your code uses.

Common symptoms, causes, and fixes

Symptom Likely cause Fix
Works in the IDE, fails after deployment Runtime package or server classpath lacks the compiled dependency Inspect the deployed archive and server libraries; redeploy a clean build
Only one machine fails Different shared JAR, container layer, or launch classpath Compare resolved runtime trees and archive contents on both machines
Dependency tree shows two Core versions Transitive conflict or partial upgrade Use one managed version and exclude the obsolete transitive artifact
Class exists in a JAR but error remains An older duplicate JAR is loaded first, or a stale class loader remains Trace class loading, remove duplicates, and restart the container
Upgrade causes other linkage errors Modules or add-ons are outside their compatible range Align the complete iText set and follow the add-on’s compatibility matrix
Build is clean but production still fails Production uses a different image, server library, or shaded artifact Verify the final deployed bytes, not just source declarations

Clean rebuild and validation checklist

  • Delete the build output and rebuild with the selected iText version.
  • Run the Maven or Gradle dependency report for the runtime configuration.
  • Confirm exactly one compatible version of each iText module is packaged.
  • Check that IMetaInfo.class is present in the deployed Kernel JAR.
  • Run the same conversion or PDF operation that originally failed.
  • Exercise add-on features such as CSS conversion, forms, PDF/A, or signing if your application uses them.
  • Record the final versions and packaging method so a future deployment cannot silently reintroduce an older JAR.

Licensing and release choice

iText is distributed under AGPL/community terms, with commercial licensing available for proprietary use as described in its installation materials. A technically correct dependency change does not decide which license your application needs. Confirm the obligations for your distribution model before shipping an upgrade. Because the release index includes both the 9.7.0 and 7.2.6 lines, do not assume the newest number is automatically compatible with an older html2pdf integration or Java runtime.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your PDF workflow also needs reproducible screenshots of rendered pages or documentation, ScreenshotNeo provides a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP, or PDF. Before capture it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled.

Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response reports the result in X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

Best Value
Java Programming Java Success Algorithm Java Programmer T-Shirt
  • Java Programming Java Success Algorithm Java Programmer is a perfect present for IT specialist or a computer geek, computer nerd, network engineer. Funny gift idea for a Java coder or programmer, Java script developer, cool gift for an IT professional.
  • Java Programming Java Success Algorithm Java Programmer is a cool gift for JS, Javascript programmers and Web developers. Funny Java Programming gift for husband and also suitable for a wife. Funny Java programmer birthday gift, IT gift for Christmas.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem

The API supports full-page captures with lazy images loaded, CSS-element capture, dark mode, device presets or custom viewports, retina scale, PDF paper settings and page ranges, HTML/CSS rendering, custom JavaScript and CSS, clicks before capture, selector hiding, selector/delay/network-idle waits, request and resource blocking, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work.

Use the ScreenshotNeo documentation for the complete option list. A one-call capture looks like this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

There is a free allowance of 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can I fix this by adding only an iText Kernel dependency?

Only if the resulting set is compatible with every add-on and module in your application. A partial addition can leave IO, Layout, or html2pdf on a different line and create another linkage error.

Why does the stack trace mention a class that my source code never uses?

A library can reference IMetaInfo during initialization or through another code path. The JVM resolves that reference when the relevant class is loaded, even if your own source has no direct IMetaInfo call.

Should I jump directly from iText 7 to 9?

Not automatically. Release choice depends on the Java runtime, html2pdf and other add-ons, API changes, and licensing needs. Validate the complete dependency set before moving to a newer major line.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is clearing Maven or Gradle caches enough?

Cache cleanup can repair a corrupted download, but it does not remove duplicate server JARs or change a conflicting resolved version. Inspect the runtime artifact and deployed classpath as well.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.