mp4parser icon indicating copy to clipboard operation
mp4parser copied to clipboard

Removed usage of System class Loader

Open Julius-Babies opened this issue 10 months ago • 0 comments

Prologue

I was tasked with creating an endpoint in a Java backend project that concatenates multiple video files and returns the output. However, I encountered a NullPointerException at runtime when using the MovieBuilder class. This issue stemmed from the input stream being null, which was caused by calling the system class loader in a web container (as discussed in this Stack Overflow thread).

About this Pull Request

This pull request addresses the issue by replacing the usage of the system class loader with the regular class loader, similar to the approach taken a few lines further down in the code. This change has been tested and works as expected both in our web container and in a local Java project environment.

Changes Made

  • Replaced instances of the system class loader with the regular class loader in the PropertyBoxParserImpl class.
  • Verified functionality in both the web container and local environments to ensure compatibility.

Testing

  • Conducted unit tests to confirm that the video concatenation functionality works without throwing a NullPointerException.
  • Tested in both local and web container environments to ensure consistent behavior.

Julius-Babies avatar Feb 26 '25 10:02 Julius-Babies