sannies / isoviewer

GUI application to have closer look ISO 14496-12 and other MP4 files.
Apache License 2.0
232 stars 55 forks source link

Input stream must not be null #6

Closed laikaseung closed 8 years ago

laikaseung commented 9 years ago

Hi Mr.Sebastian Annies,

I'm trying to build(export as Runnable JAR file) isoviewer but ran into a problem. When I "Run" it on Eclipse, it works perfectly but when I export it as runnable JAR, it shows below crash.

C:\Users\user\Desktop>java -jar isoViewer001.jar
Exception in Application start method
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Input stream must not be null
        at javafx.scene.image.Image.validateInputStream(Unknown Source)
        at javafx.scene.image.Image.<init>(Unknown Source)
        at com.github.sannies.isoviewer.IsoViewerFx.start(IsoViewerFx.java:112)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$null$174(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(Unknown Source)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$149(Unknown Source)
        ... 1 more

As far as I concern, it is because of below line, but the exported JAR file clearly contains the icon.png file.

stage.getIcons().add(new Image(this.getClass().getResourceAsStream("/icon.png")));

I believe this could be not an issue but my mistake. Could you please tell me what I'm doing wrong?

Thank you, laikaseung

sannies commented 8 years ago

Hi, I guess you fixed somehow, right? I was never able to reproduce. Best Regards, Sebastian

Joanne86 commented 6 years ago

tengo el mismo problema