[FIXED] Jre6u19 security popup

Started by Mickelukas, April 03, 2010, 10:44:03

Previous topic - Next topic

kappa

hmm, odd, can you try if http://www.lwjgl.org/applet/ works for you.

Bit difficult to tell further without looking at the applet, have you got it uploaded somewhere?

also are you still on JRE6u19? or have you updated to JRE6u21?

Mickelukas

This is insanely weird but I guess you know why :)

I solved it and figured out what it was. I had a parameter:
    <param name="al_logo" value="pictures/appletlogo.png">

If I use the default lwjgl picture (instead of my own) it works great and no popup appears.

Any idea how to solve it? It's nice to have my own logo there because I made my own loading screen look exactly the same so it seems like you're just loading one component.

Mike

kappa

are your logo's insides jars? try put them outside the jar if so.

Mickelukas

The logo is outside the jar. It doesn't matter if I point it to "pictures/appletlogo.png" or "mylogo.png", I still get the warning.

kappa

hmm, I can reproduce this locally, loading an unsigned image causes java to throw a mixed jar warning.

* javalwjgl shakes fist at Oracle.

This means the classloader is blocking any resources that aren't signed.

guess you'll just have to work with the LWJGL logo's or sign your own jars for now.

I'll see if can find a solution to this for LWJGL 2.6.

bobjob

public Image getImage(String s) {
	try {
		URL url = new URL(getCodeBase(), s);
		if (url == null) {
			System.out.println("Image not in jar");
			url = getClass().getResource("/"+s);
		}
		Image image = null;
		try {
			image =  ImageIO.read(url);
		} catch (Exception e) {
			url = getClass().getResource("/"+s);
			image = super.getImage(url);
		}
		
		// wait for image to load
		MediaTracker tracker = new MediaTracker(this);
	        tracker.addImage(image, 0);
	        tracker.waitForAll();
	        
	        return image;
	} catch (Exception e) {
		e.printStackTrace();
		/* */
	}
	return null;
}

this is a fix, except that it looks outside the jar first. Im sure there is a better solution as this is rushed, but this works at least.

1 idea is an optional boolean tag in the paramaters for "custom image" otherwise look in jar.

yet im sure there is a better way
getClass().getResource("/"+s);
was causing the popup

bobjob

I think getImage should remove:
getClass().getResource("/"+s);

and should only be called if:
    <param name="al_logo" value="appletlogo.png">
or
    <param name="al_progressbar" value="appletprogress.gif">
is used.

otherwise the line:
getClass().getResource("/"+s);
should be called.


kappa

ah awesome stuff bobjob, looks like you found the cause of the problem.

will test it out tonight.

Mickelukas


kappa

ok great job everyone, especially bobjob.

oh and thx Mickelukas for finding yet again another bug :)

This problem is now fixed and a patch has been applied to the nightly builds of lwjgl.

Hopefully a LWJGL 2.6 release shouldn't be too far off, since OpenGL 4.1 support was added recently

bobjob

your welcome, always a good feeling getting a bug fixed.

Mickelukas

Just a quick check regarding the fix.

I'm using the 2.6 files that are used by the applet example and I added the line:
<param name="al_logo" value="pictures/appletlogo.png">

(where picture is a folder on the webserver relative to where the jar file is) and I still get the security window. Is it because the fix isn't in the applet example or because I'm using the parameter wrongly?

Mike

kappa

Can you try with the LWJGL nightly build #1042+, there was some tweaking with this area of code recently so might be fixed (for real this time :)).

Mickelukas