Class Loader Resolving Missing Classes via Repository Lookup

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current systems face issues with classloading failures due to incorrect class locations in the classpath, leading to ClassNotFoundException errors, which can be time-consuming to resolve and result in application termination.

Innovation Solution

An improved class loader that automatically looks up alternative locations for missing classes using repository information and updates the classpath to prevent future errors, ensuring uninterrupted application execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the JVM uses the classpath to locate classes, then the classloading process is simple and direct, but the system fails when class locations are incorrect, causing application termination

Engineering Contradiction:
Improveclassloading success rateVSAvoidclasspath configuration complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent introduces a repository as an intermediary between the classpath and actual class locations. The repository stores mappings between class names and their actual file system locations, allowing the classloader to resolve classes even when classpath entries are incorrect or incomplete. This mediator layer decouples the classpath configuration from actual class locations, improving reliability without requiring complex configuration management.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary population of the repository with class location information before classloading occurs. By pre-populating the repository with correct class locations (obtained through various methods such as scanning the classpath or using metadata), the system prepares the alternative location information in advance, so that when classloading is needed, the classloader can quickly consult the repository for correct locations without complex runtime configuration resolution.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If the system terminates the application on ClassNotFoundException, then it ensures proper error handling, but it causes significant downtime and requires manual intervention to correct

Engineering Contradiction:
Improveerror handling correctnessVSAvoidapplication downtime
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The classloader performs self-service by automatically consulting the repository to resolve class locations when the classpath fails. Instead of immediately terminating on ClassNotFoundException, the classloader autonomously checks the repository for alternative locations and attempts to load the class from there. This self-service mechanism eliminates the need for manual intervention in many cases and reduces application downtime significantly.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The repository acts as a cushion against classpath errors by having alternative location information prepared in advance. When classpath-based classloading fails, the pre-populated repository provides a safety net that can supply correct class locations, cushioning the system against the harmful effect of incorrect classpath configuration and preventing application termination.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

3Speed

If the classloader checks only the classpath, then the lookup process is fast and simple, but it cannot find classes located at alternative locations

Engineering Contradiction:
Improveclasslookup speedVSAvoidclass location flexibility
Core Design Contradiction:
SpeedVSAdaptability or versatility

Solution Approach 1:

The classloading process is segmented into two distinct phases: first, attempt fast classpath-based lookup; second, if that fails, consult the repository for alternative locations. This segmentation allows the system to maintain high speed for the common case (correct classpath) while providing flexibility for the error case (incorrect classpath) without significantly impacting overall performance. The repository consultation only occurs when needed.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The repository serves as an intermediary layer that transparently handles the complexity of alternative class locations. The classloader interacts with the repository through a simple interface (lookup by class name), maintaining speed, while the repository handles the complex task of resolving alternative locations, providing adaptability. This intermediary approach allows both fast lookup and flexible location support.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9841982B2Locating import class files at alternate locations than specified in classpath information
Publication Date: 2017.12.12 RED HAT INC
  • US9841982B2 patent drawing
  • US9841982B2 patent drawing
  • US9841982B2 patent drawing

AI summary

An automatic runtime dependency lookup method may load a class, while executing a computer application program. A class loader determines if the class is found at a first location specified by classpath information. If the class is not found at the first location, the class loader automatically reads repository information to determine an alternate location for the class and locates the class at the alternate location.