¿ Que error puede tener este Applet firmado ...?
El Applet solo intenta mostrar el nombre de usuario del sistema.
Código:
/*
* usuarioApplet.java
*
* Created on 17 de enero de 2006, 19:12
*/
/**
*
* @author [email protected]
*/
import java.security.AccessController;
import java.security.PrivilegedAction;
public class usuarioApplet extends javax.swing.JApplet {
/** Initializes the applet usuarioApplet */
public void init() {
AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
{
try
{
// Código del método INIT
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
String usuario = System.getProperty("user.name");
jTextField1.setText(usuario);
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
catch(Exception e)
{
}
return null;
}
});
}
/** This method is called from within the init() method to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
getContentPane().setLayout(null);
jLabel1.setText("Usuario");
getContentPane().add(jLabel1);
jLabel1.setBounds(20, 20, 60, 14);
getContentPane().add(jTextField1);
jTextField1.setBounds(100, 20, 130, 20);
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}
El proceso de firmado lo he realizado :
Código:
2.- Firmamos el Applet :
* empaquetamos todo en un jar ( NetBeans te lo hace y lo ubica en la carpeta dist del proyecto )
* C:\Java\jdk1.5.0_05\bin>keytool -genkey -alias aUsuarioApplet -keypass 123abc -keystore storeUsuarioApplet -storepass abc123
C:\Java\jdk1.5.0_05\bin>keytool -genkey -alias aUsuarioApplet -keypass 123abc -k
eystore storeUsuarioApplet -storepass abc123
┐Cußles son su nombre y su apellido?
[Unknown]: DogDuck
┐Cußl es el nombre de su unidad de organizaci¾n?
[Unknown]: Personal
┐Cußl es el nombre de su organizaci¾n?
[Unknown]: Personal
┐Cußl es el nombre de su ciudad o localidad?
[Unknown]: Las Palmas
┐Cußl es el nombre de su estado o provincia?
[Unknown]: Las Palmas
┐Cußl es el c¾digo de paÝs de dos letras de la unidad?
[Unknown]: es
┐Es correcto CN=DogDuck, OU=Personal, O=Personal, L=Las Palmas, ST=L
as Palmas, C=es?
[no]: y
* C:\Java\jdk1.5.0_05\bin>jarsigner -keystore C:\java\jdk1.5.0_05\bin\storeUsuarioApplet usuario.jar aUsuarioApplet -storepass abc123 -keypass 123abc -signedjar
Enter Passphrase for keystore: abc123
Enter key password for aUsuarioApplet: 123abc
Pero da el error :
Código:
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-4" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-null" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
¿ Alguien sabe el por ... ?