Skip to content

Conversation

@laoLiangLoveProgram
Copy link

Fix: #449

Problem: jdk17, "org.mp4parser.muxer.container.mp4.MovieCreator.build(path)" throw NPE

java.lang.NullPointerException: inStream parameter is null
        at java.base/java.util.Objects.requireNonNull(Objects.java:233)
        at java.base/java.util.Properties.load(Properties.java:407)
        at org.mp4parser.PropertyBoxParserImpl.<init>(PropertyBoxParserImpl.java:52)
        at org.mp4parser.IsoFile.<init>(IsoFile.java:53)
        at org.mp4parser.muxer.container.mp4.MovieCreator.build(MovieCreator.java:54)

And I find in "org/mp4parser/PropertyBoxParserImpl.java:48 " return null

InputStream is = ClassLoader.getSystemResourceAsStream("isoparser2-default.properties"); //return null 

@becta012
Copy link

becta012 commented Feb 2, 2023

I'm using isoparser 1.9.56 in spring boot server application.
And it is deployed as runnable jar.
In jar, I met the same problem "inStream parameter is null" in the same place.

InputStream is = ClassLoader.getSystemResourceAsStream("isoparser2-default.properties"); //return null

p.s) 1.9.41 does not have this problem. And it's code like this

InputStream is = this.getClass().getResourceAsStream("/isoparser2-default.properties");

@becta012
Copy link

becta012 commented Feb 6, 2023

@laoLiangLoveProgram
Hello, IaoLiang
Is there any plan for release this fix?

@laoLiangLoveProgram
Copy link
Author

no. I fix this problem, and build a local version to use. I'm not owner, and has no plan to develop this project.

@becta012
Copy link

becta012 commented Feb 7, 2023

I see and sorry.

keep code style uniform

Co-authored-by: Michal Boroň <michal.boron@seznam.cz>
@pavhofman
Copy link

I hit the same problem when running the isoparser from a webapp in tomcat. Upon reading about difference between ClassLoader.getSystemResourceAsStream() and this.getClass().getResourceAsStream() (as introduced in 6f8270a#diff-5024c2ff4818b0d1b17a5b32745d08f7b4c0dcf23518c96021b5fc8361fc2f12R48 ) I tried adding absolute path to the isoparser-1.9.56.jar in the webapp's WEB-INF/lib dir to --classpath of java running the tomcat - and it worked. As well as did the version 1.9.41 (e.g. before this commit).

Please is there any reason for the above-linked change in the PropertyBoxParserImpl class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MovieCreator.build(file) NullPointerException

4 participants