Applet in IE

I am trying to create a simple applet and am having trouble getting it to work with the MS VM. I tried creating a simple applet that doesn't do anything but that doesn't work either. I am getting the following error in the console:
Error loading class: test2
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: test2
     at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
     at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
     at com/ms/applet/AppletPanel.securedClassLoad (AppletPanel.java)
     at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
     at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
     at com/ms/applet/AppletPanel.run (AppletPanel.java)
     at java/lang/Thread.run (Thread.java)
Here is the class...
import java.applet.*;
public class test2 extends Applet {
public void init()
System.out.println("loaded");
Any ideas?

Here is the HTML file:
<HTML>
<body>
<APPLET CODE="test2.class" WIDTH=320 HEIGHT=80>
</APPLET>
</body>
</HTML>
here is the dir structure.
/java/test.html
/java/test2.class
Oh yeah, I've gotten this to work with the Sun Plugin, but I want to ensure compatibility with all browsers without requiring a software install.
TIA

Similar Messages

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

  • Open web pages from an applet

    I'm developing an applet that has to open some web pages.
    The only way I know is to use the method showDocument that
    needs and URL. So, how to pass parameters to the web page?
    I don't want to put them in the URL: everyone can see
    "secret data"!
    Help me, please.

    Take a look at this example that uses a JEditor pane to hold the HTML page.
    //Create a new JEditor Pane
    jep = new JEditorPane( );
    //Ensure the pane is not editable
    jep.setEditable(false);  
    //Use this to get local HTML file
    URL fileURL = this.getClass().getResource("Manual/Manual.htm");
    //add the html page to the JEditorPane
    jep.setPage(fileURL);Ok the core line of code here is this.
    URL fileURL = this.getClass().getResource("Manual/Manual.htm");The standard method for accessing a html file via a URL is thus. As you can see its very similar.
    URL fileURL = new URL("http://www.comp.glam.ac.uk/pages/staff/asscott/progranimate/docs/Manual/Manual.htm");this.getClass().getResourse() will return the file location of the class you are working with.
    By doing the following you can access manual.html in a folder called Manual that sits in the same file location as the class file you are using.
    URL fileURL = this.getClass().getResource("Manual/Manual.htm");I hope this helps.
    Andrew.

  • Unable to load database driver from my applet's jar file

    I'm trying to set up an applet that will talk to a MySQL database. I have no problem connecting to the database as I'm developing the code ("un-jarred"), but when I create a jar file of my code to test through a web browser, I cannot connect to the database due to the usual ClassNotFoundException. I have included mysql-connector-java-3.1.12-bin.jar (the current driver) in the jar, but I don't know if I'm supposed to supply some info through an attribute to the applet tag to let it know that the jar contains the driver it needs or if I have to call the driver differently in my code.
    Any help is appreciated, thanks.

    The simplest approach is always the best. :)Abso-lutely.
    Awesome, that worked perfectly. I Included the extra
    jar file in the applet tag and now my applet makes
    some sweet lovin' to the database.And you have succeeded where thousands have failed. Congratulations.

  • Applet java file not refreshing in browser

    I have an applet that I am updating and I am not seeing the corresponding update when I open the web page. I can manually download the java class file and look inside it and it definitely is the updated file. I have deleted the browser history. (I am running tests with Firefox 3, IE7, and Safari 4 public beta). Is there something else I need to do to make sure the browser pulls in the latest version of the class file referenced in the html?
    Here is the code:
    <HTML>
    <HEAD>
       <TITLE>A Simple Program</TITLE>
    </HEAD>
    <BODY>
       <CENTER>
          <APPLET CODE="SendRequest.class" WIDTH="500" HEIGHT="150">
          </APPLET>
       </CENTER>
    </BODY>
    </HTML>The applet refers to a hard coded URL to read through a urlconnection. It is always reading a file and showing content, but it is not showing the right file. If I change the name of the referenced file in the java program, it looks like the browser has cached the referred file, rather than throwing and error and saying the file doesn't exist.
    Here is the java
    import java.applet.*;
    import java.awt.*;
    import java.net.URLConnection;
    import java.net.URL;
    import org.w3c.dom.Document;
    import java.lang.String;
    import java.io.*;
    public class SendRequest extends Applet {
        @Override
        public void paint(Graphics g) {
            g.drawRect(0, 0, 499, 149);
            g.drawString(getResponseText(), 5, 70);
        public String getResponseText() {
            try {
                URL url = new URL("http://myserver.com/stats/logs/ex20090603000001-72.167.131.217.log");
                URLConnection urlconn = url.openConnection();
                BufferedReader in = new BufferedReader(
                                    new InputStreamReader(
                                    urlconn.getInputStream()));
                String inputLine;
                String htmlFile = "";
                try {
                    while ((inputLine = in.readLine()) != null)
                        htmlFile += inputLine;
                    in.close();
                    return htmlFile;
                } catch (Exception e) {
                    return "Can't get the string.";
            } catch (Exception e) {
                return "Problem accessing the response text.";
    }Any help would be appreciated. I heard that some files may cache more persistently than others, but I don't fully understand the details.
    Thanks,
    Jim

    Check this [document loader example|http://pscode.org/test/docload/] & follow the link to sandbox.html for tips on clearing the class cache. That relates specifically to caching a refused security certificate, but class caching is much the same. As an aside, getting a console can be tricky in modern times (unless the applet fails completely). It is handy to configure the [Java Control Panel|http://java.sun.com/docs/books/tutorial/information/player.jnlp] to pop the Java console on finding an applet (Advanced tab - Settings/Java Console/Show Console).
    Of course there are two better tools for testing applets, especially in regard to class caching. AppletViewer and Appleteer both make class refresh fairly easy. Appleteer is the better of the two. I can tell you that with confidence, since I wrote it. ;-)

  • EJB 3.0 - Communicate an Applet with a Session Bean

    Hello
    I'm developing an EJB 3.0 app (eclipse and glassfish tools bundle), and I have an applet that has to use remote session beans.
    QUESTION: Is it possible for the applet to connect to EJB?
    QUESTION: By creating a J2EE application client project, can I use @EJB annotations to inject the session bean directly to the applet, avoiding the JNDI lookup?
    (since I imagine that the anwser to the second one is NO, I do the following consideration)
    Given an application client project, I imagine that this application can run remotely on a client machine/JRE. Then this application can use Annotations/injection facilities whenever it runs on a J2EE client container (which I assume consists of a set of libraries provided by the application server vendor, Glassfish in that case). Could this application be deployed using Java Web Start? If so, why can't it be deployed as an applet? (both options run in a client JRE, don't they?).
    QUESTION: In either case (applet or JWS), how do I have to package the JAR file (using Eclipse) so that it contains the needed libraries for accessing the EJB? Which are those libraries?
    At the time being, I'm trying to implement a sample application that follows the "Applet doing JNDI lookup" approach. I have:
    - an EAR project
    - an EJB project (containing an Entity Bean and a Stateless Session Bean with a @Remote interface)
    @Remote
    public interface HelloRemote {
         public String hello(String name);
    @Stateless
    public class Hello implements HelloRemote {
         @Override
         public String hello(String name) {
              return "Hello "+name+"!!";
    }- an Application Client project (containing the applet code):
    public class ClientApplet extends JApplet {
         public void init(){     
              try {
                   Context jndiContext = getInitialContext( );
                   HelloRemote server = (HelloRemote) jndiContext.lookup(HelloRemote.class.getName());
                   setContentPane(new JLabel(server.hello("Gerard")));
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private Context getInitialContext() throws NamingException{
              Properties props = new Properties();
              props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
              props.setProperty("org.omg.CORBA.ORBInitialHost", "myhost");
              props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
              return new InitialContext(props);
    }- a static web project (with a sample web page that contains the applet object the corresponding applet JAR file)
    I tried to export the Application Client project as an "application client JAR", in the hope that the java EE libraries bundled with glassfish (listed as libraries of this project) would be packaged too.
    No success, so now I'll try to copy all the JAR files (one by one) into the +\WebContent\+ folder of the Web Project, and add references to each of them in the archive="" attribute of the +<applet>+ HTML tag. Although this might work, I suspect that I am missing the good/easy way of doing it. Any suggestions?
    Thanks in advance,
    Gerard
    Edited by: gsoldevila on May 6, 2009 7:09 AM

    An Applet can communicate with an EJB via JNDI lookup but I would (personally) use an intermediate Servlet to handle this. Client to Servlet communication is http whereas to ejb is iiop - which might be blocked.
    Injection only works in managed classes (EJB, Servlet, Listeners..) and an Application Client main class. So yes you could use an app client for handling resource injection.
    m

  • Error while accessing a public method of applet from javascript.

    Hi,
    I am getting "Object doesn't support this property or method" error
    when accessing a public method of applet from javascript in IE 6 using
    document.applets[0].myMethod();
    The same is working in IE 7.
    Thanks in advance.
    Regards,
    Phanikanth

    I don't know why it happens, but this works for me in both versions:
    <applet ..... name="MyApplet">
    </applet>and in javascript use
    document.MyApplet.myMethod()

  • Can not view applet in browser (IE5.5)

    only my appletviewer shows my very simple applet.
    in the IE5.5 i can not view my applet... ?
    my applet just have write a string...
    any help ?

    http://forum.java.sun.com/thread.jsp?forum=31&thread=276607

  • A function can not be used in Applet.what's wrong?

    Here is a function.
    private String LoadFile() {
    String input;
    String output="sssssdsdsddf";
    try{
    FileReader f=new FileReader("shu.txt");
    BufferedReader in = new BufferedReader(f);
    while ((input = in.readLine())!= null){output=output+input;}
    in.close();
    }catch(IOException e) {
    System.err.println("Exception caught: " + e.getMessage());
    return output;
    It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1215-security.html#sidebar1

  • A function can not be used in Applet.what' wrong?

    Here is a function.
              private String LoadFile() {
    String input;
              String output="sssssdsdsddf";
              try{
              FileReader f=new FileReader("shu.txt");
    BufferedReader in = new BufferedReader(f);
    while ((input = in.readLine())!= null){output=output+input;}
              in.close();
              }catch(IOException e) {   
                   System.err.println("Exception caught: " + e.getMessage());
    return output;
    It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

    Don't you think it would be a bit of a security risk if any applet you downloaded from the web (unknowingly) could read/write to your file system....
    Applets have strict security applied to them, and file i/o is one of the restrictions. There are ways around it, but for the moment I'd suggest you build a bridge and get over it.
    Cheers,
    Radish21

  • Unable to delete applet.....

    Hi all,
    I am unable to delete one applet which I have loaded in the card.
    There are 2 applets, one is purse and other is loyalty. And am using shareable interface in which loyalty is the server and purse is the client. I can delete the purse applet but i can't delete the loyalty from the card.
    Here is my code : There are in all 3 codes, one is purse, second is loyalty code and third is the shareable interface code. Can some one look at the code and tell me what's wrong in this programs.
    package com.gemplus.examples.loyalty;
    import javacard.framework.*;
    import visa.openplatform.*;
    public class Loyalty extends javacard.framework.Applet implements TestInterface
    static byte points ;
    protected Loyalty(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)(1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)(1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 4)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    // points = 0;
    // register this instance
    register(buffer, (short)(offset + 1), (byte)buffer[offset]);
    * Method installing the applet.
    * @param bArray the array constaining installation parameters
    * @param bOffset the starting offset in bArray
    * @param bLength the length in bytes of the data parameter in bArray
    public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException
    /* applet instance creation */
    new Loyalty (bArray, bOffset, (byte)bLength);
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    /* return status of selection */
    return true;
    * Deselect method.
    public void deselect()
    return;
    public void process(APDU apdu) throws ISOException
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
              ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   apdu.setIncomingAndReceive();
              byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              creditPoints((byte)0x00);     
              apduBuffer[5] = (byte)(points >> 8) ;
              apduBuffer[6] = (byte)points ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         public void creditPoints(byte pTobeCredited)
    points += pTobeCredited;
    public Shareable getShareableInterfaceObject(AID client, byte param){
              if(param != (byte)0x00)
                   return null;
         return (this);
    second code is :
    package com.gemplus.examples.oppurse;
    * Imported packages
    import javacard.framework.*;
    import visa.openplatform.*;
    import com.gemplus.examples.loyalty.*;
    public class OPPurse extends javacard.framework.Applet
    // the APDU constants for all the commands.
         private final static byte INS_GET_BALANCE = (byte)0x30 ;
         private final static byte INS_DEBIT      = (byte)0x31 ;
         private final static byte INS_CREDIT      = (byte)0x32 ;
         private final static byte INS_VERIFY_PIN = (byte)0x33 ;
         private final static byte INS_SET_NAME                    = (byte)0x34 ;
         private final static byte INS_GET_NAME                    = (byte)0x35 ;
    // the OP/VOP specific instruction set for mutual authentication
         private final static byte CLA_INIT_UPDATE = (byte)0x80 ;
         private final static byte INS_INIT_UPDATE = (byte)0x50 ;
         private final static byte CLA_EXTERNAL_AUTHENTICATE = (byte)0x84 ;
         private final static byte INS_EXTERNAL_AUTHENTICATE = (byte)0x82 ;
    // the PIN validity flag
    private boolean validPIN = false;
    // SW bytes for PIN Failed condition
         // the last nibble is replaced with the number of remaining tries
         private final static short      SW_PIN_FAILED = (short)0x63C0;
         private final static short SW_FAILED_TO_OBTAIN_SIO = (short)0x63D0;
         private final static short SW_LOYALTY_APP_NOT_EXIST = (short)0x63E0;
    // the illegal amount value for the exceptions.
    private final static short ILLEGAL_AMOUNT = 1;
    // the maximum balance in this purse.
    private static final short maximumBalance = 10000;
    // the current balance in this purse.
    private static short balance;
    /*     byte[] loyaltyAID = new byte[]{ (byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x19,(byte)0xFF,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x02,(byte)0x02};*/
    /* Security part of declarations */
    // the Security Object necessary to credit the purse
    private ProviderSecurityDomain securityObject = null;
    // the security channel number
    byte secureChannel = (byte)0xFF;
    // the authentication status
    private boolean authenticationDone = false;
    // the secure channel status
    private boolean channelOpened = false;
         private byte[] nameBuffer = new byte[6];
    * Only this class's install method should create the applet object.
    protected OPPurse(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)( 1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)( 1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 2)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    } else {
    // Install parameter compliant with OP 2.0.
    if(length != 2)
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + length));
              // retreive the balance value from the APDU buffer
    short value = (short)(((buffer[(short)(dataOffset + 1)]) & 0xFF)
              | ((buffer[dataOffset] & 0xFF) << 8));
    // checks initial balance value
    if(value > maximumBalance)
    ISOException.throwIt(ISO7816.SW_DATA_INVALID);
              // initializes the balance with the APDU buffer contents
    balance = value;
    // register this instance as an installed Applet
    register();
    // ask the system for the Security Object associated to the Applet
    securityObject = OPSystem.getSecurityDomain();
    // applet is personalized and its state can change
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    // build the new ATR historical bytes
    byte[] newATRHistory = new byte[]
    // put "OPPurse" in historical bytes.
    (byte)0x4F, (byte)0x50, (byte)0x50, (byte)0x75, (byte)0x72, (byte)0x73, (byte)0x65
    // !!! ACTIVATED IF INSTALL PRIVILEGE IS "Default Selected" (0x04). !!!
    // change the default ATR to a personalized's one
    OPSystem.setATRHistBytes(newATRHistory, (short)0, (byte)newATRHistory.length);
    * Method installing the applet.
    * @param installparam the array constaining installation parameters
    * @param offset the starting offset in installparam
    * @param length the length in bytes of the data parameter in installparam
    public static void install(byte[] installparam, short offset, byte length )
    throws ISOException
    // applet instance creation with the initial balance
    new OPPurse(installparam, offset, length );
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    validPIN = false;
    // reset security if used.
    // In case of reset deselect is not called
    reset_security();
    // return status of selection
    return true;
    * Deselect method.
    public void deselect()
    // reset security if used.
    reset_security();
    return;
    * Method processing an incoming APDU.
    * @see APDU
    * @param apdu the incoming APDU
    * @exception ISOException with the response bytes defined by ISO 7816-4
    public void process(APDU apdu) throws ISOException
    // get the APDU buffer
    // the APDU data is available in 'apduBuffer'
    byte[] apduBuffer = apdu.getBuffer();
    // the "try" is mandatory because the debit method
    // can throw a javacard.framework.UserException
    try
         switch(apduBuffer[ISO7816.OFFSET_INS])
    case INS_VERIFY_PIN :
         verifyPIN(apdu);
    break ;
    case INS_GET_BALANCE :
         getBalance(apdu) ;
    break ;
    case INS_DEBIT :
         debit(apdu) ;
    break ;
                        case INS_SET_NAME :
                             setName(apdu);
                        break;
                        case INS_GET_NAME :
                             getName(apdu);
                        break ;
    case INS_CREDIT :
         credit(apdu) ;
    break ;
    case INS_INIT_UPDATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_INIT_UPDATE)
    // call initialize/update security method
         init_update(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case INS_EXTERNAL_AUTHENTICATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_EXTERNAL_AUTHENTICATE)
    // call external/authenticate security method
         external_authenticate(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case ISO7816.INS_SELECT :
    break ;
    default :
    // The INS code is not supported by the dispatcher
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED) ;
    break ;
         }     // end of the switch
    } // end of the try
              catch(UserException e)
    // translates the UserException in an ISOException.
              if(e.getReason() == ILLEGAL_AMOUNT)
    throw new ISOException ( ISO7816.SW_DATA_INVALID ) ;
    //- P R I V A T E M E T H O D S -
         * Handles Verify Pin APDU.
         * @param apdu APDU object
         private void verifyPIN(APDU apdu)
    // get APDU data
              apdu.setIncomingAndReceive();
    // get APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // check that the PIN is not blocked
    if(OPSystem.getTriesRemaining() == 0)
    OPSystem.setCardContentState(OPSystem.APPLET_BLOCKED);
    // Pin format for OP specification
    // |type(2),length|nible(1),nible(2)|nible(3),nible(4)|...|nible(n-1),nible(n)|
    // get Pin length
    byte length = (byte)(apduBuffer[ISO7816.OFFSET_LC] & 0x0F);
    // pad the PIN ASCII value
    for(byte i=length; i<0x0E; i++)
    // only low nibble of padding is used
    apduBuffer[ISO7816.OFFSET_CDATA + i] = 0x3F;
    // fill header TAG
    apduBuffer[0] = (byte)((0x02 << 4) | length);
    // parse ASCII Pin code
    for(byte i=0; i<0x0E; i++)
    // fill bytes with ASCII Pin nibbles
    if((i & 0x01) == 0)
    // high nibble
    apduBuffer[(i >> 1)+1] = (byte)((apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F) << 4);
    else
    // low nibble
    apduBuffer[(i >> 1)+1] |= (byte)(apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F);
    // verify the received PIN
    // !!! WARNING PIN HAS TO BE INITIALIZED BEFORE USE !!!
    if(OPSystem.verifyPin(apdu, (byte)0))
    // set PIN validity flag
    validPIN = true;
    // if applet state is BLOCKED then restore previous state (PERSONALIZED)
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    return;
         // the last nibble of returned code is the number of remaining tries
              ISOException.throwIt((short)(SW_PIN_FAILED + OPSystem.getTriesRemaining()));
    * Performs the "getBalance" operation on this counter.
    * @param apdu The APDU to process.
    private void getBalance( APDU apdu )
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              apduBuffer[5] = (byte)(balance >> 8) ;
              apduBuffer[6] = (byte)balance ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         private void setName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
              // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
              byte[] apduBuffer = apdu.getBuffer();
              apdu.setIncomingAndReceive();     
              for(short i=0,k=5;i<6;i++,k++)
                   nameBuffer[i] = apduBuffer[k];
         }//end of setName
         private void getName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   byte[] apduBuffer = apdu.getBuffer();
                   for(short i=5, k=0;i<11;i++,k++)
                        apduBuffer=nameBuffer[k];
                   apdu.setOutgoing();
                   apdu.setOutgoingLength((short)6);
                   apdu.sendBytes((short)5,(short)6);
         }//end of storeName
    * Performs the "debit" operation on this counter.
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid.
    * @exception UserException If the amount to debit is invalid.
    private void debit(APDU apdu) throws ISOException, UserException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
         // Gets the length of bytes to recieved from the terminal and receives them
    // If does not receive 4 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
              ISOException.throwIt(ISO7816.SW_WRONG_LENGTH) ;
              // Reads the debit amount from the APDU buffer
    // Starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8 ) & (short)0x0000FF00));
    // tests if the debit is valid
    if((balance >= amount) && (amount > 0))
    // does the debit operation
    balance -= amount ;
    // writes the new balance into the APDU buffer
    // (writes after the debit amount in the APDU buffer)
    apduBuffer[7] = (byte)(balance >> 8) ;
    apduBuffer[8] = (byte)balance ;
    // sends the APDU response
    apdu.setOutgoing() ; // Switches to output mode
    apdu.setOutgoingLength((short)2) ; // 2 bytes to return
    // offset and length of bytes to return in the APDU buffer
    apdu.sendBytes((short)7, (short)2) ;
              /*short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)(JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00));
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    else
    // throw a UserException with illegal amount as reason
    throw new UserException(ILLEGAL_AMOUNT) ;
    /* byte points = (byte)0x0A;
              //short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00);
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    * Performs the "credit" operation on this counter. The operation is allowed only
    * if master pin is validated
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid or if the amount to credit
    * is invalid.
    private void credit(APDU apdu) throws ISOException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated and authentication is done
         if (!validPIN || !authenticationDone)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
              // gets the length of bytes to recieved from the terminal and receives them
    // if does not receive 2 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
    throw new ISOException(ISO7816.SW_WRONG_LENGTH) ;
              // reads the credit amount from the APDU buffer
    // starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8) & (short)0x0000FF00));
    // tests if the credit is valid
    if(((short)(balance + amount) > maximumBalance) || (amount <= (short)0))
    throw new ISOException(ISO7816.SW_DATA_INVALID) ;
    else
    // does the credit operation
    balance += amount ;
    * Performs the "init_update" security operation.
    * @param apdu The APDU to process.
    private void init_update( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    // close the openned security channel
    try
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    try
    // open a new security channel
    secureChannel = securityObject.openSecureChannel(apdu);
    // set the channel flag to open
    channelOpened = true;
    // get expected length
    short expected = apdu.setOutgoing();
    // send authentication result
    // expected length forced to 0x1C
    apdu.setOutgoingLength((byte)0x1C);
    apdu.sendBytes(ISO7816.OFFSET_CDATA, (byte)0x1c);
    catch(CardRuntimeException cre)
    // no available channel or APDU is invalid
    ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
    * Performs the "external_authenticate" security operation.
    * @param apdu The APDU to process.
    private void external_authenticate( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    try
    // try to authenticate the client
    securityObject.verifyExternalAuthenticate(secureChannel, apdu);
    // authentication succeed
    authenticationDone = true;
    catch(CardRuntimeException cre)
    // authentication fails
    // set authentication flag to fails
    authenticationDone = false;
    // close the openned security channel
    try {
    securityObject.closeSecureChannel(secureChannel);
    } catch(CardRuntimeException cre2) {
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    // send authentication result
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // send authentication result
    ISOException.throwIt(ISO7816.SW_NO_ERROR);
    else
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    * The "reset_security" method close an opened secure channel if exist.
    * @return void.
    public void reset_security()
    // close the secure channel if openned.
    if(secureChannel != (byte)0xFF)
    try
    // close the openned security channel
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // reset security parameters
    secureChannel = (byte)0xFF;
    channelOpened = false;
    authenticationDone = false;
    return;
    and the 3rd code is:
    package com.gemplus.examples.loyalty;
    import javacard.framework.Shareable;
    public interface TestInterface extends Shareable
    // public void creditPoints(byte points) ;
              public void creditPoints(byte points) ;
    Thanks in advance......

    Thanks. I know they are not the same thing. A package cannot be deleted if it contains one or more applets.
    I tried to delete by typing in the applet AID first, but it just doesn't work. And of course it doesn't work for package AID.
    Both the package and applet AID are generated in JBuilder, which looks like this, package AID(6D 79 70 61 63 6B 61 67 31),
    applet AID(6D 79 70 61 63 30 30 30 31),
    instance AID(6D 79 70 61 63 30 30 30 31)
    I've tried those three AIDs, it's not working.
    Thanks.

  • Applet load times got you down?

    Then vote for this RFE:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6346341
    The whole discussion started here:
    http://forum.java.sun.com/thread.jspa?threadID=678853&tstart=0
    -Dennis

    I have the same problem, and add this replay to motivate a clever person to solve this problem.
    My situation is:
    20 Applets (or so) on one page - they span exactly on Thread - if clicked. And if I reload the page they never work again - I have to restart the browser.
    If I browse to the page with the applets I have complete browser crash in 3 of 4 cases. But the first time I visted the page after reboot of Linux (everything less don't help) all the applets work.
    If I put only one Applet on a page and reload this page, then in a few lucky cases the Applet works a second time.
    On windows everything is fine, so I don't think my
    Applets are the problem.
    On linux I tried several version of upto Mozilla 0.9.8
    everytime the same (but 0.9.8 don't work at all with the plugin).

  • JRE freeze when loading applet twice, through VSAT network

    Here is a good one for you guys I think ...
    ===========
    What I got:
    ===========
    I have a java web application, runing with Tomcat 5.5.
    I use a Apache HTTP Server 2.0.52 for my statiques ressources (html, etc ...), and the modjk connector 1.2.13 to forward all the dynamic requests from the client to the application server.
    One of my html pages contains a signed java applet.
    Basically, this applet control a scanner and send the scanned image to the web application server.
    This applet:
    - use some swing components
    - use the netscape.javascript.JSObject to call javascript functions
    - use the morena API (which include a native library) in order to control a TWAIN scanner
    - format the scanned image into a JPEG image
    - send the formatted image to the web server, using an HttpURLConnection
    (I use a servlet on server side to get the uploaded image)
    - wait for the server response, that tells my applet if the upload has been successfull or not
    Some additional infos:
    - I use morena 6.2.0.0
    - I use JRE 1.5.0.0.1 to run the applet
    - JRE on client side is configured as follow:
    - no applet caching
    - network parameters: "use the browser parameters"
    ==============
    My problem is:
    ==============
    - Through a LAN network, the applet works perfectly ...
    - Through an internet network (I use a VSAT / IDIRECT network), I can load and run my applet the first time
    but when I try to run my applet for the second time (without closing the browser), it just doesn't start, and the JRE crash
    (i.e. the java console freeze ..., just like if it was waiting for something ...)
    nothing happen after that, and I have to kill my JRE / Browser
    the funny stuff about it is that the applet works fine (even through VSAT network) when I don't upload the scanned image on the server
    load and run ok as many time as I want ...
    => seems that something's going wrong during the uploading process
    ==========================
    What I have already tried:
    ==========================
    1/ getting rid of the Java - Javascript communication (JSObject seems to have heaps of bugs ...)
    => no changes
    2/ be careful to close correctly my HttpURLConnection, with a HttpURLConnection.disconnect()
    => no changes
    3/ put the morena jars directly on the client side (in the lib/ext directory of the JRE):
    the morena API use a native library, and apparently, a native library can not be loaded by 2 different ClassLoader
    just to avoid any "java.lang.UnsatisfiedLinkError"
    as shown on http://forum.java.sun.com/thread.jspa?forumID=31&threadID=628889
    => no changes
    4/ have a closer look on the http apache server, just to get rid of the error
    "OS 64)The specified network name is no longer available. : winnt_accept: Asynchronous AcceptEx failed."
    as shown on the bug 21425 in http://issues.apache.org/bugzilla/show_bug.cgi?id=21425
    => no changes
    5/ use the upgrade version 1.5.0.6 of the JRE
    => no changes
    ==========
    ANY HELP ?
    ==========
    and as usual, I had to fix this problem for yesterday ... :)))
    Any ideas about that ?
    need more infos ?: just let me know
    ======================================================================================
    Here is the piece of code I use to upload the image from the client to the web server:
    ======================================================================================
    * Upload de cette image sur le serveur, apr�s passage au format JPEG
    * @param imageSelectionnee BufferedImage image � transf�rer
    * @throws ComposantNumerisationException exception pouvant etre lev� lors de l'upload
    public void uploadImage(BufferedImage imageSelectionnee)
        throws ComposantNumerisationException {
        // connexion http au server
        HttpURLConnection connexionServer = null;
        // flux de sortie, permettant d'envoyer les donn�es vers le serveur
        OutputStream fluxSortie = null;
        // parametres pour le libelle de l'exception
        ParametresProprietes parametres = null;
        // flux d'entr�e, pour lire la r�ponse du serveur
        BufferedReader fluxEntree = null;
        // r�ponse du serveur
        String reponseServeur = null;
        // image au format JPEG
        BufferedImage imageFormatJPEG = null;
        try {
            /* conversion de l'image au format JPEG */
            imageFormatJPEG = this.formatterImage(imageSelectionnee);
            /* ouverture d'une connexion vers le serveur */
            connexionServer = this.ouvrirConnexion(imageFormatJPEG);
            /* ecriture des donn�es dans le flux de sortie, vers le serveur */
            // cr�ation d'un outputStream
            fluxSortie = connexionServer.getOutputStream();
            // transfert des donn�es vers le serveur
            ImageIO.write(imageFormatJPEG, Constantes.TYPE_IMAGE, fluxSortie);
            fluxSortie.flush();
            /* lecture de la r�ponse du serveur */
            // cr�ation d'un flux de lecture sur le flux d'entr�e
            fluxEntree = new BufferedReader(new InputStreamReader(
                                                connexionServer.getInputStream()));
            // lecture de la r�ponse du serveur
            reponseServeur = fluxEntree.readLine();
            // v�rification du succes de l'upload, en fonction de la r�ponse du serveur
            if (!reponseServeur.startsWith("REPONSE")) {
                /* cas ou le message retour ne commence pas par "REPONSE":
                 * ce n'est pas la r�ponse de la servlet
                 *  => Tomcat nous a redirig� vers la page d'authentification */
                fenetreNumerisation.redirigerFenetreAuthentification();
            } else if (reponseServeur.compareTo("REPONSE:OK") != 0) {
                // la r�ponse du serveur indique qu'il y a eu un probl�me lors de l'upload
                throw new IOException(reponseServeur);
        } catch (IOException e) {
            // cr�ation des parametres pour ce libelle d'erreurs
            parametres = new ParametresProprietes();
            parametres.ajouterParametre("0", e.toString());
            throw new ComposantNumerisationException(
                    proprietes.getPropriete("ERREUR_UPLOAD", null),
                    proprietes.getPropriete("ERREUR_UPLOAD_TECH", parametres),
                    ComposantNumerisationException.ERREUR_NON_BLOCANTE);
        } finally {
            try {
                // fermeture de ce flux de sortie
                if (null != fluxSortie) {
                    fluxSortie.close();
                // fermeture du flux de lecture de la reponse
                if (null != fluxEntree) {
                    fluxEntree.close();
            } catch (IOException e) {
            // fermeture de la connexion
            if (null != connexionServer) {
                connexionServer.disconnect();
    * Ouverture d'une connexion vers la servlet d'upload de l'image
    * @param image BufferedImage image � transf�rer
    * @return HttpURLConnection une connexion http
    * @throws IOException exception IO
    * @throws ComposantNumerisationException exception
    private HttpURLConnection ouvrirConnexion(BufferedImage image)
        throws IOException, ComposantNumerisationException {
        // url du server
        URL urlServer = null;
        // connexion http au server
        HttpURLConnection connexionServer = null;
        // signature
        String signature = null;
        // g�n�ration de la signature de l'image � transf�rer
        signature = this.genererSignatureImage(image);
        // construction de l'url du serveur � appeler pour cet upload
        // en incluant un parametre pour transmettre la signature de l'image � transf�rer
        // + identifiant du passeport d'urgence courant
        urlServer = new URL(this.urlServeur + this.action +
                            "?" + Constantes.PARAM_SIGNATURE_IMAGE + "=" + signature +
                            "&" + Constantes.PARAM_IDDEMANDE + "=" + idDemande +
                            "&" + Constantes.PARAM_CODEMAJ + "=" + codeMaj +
                            "&" + Constantes.PARAM_TYPEDEMANDE + "=" + typeDemande);
        if (null == urlServer) {
            throw new IOException(proprietes.getPropriete(
                                "ERREUR_UPLOAD_CREATION_URL_SERVEUR", null));
        // ouverture d'une connexion http, gr�ce a cette url du server
        connexionServer = (HttpURLConnection) urlServer.openConnection();
        if (null == connexionServer) {
            throw new IOException(proprietes.getPropriete(
                    "ERREUR_UPLOAD_OUVERTURE_CONNEXION_SERVEUR", null));
        // param�trage de cette connexion
        // m�thode de transmission = POST
        connexionServer.setRequestMethod("POST");
        // autorisation de lire les donn�es venant du serveur
        connexionServer.setDoInput(true);
        // autorisation d'�crire des donn�es vers le serveur                         
        connexionServer.setDoOutput(true);
        // pas d'utilisation de caches
        connexionServer.setUseCaches(false);
        connexionServer.setDefaultUseCaches(false);
        // sp�cification du type des donn�es que l'on envoie vers le serveur
        connexionServer.setRequestProperty("content-type", "img/jpeg");
        return connexionServer;
    }=======================================================================================
    Here is the piece of code I use on server side to get the scaned image from the client:
    =======================================================================================
    * Lecture des donn�es en provenance de l'applet
    * @param request HttpServletRequest
    * @return ByteArrayOutputStream buffer contenant les donn�es lues
    * @throws TechnicalException exception
    * @throws FunctionalException si erreur fonctionnelle
    private ByteArrayOutputStream lireDonnees(HttpServletRequest request)
        throws FunctionalException, TechnicalException {
        // stream de sortie sur l'image
        ByteArrayOutputStream baos = null;
        // id du passeport d'urgence au format Integer
        // image issue de l'applet
        BufferedImage image = null;
        try {
            /* r�cup�ration de l'image */
            image = ImageIO.read(request.getInputStream());
            if (null == image) {
                logger.error(THIS_CLASS + Libelles.getLibelle("ERR-TEC-16", null));
                throw new TechnicalException(new ErreurVO("ERR-TEC-16",
                        null, "", true, false, false));
        } catch (IllegalArgumentException e) {
            logger.error(THIS_CLASS + Libelles.getLibelle("ERR-TEC-13", null));
            throw new TechnicalException(new ErreurVO("ERR-TEC-13",
                    null, "", true, false, false));
        } catch (IOException e) {
            logger.error(THIS_CLASS + Libelles.getLibelle("ERR-TEC-16", null));
            throw new TechnicalException(new ErreurVO("ERR-TEC-16",
                    null, "", true, false, false));
        return baos;
    * Ecriture de la reponse � envoyer � l'applet
    * @param response HttpServletResponse
    * @param erreur Message d'erreur
    * @throws IOException exception
    private void ecrireReponse(HttpServletResponse response, String erreur) throws IOException {
        // r�ponse � envoyer � l'applet
        String reponseServer = null;
        // flux de reponse
        PrintWriter fluxReponse = null;
        response.setContentType("text/html");
        // construction de la r�ponse � envoyer � l'applet
        if (null == erreur) {
            reponseServer = "REPONSE:OK";
        } else {
            /* cas ou il y a eu une exception lev�e lors de la reception des donn�es */
            reponseServer = "REPONSE:ERREUR:" + erreur;
        if (logger.isDebugEnabled()) {
            logger.debug(THIS_CLASS +
                    "Envoie de la r�ponse � l'applet, indiquant si l'upload s'est bien d�roul�: " +
                    reponseServer);
        //envoie de la r�ponse a l'applet
        fluxReponse = response.getWriter();
        fluxReponse.println(reponseServer);
        fluxReponse.close();
    }==============================================================================
    here is the traces I get when the applet doesn't work, through a VSAT network:
    ==============================================================================
    Java Plug-in 1.5.0_01
    Utilisation de la version JRE 1.5.0_01 Java HotSpot(TM) Client VM
    R�pertoire d'accueil de l'utilisateur = C:\Documents and Settings\assistw
    network: Chargement de la configuration du proxy d�finie par l'utilisateur ...
    network: Termin�.
    network: Chargement de la configuration du proxy � partir de Netscape Navigator ...
    network: Erreur lors de la lecture du fichier de registre : C:\Documents and Settings\assistw\Application Data\Mozilla\registry.dat
    network: Termin�.
    network: Chargement de la configuration proxy du navigateur ...
    network: Termin�.
    network: Configuration du proxy : Configuration du proxy du navigateur
    basic: Le cache est d�sactiv� par l'utilisateur
    c:   effacer la fen�tre de la console
    f:   finaliser les objets de la file d'attente de finalisation
    g:   lib�rer la m�moire
    h:   afficher ce message d'aide
    l:   vider la liste des chargeurs de classes
    m:   imprimer le relev� d'utilisation de la m�moire
    o:   d�clencher la consignation
    p:   recharger la configuration du proxy
    q:   masquer la console
    r:   recharger la configuration des politiques
    s:   vider les propri�t�s syst�me et d�ploiement
    t:   vider la liste des threads
    v:   vider la pile des threads
    x:   effacer le cache de chargeurs de classes
    0-5: fixer le niveau de tra�age � <n>
    basic: R�cepteur de modalit�s enregistr�
    basic: R�f�rence au chargeur de classes : sun.plugin.ClassLoaderInfo@b30913, refcount=1
    basic: R�cepteur de progression ajout� : sun.plugin.util.GrayBoxPainter@77eaf8
    basic: Chargement de l'applet...
    basic: Initialisation de l'applet...
    basic: D�marrage de l'applet...
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/SAppletNumerisation.jar avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/SAppletNumerisation.jar avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    security: Acc�s aux cl�s et au certificat dans le profil utilisateur Mozilla : null
    security: Chargement des certificats AC racine depuis C:\PROGRA~1\Java\JRE15~1.0_0\lib\security\cacerts
    security: Certificats AC racine charg�s depuis C:\PROGRA~1\Java\JRE15~1.0_0\lib\security\cacerts
    security: Chargement des certificats JPI depuis C:\Documents and Settings\assistw\Application Data\Sun\Java\Deployment\security\trusted.certs
    security: Certificats JPI charg�s depuis C:\Documents and Settings\assistw\Application Data\Sun\Java\Deployment\security\trusted.certs
    security: Chargement des certificats JPI depuis C:\PROGRA~1\Java\JRE15~1.0_0\lib\security\trusted.certs
    security: Certificats JPI charg�s depuis C:\PROGRA~1\Java\JRE15~1.0_0\lib\security\trusted.certs
    security: Chargement des certificats depuis la zone de stockage des certificats de session JPI
    security: Certificats charg�s depuis la zone de stockage des certificats de session JPI
    security: Recherche du certificat dans le magasin de certificats permanent JPI
    security: Recherche du certificat dans la zone de stockage des certificats de session JPI
    security: Obtenir l'objet de stockage des cl�s de la zone de stockage des certificats AC racine
    security: Obtenir l'objet de stockage des cl�s de la zone de stockage des certificats AC racine
    security: Recherche du certificat dans la zone de stockage des certificats AC racine
    security: D�terminer si le certificat peut �tre v�rifi� � l'aide des certificats de la zone de stockage des certificats AC racine
    ... [check certifications]
    sun.misc.Launcher$ExtClassLoader@92e78c
    <no principals>
    java.security.Permissions@157b46f (
    (java.lang.RuntimePermission stopThread)
    (java.security.AllPermission <all permissions> <all actions>)
    (java.io.FilePermission \C:\Program Files\Java\jre1.5.0_01\lib\ext\sunjce_provider.jar read)
    (java.util.PropertyPermission java.version read)
    (java.util.PropertyPermission java.vm.name read)
    (java.util.PropertyPermission java.vm.vendor read)
    (java.util.PropertyPermission os.name read)
    (java.util.PropertyPermission java.vendor.url read)
    (java.util.PropertyPermission java.vm.specification.vendor read)
    (java.util.PropertyPermission java.specification.vendor read)
    (java.util.PropertyPermission os.version read)
    (java.util.PropertyPermission java.specification.name read)
    (java.util.PropertyPermission java.class.version read)
    (java.util.PropertyPermission file.separator read)
    (java.util.PropertyPermission java.vm.version read)
    (java.util.PropertyPermission os.arch read)
    (java.util.PropertyPermission java.vm.specification.name read)
    (java.util.PropertyPermission java.vm.specification.version read)
    (java.util.PropertyPermission java.specification.version read)
    (java.util.PropertyPermission java.vendor read)
    (java.util.PropertyPermission path.separator read)
    (java.util.PropertyPermission line.separator read)
    (java.net.SocketPermission localhost:1024- listen,resolve)
    ... [check certifications]
    security: La v�rification du certificat � l'aide des certificats AC racine a �chou�
    security: Aucune information d'horodatage disponible
    basic: Modalit� empil�e
    basic: Modalit� d�sempil�e
    basic: Utilisateur s�lectionn� : 0
    security: L'utilisateur a accord� les droits d'acc�s au code pour cette session seulement
    security: Ajout du certificat dans la zone de stockage des certificats de session JPI
    security: Certificat ajout� dans la zone de stockage des certificats de session JPI
    security: Enregistrement des certificats dans la zone de stockage des certificats de session JPI
    security: Certificats enregistr�s dans la zone de stockage des certificats de session JPI
    ... [check certifications]
    sun.plugin.security.PluginClassLoader@10fe2b9
    <no principals>
    java.security.Permissions@fe315d (
    (java.lang.RuntimePermission accessClassInPackage.sun.audio)
    (java.lang.RuntimePermission stopThread)
    (java.security.AllPermission <all permissions> <all actions>)
    (java.util.PropertyPermission java.version read)
    (java.util.PropertyPermission java.vm.name read)
    (java.util.PropertyPermission javaplugin.version read)
    (java.util.PropertyPermission java.vm.vendor read)
    (java.util.PropertyPermission os.name read)
    (java.util.PropertyPermission java.vendor.url read)
    (java.util.PropertyPermission java.vm.specification.vendor read)
    (java.util.PropertyPermission java.specification.vendor read)
    (java.util.PropertyPermission os.version read)
    (java.util.PropertyPermission browser.vendor read)
    (java.util.PropertyPermission java.specification.name read)
    (java.util.PropertyPermission java.class.version read)
    (java.util.PropertyPermission file.separator read)
    (java.util.PropertyPermission browser.version read)
    (java.util.PropertyPermission java.vm.version read)
    (java.util.PropertyPermission os.arch read)
    (java.util.PropertyPermission browser read)
    (java.util.PropertyPermission java.vm.specification.name read)
    (java.util.PropertyPermission java.vm.specification.version read)
    (java.util.PropertyPermission java.specification.version read)
    (java.util.PropertyPermission java.vendor read)
    (java.util.PropertyPermission path.separator read)
    (java.util.PropertyPermission http.agent read)
    (java.util.PropertyPermission line.separator read)
    (java.net.SocketPermission rma_phileas connect,accept,resolve)
    (java.net.SocketPermission localhost:1024- listen,resolve)
    ... [check certifications]
    sun.misc.Launcher$ExtClassLoader@92e78c
    <no principals>
    java.security.Permissions@bd09e8 (
    (java.lang.RuntimePermission stopThread)
    (java.security.AllPermission <all permissions> <all actions>)
    (java.io.FilePermission \C:\Program Files\Java\jre1.5.0_01\lib\ext\Smorena.jar read)
    (java.util.PropertyPermission java.version read)
    (java.util.PropertyPermission java.vm.name read)
    (java.util.PropertyPermission java.vm.vendor read)
    (java.util.PropertyPermission os.name read)
    (java.util.PropertyPermission java.vendor.url read)
    (java.util.PropertyPermission java.vm.specification.vendor read)
    (java.util.PropertyPermission java.specification.vendor read)
    (java.util.PropertyPermission os.version read)
    (java.util.PropertyPermission java.specification.name read)
    (java.util.PropertyPermission java.class.version read)
    (java.util.PropertyPermission file.separator read)
    (java.util.PropertyPermission java.vm.version read)
    (java.util.PropertyPermission os.arch read)
    (java.util.PropertyPermission java.vm.specification.name read)
    (java.util.PropertyPermission java.vm.specification.version read)
    (java.util.PropertyPermission java.specification.version read)
    (java.util.PropertyPermission java.vendor read)
    (java.util.PropertyPermission path.separator read)
    (java.util.PropertyPermission line.separator read)
    (java.net.SocketPermission localhost:1024- listen,resolve)
    scl:
    Morena - Image Acquisition Framework version 6.2.0.0.
    Copyright (c) Gnome s.r.o. 1999-2004. All rights reserved.
    Licensed to "XXX".
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageInputStreamSpi avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageInputStreamSpi avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageOutputStreamSpi avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageOutputStreamSpi avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageTranscoderSpi avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageTranscoderSpi avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageReaderSpi avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageReaderSpi avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageWriterSpi avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/META-INF/services/javax.imageio.spi.ImageWriterSpi avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    network: Connexion de http://rma_phileas/Client/flux/protected/uploadimage.do?signature=c07690c12904320a253cbdeeded59238&idDemande=7&codeMaj=1133967329473&typeDemande=PU avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/flux/protected/uploadimage.do?signature=c07690c12904320a253cbdeeded59238&idDemande=7&codeMaj=1133967329473&typeDemande=PU avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"
    basic: Arr�t de l'applet...
    basic: R�cepteur de progression supprim� : sun.plugin.util.GrayBoxPainter@77eaf8
    basic: Jonction du thread d'applet...
    basic: Destruction de l'applet...
    basic: Elimination de l'applet...
    basic: Sortie de l'applet...
    basic: Thread d'applet joint...
    basic: R�cepteur de modalit�s non enregistr�
    basic: Recherche d'informations...
    basic: Lib�ration du chargeur de classes : sun.plugin.ClassLoaderInfo@b30913, refcount=0
    basic: Mise en cache du chargeur de classes : sun.plugin.ClassLoaderInfo@b30913
    basic: Taille de cache du chargeur de classes courant : 1
    basic: Termin�...
    basic: R�cepteur de modalit�s enregistr�
    basic: R�f�rence au chargeur de classes : sun.plugin.ClassLoaderInfo@b30913, refcount=1
    basic: R�cepteur de progression ajout� : sun.plugin.util.GrayBoxPainter@1e16483
    basic: Chargement de l'applet...
    basic: Initialisation de l'applet...
    basic: D�marrage de l'applet...
    network: Connexion de http://rma_phileas/Client/html/composants/scanner/SAppletNumerisation.jar avec proxy=DIRECT
    network: Connexion http://rma_phileas/Client/html/composants/scanner/SAppletNumerisation.jar avec cookie ":::langueSettings:::=FR; :::menuSettings_gabaritMaquette:::=%3CSETTINGS%3E%3CVERSION%3EVersion%201.2-Utilisateur%3C/VERSION%3E%3CINDEX_ITEM1%3E0%3C/INDEX_ITEM1%3E%3CINDEX_ITEM2%3E0%3C/INDEX_ITEM2%3E%3CINDEX_ITEM3%3Enull%3C/INDEX_ITEM3%3E%3C/SETTINGS%3E; JSESSIONID=D064486FD6C7CC17E7B256B66965FFEE"

    A workaround would be: don't use IE9. You want a solution, not a workaround.
    I think at this juncture you are best of creating a new bug report and be sure to reference the old closed one. It doesn't look entirely related though, your symptoms are different from what is described in it (freeze VS a crash). You tried this on several systems right? Also on machines on a different network?
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7072601

  • Problems with pacman applet, and advice on a gaming portfolio

    Hi
    I recently made a pacman applet, im having a few problems with it though, the first time the applet is run on a browser, the ghosts(represented by squares) often dont appear or if they do, they are stuck in walls, this never happens when i run offline on my computer. Is this because the very first time the applet is run, it doesnt load properly, but the second time some of the files are in the cache so it loads fully?
    Also everytime i refresh the browser the applet dissapears and is replaced with a blank space and a cross in the top left hand corner, does anyone know the reason for this?
    The applet can be found below, if you do decide to play it, please bear in mind what i have said, so it might not load correctly the first time, if this is the case please refresh, or close the broswer and reopen the link! Also you will need to click the applet for it to gain focus before you can move pacman - use the arrow keys the control pacman.
    http://www.renaissance-designs.co.uk/Satwant/java/pacman/
    Id also be very gratful for some advice - id like a change in career, ive always wanted to get into gaming, ive had some previous knowledge in java i made a programme that could generate its own poetry in java for my dissatation, but i still never had a huge amount of confidence, and so went into websites.
    BUT now i have decided to take the leap back into programming and give it a go, which is why ive made this game.
    I thought id make a portfolio and try and apply for a few gaming jobs. This applet took me two weeks to make and it was in my spare time, i am fully aware its not perfect, and it doesnt look great, but i would like to know what people think of it, also how many more games do you think i should make, before i apply for gaming jobs? Does anyone have any advice on what would make a good portfolio for a java gaming job?
    Thanks alot, i look forward to what you think of the game, and your advice!
    SSKenth

    sskenth wrote:
    Thanks for getting back to me with that information, i didnt know you could see that information with just a simple right click!
    But im afraid that doesnt really help me solve the problem, im not sure what all of that information means! :SI have very little experience with applets, but I can tell you what I would do to debug this (forgive me if you already know this stuff).
    Look at the stack trace you get in the Java Console that I posted earlier. Each line contains a method that was called from the method on the previous line. So, java.lang.Thread.run() called sun.applet.AppletPanel.run(), which called Room.init(), etc. Look at the topmost line whose method is something you wrote, not something in the standard Java libraries. In your case it looks like PaintSurface.java (specifically, line 22). Look at what line 22 of PaintSurface.java is doing, it's calling Thread.start(). If you check out the Javadoc for Thread.start(), it says IllegalThreadStateException gets thrown if you call start() on a thread that has already started. So that's your problem. Without looking at your code, I'd assume you want to stop your thread in your applet's destroy() override, and instead of reusing it, create a new one each time init() is called.
    Ill try and look into, thanks again though, it gives me somthing to work with :D
    Btw when you first ran the applet, did all the ghosts(3) load up correctly?Unfortunately, no. The first time I ran it, there was only 1 ghost (or maybe all 3 overlapping each other?) at the top of the screen, and they never moved. Refreshing once made the game play as I think you want it to. Refreshing a third time gave the dreaded red X.
    ...oh and just out of curiosity,,, did u have fun playing the game :DSure did.

  • Java.awt.createFont(...) in Applet

    I'm trying to dynamically load a truetype-font in an applet with Font.createFont(...) .
    Unfortunately I'm always getting
    java.lang.SecurityException: Unable to create temporary fileAnd, surprise, surprise, Font.createFont() requires a temporary file wich I found not to be documented in javadoc but in the source of Font.java (see last line of the next code example):
    public static Font createFont ( int fontFormat, InputStream fontStream )
          throws java.awt.FontFormatException, java.io.IOException {
          if ( fontFormat != Font.TRUETYPE_FONT ) {
              throw new IllegalArgumentException ( "font format not recognized" );
          File fontFile = null;
          fontFile = File.createTempFile ( "font", ".ttf", null );Has anybody faced the same problem or an idea of how to solve this issue with little additional work?

    has really nobody got an idea?

  • JLable components not being displayed in the panel of the applet

    I am having the problem with the display of the JLabel components in the Panel component of the Applet.
    The JLabel components do not appear in the Panel of the applet unless i minimize or maximize the applet.

    hello...
    i just had the same problem... it was solved by using the .updateUI() method.
    in my case several textFields were dynamically added to a jpanel, there we called the method on that panel.
    ptf.updateUI();     
    hope it works.
    ----------++-----+
    ...algun dia todos seremos luz...
    -zoe

Maybe you are looking for