I am having trouble with getting and applet to work on an HTML page. When I remove the socket connection from the applet class and test the applet on an HTML page the applet displays but when I add the socket connection back in the class file the applet doesn't display and the Java console appears with no stack trace. I'm sure this is a security reason because I'm using socket connections so what I did was create a signed jar file and placed that in the applet tag as so:
<APPLET codebase="classes" archive="captureaudio/AppletTest.jar" code="captureaudio/AppletTest.class" width=350 height=200></APPLET>
But creating this signature has not worked.
Can somebody help me with this?
UPDATED
In response to Andrew Thompson
- No im not prompted to accept digital signed code
- No the applet im currently testing is locally
- Yes the applet is trying to connect back to the server, ther server is running locally
- Im not sure the java console isnt showing me any exceptions.
HOW I CREATED THE SIGNED JAR FILE
The namespace of my Applet is captureaudio.AppletTest class
At cmd prompt, where teh class file is located:
You need to use the keytool.exe here is where i found how to create a jar signature for applets www.xinotes.org/notes/note/434/
jar -cf AppletTest.jar AppletTest.class
- >jarsigner AppletTest.jar MyCert Warning: This jar contains entries whose signer certificate will expire within six months
4.>jarsigner -verify -verbose -certs AppletTest.jar
s k 153 Thu Oct 13 11:28:38 BST 2011 META-INF/MANIFEST.MF
X.509, CN=xxxxx, OU=None, O=None, L=xxxxx, ST=xxxxx, C=GB (myce
rt) [certificate will expire on 10/01/12 20:55]
315 Thu Oct 13 11:28:40 BST 2011 META-INF/MYCERT.SF
1352 Thu Oct 13 11:28:40 BST 2011 META-INF/MYCERT.RSA
0 Thu Oct 13 11:28:10 BST 2011 META-INF/
smk 11015 Thu Oct 13 10:49:08 BST 2011 AppletTest.class
X.509, CN=xxxxxx, OU=None, O=None, L=xxxxxxxx, ST=xxxxx, C=GB (myce
rt) [certificate will expire on 10/01/12 20:55]
s = signature was verified m = entry is listed in manifest k = at least one certificate was found in keystore i = at least one certificate was found in identity scope
jar verified.
JAVA CONSOLE
Java Plug-in 10.0.0.147 Using JRE version 1.7.0-b147 Java HotSpot(TM) Client VM
User home directory = C:\Users\xxxxxxx
c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache
0-5: set trace level to
Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar
UPDATE
Folder locations
web root>
------AppletTest.jar
------classes>
-----------captureaudio>
---------------------AppletTest.class