Article - CS439388
ThingWorx Java Extension fails with error 'A Java class definition was not found at runtime' (NoClassDefFoundError) after updating Tomcat to 9.0.97 or later
Modified: 12-May-2025
Applies To
- ThingWorx Platform 9.4
- Tomcat 9: 9.0.97 to 9.0.102
- Tomcat 11: 11.0.0 to 11.0.5
Description
- No Class Def found error occurs when trying to load JARs from extensions
- Error message in ApplicationLog:
-
[L: ERROR] [O: c.t.c.p.ReflectionProcessor] ... Cause(<CLASS_NAME>), Reason(A Java class definition was not found at runtime.), Possible Resolutions([1]=Add the Jar file that contains the missing class in your Extension packaging zip., [2]=Add the Jar file that contains the missing class in your Extension manifest file as a Jar Resource.) - ThingWorx dynamically loads extensions (JARs) at runtime using a custom URLClassLoader
- Tomcat 9.0.97 introduces an LRU cache (
notFoundClassResourceCacheSize) for classes that were searched but not found - Before the extension is dynamically loaded, Tomcat may have already tried to find the class
- Since the JAR wasn’t available at that time, Tomcat caches this class as “not found”
- Even after dynamically adding the JAR, Tomcat does not attempt to find the class again and throws NoClassDefFoundError, assuming the class is still missing
This is a printer-friendly version of Article 439388 and may be out of date. For the latest version click CS439388