Running an applet - Blocked by Security - java

Basically, what I am trying to do is run an applet.
I made applet, tested it (offline, from Eclipse), exported .jar file and posted on dropbox.com. Then I made simple hmtl which should run that applet.
However I can't get pass the Java security (keep getting "Application Blocked by Java Security" error), even after adding dropbox to "Exception Site List" in Java Control Panel.
<!DOCTYPE html>
<html>
<head>
<title>
My Title v3.0
</title>
</head>
<body>
<object width="480" height="360" data="MyNumber.jar" type="application/x-java-applet">
<param name="codebase" value="https://www.dropbox.com/s/mz6y145mwdtge7r/MyNumber.jar?dl=0" />
<param name="code" value="mynumber.online.MyNumberOnline />
<param name="width" value="480" />
<param name="height" value="360" />
<param name="archive" value="MyNumber.jar" />
</object>
</body>
</html>
Is there a way to get past this?

You have to sign this applet with a certificate as the dialog says "identified by a certificate".

Related

Integrate/embed java applet to openerp

I need to integrate into my Openerp application a third party developed java applet to sign documents electronicaly. I tried to implement the following solution but it didn't work for me:
https://stackoverflow.com/questions/24204467/applet-java-integration-with-openerp-odoo
I have the following java applet embeded into my xml view:
<openerp>
<data>
<record id="view_firma_form" model="ir.ui.view">
<field name="name">firma.form</field>
<field name="model">x_firma</field>
<field name="priority" eval="8" />
<field name="arch" type="xml">
<form string="Firma" version="7.0">
<sheet>
<![CDATA[
<html>
<body>
<object id="signApplet" width="600" height="400" archive="ini4j-0.5.2-1.0.jar, icepdf-core-4.3.2-1.0.jar, icepdf-viewer-4.3.2-1.0.jar, AgesicFirmaApplet-AgesicFirmaApplet-2.5.jar, bcprov-jdk15-1.46-1.0.jar, commons-codec-1.2-1.0.jar, bcmail-jdk15-1.46-1.0.jar,log4j-1.2.14-1.0.jar,swing-layout-1.0.3-1.0.jar,commons-io-2.1-1.0.jar,bcprov-jdk15-1.46-1.0.jar,MITyCLibAPI-1.0.4-1.0.jar,MITyCLibCert-1.0.4-1.0.jar,MITyCLibXADES-1.0.4-1.0.jar,MITyCLibTSA-1.0.4-1.0.jar,jss-4.2.5-1.2.jar,commons-logging-1.1-1.0.jar, UserAgentUtils-1.2.4-1.0.jar,itextpdf-5.2.0-1.0.jar,bctsp-jdk15-1.46-1.0.jar,xmlsec-1.4.2-ADSI-1.0-1.0.jar">
<param name="type" value="application/x-java-applet;jpi-version=1.5.0"/>
<param name="java_arguments" value="-Xmx128m"/>
<param name="classloader_cache" value="false"/>
<param name="codebase" value="http://server/appletFirmaAgesic">
<param name="code" value="uy.gub.agesic.firma.cliente.applet.SignApplet"/>
</object>
</body>
</html>
]]>
</sheet>
</form>
</field>
</record>
When I try to execute that (it was installed with no problems), it throws the following error:
Uncaught Error: Invalid XML: <form string="Firma" version="7.0"><sheet>
Is there any way to do that or do I have to take another type of implementation.
Thanks

ClassNotFound for AppletLoader when exporting a libGDX applet

I tried following this to export my libGDX game as a Java applet. The guide was a bit confusing so I might have done something wrong here. This is what I did:
My libGDX game, in Eclipse, looks like this:
Game
Game-Android
Game-Desktop
The desktop game works fine.
As the guide says, the desktop project uses the Lwjgl backend.
Then I created a GameApplet.java in Game-Desktop/src/my.package.name containing
package my.package.name;
import com.badlogic.gdx.backends.lwjgl.LwjglApplet;
public class GameApplet extends LwjglApplet
{
private static final long serialVersionUID = 1L;
public GameApplet()
{
super(new Game(), false);
}
}
I created a directory applet in Game containing
gdx.jar
gdx-backend-lwjgl.jar
gdx-backend-lwjgl-natives.jar
gdx-natives.jar
lwjgl_util_applet.jar
I right-clicked Game in Eclipse and exported it as a JAR with the following settings:
Resources to export:
- Game
-- src
-- libs
Export generated class files and resources
The exported JAR (called Applet.jar) was placed in the applet folder.
I created the index.html file containing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>HelloApplet!</title>
</head>
<body>
<div id="applet_container">
<applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar" codebase="." width="640" height="480">
<param name="al_title" value="HelloApplet">
<param name="al_main" value="my.package.name.GameApplet">
<param name="al_bgcolor" value="000000">
<param name="al_fgcolor" value="ffffff">
<param name="al_jars" value="Applet.jar, gdx.jar, gdx-backend-lwjgl.jar">
<param name="al_windows" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar">
<param name="al_linux" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar">
<param name="al_mac" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar">
<param name="al_solaris" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar">
<param name="codebase_lookup" value="false">
<param name="java_arguments" value="-Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false -Xmx800M">
<param name="lwjgl_arguments" value="-Dorg.lwjgl.input.Mouse.allowNegativeMouseCoords=true">
<param name="separate_jvm" value="true">
<param name="codebase_lookup" value="false">
</applet>
</div>
</body>
</html>
I signed the files and uploaded them to my site. On Firefox, OSX, I get a message saying
ClassNotFoundException
org.lwjgl.util.applet.AppletLoader
What did I do wrong?

Iframe over applet flickering

I am using a iFrame to show content over my Applet in my online game.
It work's perfectly in Safari, Chrome, Firefox, Opera etc. But as always not in Internet Explorer on Windows.
When the iframe opens over the applet, the content become to "Flickering"/"Blinking" like the applet is updating a lot, which it doesn't.
What can i do? I am using this:
<applet id="applet" code="main.AvatarClient.class" archive="qqqqqAvatarClient.jar" name="Chat" width="760" height="582" scriptable="true" MAYSCRIPT="true" >
<param name="cache_option" value="YES" / >
<param name="localization" value="locDK/" />
<param name="userName" value="<?=$user?>" />
<param name="password" value="<?=$pass?>" />
And the overlay where iframe is:
<div class="add-block qw no-rounded-borders" id="wo" style="position:absolute;left:756px;margin-top:-30px;z-index:99999999999999999999999999999999999999999999999999999999999999;height:380px;width:495px;display:none;">
<iframe id="my" src="loading.php" frameborder="0" height="380" width="496" scrolling="no" style="z-index:9999999999999999999999999999999999;position:absolute"></iframe>
</div>

Can't load Java applet from another directory in HTML

When i try to load an applet with :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="Sokoban" />
</object>
when the html file is in the same directory as the applet it loads as expected.
But when the applet is in an another directory the following code won't work :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="sokoban/Sokoban" />
</object>
(sokoban is the directory the applet is in, Sokoban is the applet => Sokoban.class)
Use deployJava.js to deploy the applet (linked from the applet info. page).
Use the codebase attribute to point to the sokoban directory.
Since the code attribute needs to be the fully qualified class name, return it to just Sokoban

launching java applet

As far as I can see from the documentation, <applet> is deprecated, and the <object> tag is the preferred method for launching an applet now. But I can't find decent documentation, or even a tutorial on how to use the object tag to launch an applet.
I did see the following question which shows how in javascript but I would prefer to use a tag
launch applet from web page
I need to know how to specify the java engine, how to specify a jar file, where it's stored, and how to specify the class that is executed.
Here's what i have at the moment (but does not work)
<object
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="800" height="600" data="pi.jar">
<param name="code" value="PiLauncher.class"/>
</object>
the claim was in the Oracle 1.5 docs that this classid specifies "the current java engine" but this is completely opaque to me. They also had examples requesting a specific version.
Even if this is true, how do I:
specify the jar file
specify the class (is this correct above)
specify the directory where the code is (is codebase still valid?)
First of all, the syntax is not the same for firefox and IE:
Firefox:
<object classid="clsid:CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA" id="appletId" name="appletName" width="400" height="300">
<param name="code" value="com.myPackage.Applet" />
<param name="codebase" value="../resources/applet/"/>
<param name="ARCHIVE" value="myApplet.jar" />
<param name="cache_archive" value="myApplet.jar" />
<param name="type" value="application/x-java-applet" />
<param name="cache_option" value="plugin" />
<param name="mayscript" value="true" />
// you can set optional parameters here
</object>
IE:
<object width="400" height="300" classid="java:com.myPackage.Applet.class" codebase="../resources/applet/" name="appletName" id="appletId">
<param name="archive" value="myApplet.jar" />
<param name="type" value="application/x-java-applet" />
<param name="cache_option" value="plugin" />
<param name="mayscript" value="true" />
// you can set optional parameters here
</object>
Here is a good link: http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/using_tags.html#object

Categories

Resources