Problems with TextureLoader

I get the following errors when trying to view an applet from a webserver:

com.sun.j3d.utils.image.ImageException: javax.imageio.IIOException: Can't read input file!

at com.sun.j3d.utils.image.TextureLoader$1.run(TextureLoader.java:277)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.j3d.utils.image.TextureLoader.<init>(TextureLoader.java:270)

at com.sun.j3d.utils.image.TextureLoader.<init>(TextureLoader.java:228)

at BudriaPanel.createSceneGraph(BudriaPanel.java:241)

at BudriaPanel.<init>(BudriaPanel.java:152)

at BudriaOnlineApplet.makeGUI(BudriaOnlineApplet.java:69)

at BudriaOnlineApplet.init(BudriaOnlineApplet.java:42)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

These errors do not come up when viewing it from Firefox on my home computer, but will come up when I try to use Internet Explorer.

Heres the code im using with TextureLoader in it.

Appearance houseApp1 =new Appearance();

Texture houseTex1 =new TextureLoader("wood_panel.gif",this).getTexture();

houseApp1.setTexture(houseTex1);

TextureAttributes houseTexAttr1 =new TextureAttributes();

Transform3D houseScale1 =new Transform3D();

houseScale1.set(4.0);

houseTexAttr1.setTextureTransform(houseScale1);

houseApp1.setTextureAttributes(houseTexAttr1);

Heres a link to the site which contains the applet http://budriabattle.com/bo002/

Also, heres a copy of the same program with the TextureLoader code removed (no textures are visable)

http://budriabattle.com/bo001/

any help would be greatly appreciated.

Message was edited by:

malachi_1616

[1986 byte] By [malachi_1616a] at [2007-10-2 21:47:45]
# 1

I beleive your issue here has more to do with restrictions opening files in applets than it has to do with Java 3D. If you post in the Java Programming forum, you may get a bettter response:

http://forum.java.sun.com/forum.jspa?forumID=31

At any rate, I think this probably has to do with the different virtual machines used by each web browser, and the security restrictions applied to each.

What directory is your applet, or jar file, located in, and what directory is your image loaded in?

- Adam

guitar_man_Fa at 2007-7-14 1:03:26 > top of Java-index,Security,Cryptography...
# 2
Thanks for the reply. I posted a similar question in another forum as well. i just dont understand why it would work perfect on my own computer, but over the net, nothing. All the files are in the same directory.
malachi_1616a at 2007-7-14 1:03:26 > top of Java-index,Security,Cryptography...
# 3

are you sure that your server is configured properly? perhaps you were loading those texture files locally, rather than retreiving them from the server, when you ran it on your home machine.

also, don't forget that applets have a security restriction where the only files you have access to are those that are located on the server from which the applet was downloaded, and not on the local machine (unless the two computers are in fact one and the same).

- Adam

guitar_man_Fa at 2007-7-14 1:03:26 > top of Java-index,Security,Cryptography...
# 4

Im not sure I follow exactly. All of the files for the applet, the graphics, the class files and everything are in the same directory on the server. Some graphics will load, but not the ones that I use TextureLoader to retrieve. I thought it might be a problem with server permissions so I spent an hour on the phone with my server people. Its a windows based server, so there are no permissions he said and it should work like it is. He couldnt tell me why.

malachi_1616a at 2007-7-14 1:03:26 > top of Java-index,Security,Cryptography...
# 5
I got the texture loader problem solved, thanks a bunch for your help.
malachi_1616a at 2007-7-14 1:03:26 > top of Java-index,Security,Cryptography...