Internet explorer jre1.5.0 freezing?

Hi,

I am facing some strange problem, maybe the answer is obvious to experts but to me it is not clear at all.

I have developped some jogl application (using a Jpanel and a Japplet)

I have correctly placed the two dll of jogl in the bin/ folder or jre and the jar in the lib/ext/ folder.

It works fine with the appletviewer from j2sdk and it also works fine when i disply the web page including the applet on my computer.

The problem is when i put the files on some server and load the page from internet explorer it seems that both internet explorer and jre1.5.0 freezes.

http://ece.fsa.ucl.ac.be/fremacle/GLtest.htm
is the page online that freezes, when i open it locally it works.

If someone has an idea about the reason of this problem, it would be very nice.

Is there a Java console in IE? Are there any exceptions reported in it? If there isn’t a Java console, could you try with Mozilla?

There is a java console but i can not access it as both the JRE icon in the system tray and from IE menu is frozen at that time.

I noticed something even more strange, if i click on the link in my post it worked once but if i join the address from the address bar it freezes… and now freezes from click too :o

Maybe it’s a fireWall related problem?

[quote]There is a java console but i can not access it as both the JRE icon in the system tray and from IE menu is frozen at that time.
[/quote]
Can you try it with Mozilla and open up the Java console before you launch the applet? If there are any exceptions, could you please post a stack trace?

I tried it with mozilla, same behaviour, i launched the console before the applet, but the console display no exception and is also frozen…

I am wondering if it is related to html tags, maybe needs some meta-data to give to jre or something else am i not aware of?

By the way, if someone try the link in the previous post, does it also freezes?

Hi,

I checked it with my IE 6.0. The java console freezes without displaying a message. The IE shows Applet loaded, but the screen stays white.

ciao torsten

Under linux same problem the compiled code works locally into mozilla but if i try to load the compiled code form online that it freezes…

Completely stuck

I’m guessing it’s related to the installation of a SecurityManager. I thought the appletviewer installed one but maybe not. Can you run your applet locally with “appletviewer -J-Djava.security.manager applet.html”? Does the behavior change?

No changes, works well,
But if i use it to load the online page then i have an trace !
I got an null pointer arising from my texture loading,
it is an IO exception

try{buff=ImageIO.read(theurl[i]);}catch(IOException ioex){System.out.println("Oups probleme");}

that provokes the trace

java.lang.NullPointerException
      at JoGLtest.loadTexture(JoGLtest.java:402)
      at JoGLtest.init(JoGLtest.java:207)
      at net.java.games.jogl.impl.GLDrawableHelper.init(GLDrawableHelper.java:68)
      at net.java.games.jogl.GLCanvas$InitAction.run(GLCanvas.java:214)
      at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:162)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:250)
      at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112)
      at java.awt.Component.setBounds(Component.java:1664)
      at java.awt.Component.resize(Component.java:1601)
      at java.awt.Component.setSize(Component.java:1593)
      at java.awt.FlowLayout.layoutContainer(FlowLayout.java:438)
      at java.awt.Container.layout(Container.java:1020)
      at java.awt.Container.doLayout(Container.java:1010)
      at java.awt.Container.validateTree(Container.java:1092)
      at java.awt.Container.validateTree(Container.java:1099)
      at java.awt.Container.validateTree(Container.java:1099)
      at java.awt.Container.validateTree(Container.java:1099)
      at java.awt.Container.validateTree(Container.java:1099)
      at java.awt.Container.validateTree(Container.java:1099)
      at java.awt.Container.validate(Container.java:1067)
      at sun.applet.AppletPanel.run(AppletPanel.java:365)
      at java.lang.Thread.run(Thread.java:534)

Now that i know where the problem comes from i can tackle it.

Thanks :smiley:

Probably unrelated to your problem, but there is a bug in ImageIO. To work around it you always want to give ImageIO.read a BufferedInputStream. Your code should look like this:
try{buff=new BufferedInputStream(ImageIO.read(theurl[i]).openStream());}catch(IOException ioex){System.out.println(“Oups probleme”);}

I am loading my texture using the following function, do you think it might be an issue?

public void loadTexture(int i)
    {
      BufferedImage buff=null;
      try{buff=ImageIO.read(theurl[i]);}catch(IOException ioex){System.out.println(ioex.toString());}
      Raster r = buff.getRaster();
            int[] img = null;
            img = r.getPixels(0, 0, buff.getWidth(), buff.getHeight(), img);

            texture = ByteBuffer.allocateDirect(buff.getWidth() * buff.getHeight() * 3);
            for (int y = 0; y < buff.getHeight(); y++)
                for (int x = 0; x < buff.getWidth(); x++) {
                    texture.put((byte) img[(y * buff.getWidth() + x) * 3]);
                    texture.put((byte) img[(y * buff.getWidth() + x) * 3 + 1]);
                    texture.put((byte) img[(y * buff.getWidth() + x) * 3 + 2]);
                }
            tWidth = buff.getWidth();
            tHeight = buff.getHeight();
    }

the exception when i print it out with the toString() method is the following.

javax.imageio.IIOException: Invalid JPEG file structure: two SOI markers

I have checked that my url are correct but i am not familiar with the IO images. If someone could give me a hint it would be kind :wink:

Yes I do think it’s the ImageIO bug. In particular if the image is stored in a jar. A gave you the workaround in the previous post. Have you tried it?

Also have a look at ImageIO / Java Web Start bug: Workaround

Hi again,

i guess in your workaround you meant the following code

try{buff=ImageIO.read(new BufferedInputStream(theurl[i].openStream()) );}catch(IOException ioex){System.out.println("Oups probleme");} 

I tried but it does not changes the problem,
I will have a see about the second workaround.
By the way i guess that there is no problem if my jpg images has been saved in paint.

By the way simple questions,

Does the Texture and Texture loader Class has given good results when used in applet online and not local?

I am thinking to use them to try if it solve my problem.

Is there a image format which is safer than other for texture?

Is there some image format slower than other (bmp i guess)?

What is a good compromise?

Well i am completely stuck with it,

I try both those workaround and even try using the textureloader and texture classes shown in another topic.

Unfortunately i still have the IOexception from reading my jpeg files when loading them and it freezes my applet when being online.

I Really do not know what to do to solve this problem.

HELP ???

The state is quite the same i checked it many time.
I am loading the textures using this method:

public void loadTexture(int i)
{
      BufferedImage buff=null;
  int[] img = null;
      try{
      buff=ImageIO.read(new BufferedInputStream(this.getClass().getResourceAsStream(theurl[i].toString())));
      }catch(IOException ioex){System.out.println(ioex.toString());}
      Raster r = buff.getRaster();
  img = r.getPixels(0, 0, buff.getWidth(), buff.getHeight(), img);
  texture = ByteBuffer.allocateDirect(buff.getWidth() * buff.getHeight() * 3);
  for (int y = 0; y < buff.getHeight(); y++)
    for (int x = 0; x < buff.getWidth(); x++)
                  {
      texture.put((byte) img[(y * buff.getWidth() + x) * 3]);
      texture.put((byte) img[(y * buff.getWidth() + x) * 3 + 1]);
      texture.put((byte) img[(y * buff.getWidth() + x) * 3 + 2]);
      }
   tWidth = buff.getWidth();
   tHeight = buff.getHeight();
}

when using the appletviewer in the command line from a machine that is on the same network as the server where the applet is it works.

If i use it from a machine outside the network i got this error trace:

javax.imageio.IIOException: Invalid JPEG file structure: two SOI markers  
 java.lang.NullPointerException 
 at JoGLtest.loadTexture(JoGLtest.java:402) 
 at JoGLtest.init(JoGLtest.java:207) 
 at net.java.games.jogl.impl.GLDrawableHelper.init(GLDrawableHelper.java:68)  
 at net.java.games.jogl.GLCanvas$InitAction.run(GLCanvas.java:214) 
 at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLC ontext.java:162) 
 at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(Wi ndowsOnscreenGLContext.java:110) 
 at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:250) 
 at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112) 
 at java.awt.Component.setBounds(Component.java:1664) 
 at java.awt.Component.resize(Component.java:1601) 
 at java.awt.Component.setSize(Component.java:1593) 
 at java.awt.FlowLayout.layoutContainer(FlowLayout.java:438) 
 at java.awt.Container.layout(Container.java:1020) 
 at java.awt.Container.doLayout(Container.java:1010) 
 at java.awt.Container.validateTree(Container.java:1092) 
 at java.awt.Container.validateTree(Container.java:1099) 
 at java.awt.Container.validateTree(Container.java:1099) 
 at java.awt.Container.validateTree(Container.java:1099) 
 at java.awt.Container.validateTree(Container.java:1099) 
 at java.awt.Container.validateTree(Container.java:1099) 
 at java.awt.Container.validate(Container.java:1067) 
 at sun.applet.AppletPanel.run(AppletPanel.java:365) 
 at java.lang.Thread.run(Thread.java:534) 

If i use png images instead the error message will be “wrong PNG file”.

When using Internet explorer i have the following behaviour:

The first time i load the page from one computer it works, if i try another time it freezes even if i clean the cached files of JRE.

With Mozilla it freezes directly.

In conclusion it seems it is related to the imageIO or to the argument it is receiving. I am getting crazy trying making this works and i really need it works online. :-[

It would be wonderful if someone can take a look to what could be the source of this problem.

I have reproduced this.

This happened on a machine with Windows XP, and an ATI video card. The only thing different was that I ran it from WebStart.

It appears that the Java application started, and Swing starts to draw the UI, but when the code gets to the point of creating the GLCanvas it freezes. I must kill it from the Task Manager to end the process.

When the webstart session began the machine only had 1.4.1, and was updated to 1.5.0_1 which it then ran the application after updated.

The problem went away after the Java sessions were all closed (i.e. ending all Java programs), and all IE windows were closed. The machine was also rebooted, and after this the freezing stopped.

I would like to file this as a bug, but need better details on how to reproduce this. It’s not happening on other machines, and I don’t want to waste JOGL developers time looking into reproducing this if I can’t get good steps on how to do it.

Anyone else seen this happen, and know why it’s happening?

The three machine i used have respectively

Nvidia GeForce4 420Go (toshiba)
Geforece 2 MX 400 64MB
nVidia 64MB Geforce FX Go5700

If you want to reproduce it you can just try to laod my applet from

www.ccp4.ac.uk/fr45/jogl/GLtest.htm