problem with class.getResourcesAsStream()

bapt bapt@binouze.net
Thu Apr 3 15:49:00 GMT 2003


Hi, 
I'm currently making a java program with gcj and swt.
I'm making a jar and them compiling the jar to native code using gcj
everything is ok til this point (thanks for your great stuff :))
but when I execute the binary file, if I have the original jar file in
the classpath in order to make it run.
If not I have the following error message.

------
Exception in thread "main" java.lang.IllegalArgumentException: Argument
cannot be null
   at 0x405e1290: java.lang.Throwable.Throwable(java.lang.String)
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x405d1ca6: java.lang.Exception.Exception(java.lang.String)
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x405d6386:
java.lang.RuntimeException.RuntimeException(java.lang.String)
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x405d2846:
java.lang.IllegalArgumentException.IllegalArgumentException(java.lang.String) (/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x401b25fd: org.eclipse.swt.SWT.error(int, java.lang.Throwable)
(./libswt.so)
   at 0x401b2517: org.eclipse.swt.SWT.error(int) (./libswt.so)
   at 0x4012612e:
org.eclipse.swt.graphics.ImageLoader.load(java.io.InputStream)
(./libswt.so)
   at 0x4010fa22:
org.eclipse.swt.graphics.ImageData.ImageData(java.io.InputStream)
(./libswt.so)
   at 0x4010c08f:
org.eclipse.swt.graphics.Image.Image(org.eclipse.swt.graphics.Device,
java.io.InputStream) (./libswt.so)
   at 0x0804e20c:
org::ece::macadamexplorateur::Login::Login[in-charge]() (??:0)
   at 0x0804f4ed:
org::ece::macadamexplorateur::Login::main(JArray<java::lang::String*>*)
(??:0)
   at 0x405b3c47: gnu.gcj.runtime.FirstThread.call_main()
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x40635298: gnu.gcj.runtime.FirstThread.run()
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x405c2fd9: _Jv_ThreadRun(java.lang.Thread)
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x4058bbb9: _Jv_RunMain(java.lang.Class, byte const, int, byte
const, boolean) (/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x4058bc25: JvRunMain
(/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libgcj.so.3)
   at 0x0804ba9c: main (??:0)
   at 0x409c2dc4: __libc_start_main (/lib/libc.so.6)
   at 0x0804b9d1: _start (??:0)

------

It seems to come from the loading of the Images, that I do with
myclass.class.getResourcesAsStream("myImages.png");
so I think there a bug in that method, or perhaps you've choosen to make
it work in that way???

don't know if you need more informations??
I thought the images was compiled within the binary file, if it's not
the case, sorry for wasting your time...

---
Bapt <bapt@binouze.net>




More information about the Java mailing list