Issue
When using tika-app.jar with Solr Slim via the -Dsolr.sharedLib parameter, the following error may occur during Solr startup:
java.lang.NoClassDefFoundError: jakarta/activation/DataSourceThis typically occurs even though the jakarta.activation.DataSource class appears to be present within the Tika JAR.
Diagnosis
This issue arises when the tika-app.jar is used with the Solr Slim distribution to enable content extraction. While tika-app.jar includes the shaded jakarta.activation classes, Solr may not load these correctly due to its classloader behavior, especially with fat JARs and nested dependencies.
Attempts to resolve this by explicitly adding jakarta.activation-api.jar to either the shared lib folder or the WEB-INF/lib directory typically do not work reliably, and the runtime error persists.
This error indicates that the Solr runtime classloader cannot resolve jakarta.activation.DataSource due to insufficient or conflicting classpath configuration.
Environment
Fusion or standalone Solr deployment.
Cause
The Solr Slim distribution excludes the extraction module and related dependencies by design. Simply adding tika-app.jar to the shared lib path does not provide full integration due to:
Missing supporting module classes
Classloader limitations in handling shaded dependencies
Potential classpath conflicts when jars are redundantly added to different locations
Resolution
Option 1: Use standard Solr with extraction module enabled
Switch from Solr Slim to the standard Solr distribution, and enable the extraction module properly. Follow these steps:
Use the standard Solr distribution that includes all modules.
Enable the extraction module using the
SOLR_MODULESenvironment variable:export SOLR_MODULES=extractionStart Solr normally. The extraction-related endpoints (e.g.,
/update/extract) will now be available and functional.
This approach ensures all required classes and dependencies are included and avoids classloader conflicts.
Option 2: Manually enable the extraction module in Solr Slim
If remaining on Solr Slim is necessary, you must do the following:
Copy the entire
extractionmodule directory (/opt/solr/modules/extraction) from the standard Solr distribution into the Slim deployment.Configure the
SOLR_MODULESenvironment variable to enable the extraction module:export SOLR_MODULES=extraction
Note: Do not rely on tika-app.jar alone. It is not a substitute for the complete extraction module, and will result in runtime errors or incomplete functionality.
Additional recommendations
Avoid adding JARs to
WEB-INF/libdirectly, as this is deprecated in newer Solr versions.Minimize classpath complexity by ensuring there are no duplicate or conflicting JARs in shared lib, modules, or config directories.
If using the shared lib path (
-Dsolr.sharedLib), ensure only required libraries are included, and avoid fat JARs liketika-app.jarwhich include shaded dependencies.
Summary
The NoClassDefFoundError for jakarta.activation.DataSource indicates that Solr is unable to locate the shaded Jakarta Activation API from tika-app.jar due to classloader isolation. This is a common issue when trying to manually extend Solr Slim’s functionality without using the supported modular approach.
The recommended solution is to either use the standard Solr distribution with the extraction module enabled, or manually copy and enable the extraction module in Slim using SOLR_MODULES.
For best stability and compatibility, prefer using Solr Standard when content extraction is required.