DocumentBuilderFactory and my applet

I am creating an applet that will read an XML file and parse the file to grab some info. I created the project in netbeans and i'm using the java.xml.parsers.DocumentBuilder and java.xml.parsers.DocumentBuilderFactory classes to do the work. When i run the applet and the config file is found it is read in just fine in the browser but i get a dozen errors in my server log saying "No route matches "/META-INF/services/javax.xml.parsers.DocumentBuilderFactory" with {:method=>:get}". This is bad because it makes the web app think an error occurred and it will spam our error email address. Is there something wrong with how i'm creating my applet or is this an issue with the web application?
Thank you,
Austin

Appetviewer fails on my applet:
runrun sun.applet.Main Pancet.class
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
The application exited
yet it ran fine when I created it in JBuilder. Does
appletviewer require a "main" method? No.
My applet does
implement "runnable". Does the fact that I haven't
yet coaxed Mozilla into accepting the latest java
plugin have barring on the problem (this would seem
unlikely to me)? No, don't think so. Sounds like an uncaught exception to me. Maybe a security exception? What's the applet doing?

Similar Messages

  • COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET: US$20 AWARD FOR SOLUTION!

    COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET PROBLEM (Easy Filter Java Applet) -
    US$20 TO ANYONE WHO CAN RESOLVE THE PROBLEM
    To forum visitors:
    I am prepared to pay a standard shareware fee of US$20 to a user who can resolve this technical problem.
    If your advice resolves the problem, I'll forward the payment to your postal address (include your
    address with your reply, and also your email address)
    I am attempting to enable a HTML button (using Javascript's onClick command) to directly input a number into one of the parameter text boxes in the Easy Filter Java applet (ie, enter a new color value number in the text field of the standard Colors Multiplicator Filter interface).
    The applet is Freeware and can be downloaded at: http://www.javazoom.net/applets/easyfilter10/EasyFilter10.html
    (It is a very effective bitmap display and editing utility)
    To achieve this, I am trying to access the part of the applet that defines and sets the textbox. The text box is defined in the .class file by accessing the parameter details in the genericfilter.txt file (accompanies the .class files). I need to access 'private String appletInitialize()' and then one of the 'textFieldParameters' which sets the textbox.
    I understand the basic syntax for referencing the applet:
    document.appletname.setString("An example"). However, accessing the text fields in this applet is more complex!!
    Please can you recommend the correct Javascript syntax to achieve communication with the applet.
    Thank you for your kind assistance.
    JM Graham
    [email protected]
    The Java source code for the applet: EasyFilter.class
    # Easy Filter - E.B/JavaZOOM 1999 #
    # Contact: [email protected] #
    # http://javazoom.hypermart.net #
    /* Originally compiled from EasyFilter.java */
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.applet.Applet;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.image.MemoryImageSource;
    import java.awt.image.PixelGrabber;
    import java.util.Vector;
    public synchronized class EasyFilter extends Applet implements KeyListener
    private String paramFileName;
    private Color bgColor;
    private Color fgColor;
    private Color parColor;
    private Color sepColor;
    private Color titleColor;
    private Color helpColor;
    private int WinWidth;
    private int WinHeight;
    private String title;
    private String logoFileName;
    private String originalImageFileName;
    private String filteredCaption;
    private String originalCaption;
    private Vector paramsName;
    private Vector paramsValue;
    private Vector paramsComment;
    private Panel panelParameters[];
    private Label labelParameters[];
    private TextField textFieldParameters[];
    private Label labelComments[];
    private int nbParameters;
    private ScrollPane scrollPaneParams;
    private Panel panelParams;
    private Image theLogo;
    private Image theOriginalImage;
    private Image theFilteredImage;
    private int theOriginalPixelArray[];
    private int logoWidth;
    private int logoHeight;
    private int imageWidth;
    private int imageHeight;
    private drawCanvas canvasTitle;
    private Panel panelTitle;
    private Label labelTitle;
    private Panel panelImages;
    private Panel panelOriginalImage;
    private drawCanvas canvasOriginalImage;
    private Label labelOriginalImage;
    private Panel panelFilteredImage;
    private drawCanvas canvasFilteredImage;
    private Label labelFilteredImage;
    private Panel panelHelp;
    private Label labelHelp;
    private int Yspc;
    private FilterImplementation theFilter;
    public void init()
    String string = null;
    string = appletInitialize();
    setBackground(bgColor);
    if (string != null)
    removeAll();
    setBackground(Color.white);
    setForeground(Color.black);
    Label label = new Label(new StringBuffer("Error: ").append(string).toString(), 1);
    Panel panel = new Panel();
    panel.add(label);
    add(panel);
    setLayout(new FlowLayout(1, 5, Yspc));
    public void keyPressed(KeyEvent keyEvent)
    panelHelp.removeAll();
    boolean flag = true;
    if (KeyEvent.getKeyText(keyEvent.getKeyCode()).equals("Enter"))
    for (int i = 0; i < nbParameters; )
    try
    paramsValue.setElementAt(new Double(textFieldParameters.getText()), i);
    i++;
    catch (NumberFormatException e)
    labelHelp.setText(labelParameters[i].getText() + ": Not a Number");
    flag = false;
    break;
    if (flag == 1)
    labelHelp.setText(" .... Running, please wait .... ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    theFilter.updateParameters(paramsValue);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    canvasFilteredImage.repaint();
    panelHelp.removeAll();
    labelHelp.setText("- Done -");
    else
    labelHelp.setText("- Press Enter to run the Filter -");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    public void keyReleased(KeyEvent keyEvent)
    public void keyTyped(KeyEvent keyEvent)
    private String appletInitialize()
    WinWidth = size().width;
    WinHeight = size().height;
    if (getParameter("bgcolor") == null)
    bgColor = new Color(0, 0, 40);
    else
    bgColor = new Color(Integer.parseInt(getParameter("bgcolor"), 16));
    if (getParameter("fgcolor") == null)
    fgColor = new Color(255, 255, 255);
    else
    fgColor = new Color(Integer.parseInt(getParameter("fgcolor"), 16));
    if (getParameter("sepcolor") == null)
    sepColor = new Color(158, 128, 128);
    else
    sepColor = new Color(Integer.parseInt(getParameter("sepcolor"), 16));
    if (getParameter("parcolor") == null)
    parColor = new Color(24, 24, 24);
    else
    parColor = new Color(Integer.parseInt(getParameter("parcolor"), 16));
    if (getParameter("titlecolor") == null)
    titleColor = new Color(255, 255, 0);
    else
    titleColor = new Color(Integer.parseInt(getParameter("titlecolor"), 16));
    if (getParameter("helpcolor") == null)
    helpColor = new Color(0, 255, 255);
    else
    helpColor = new Color(Integer.parseInt(getParameter("helpcolor"), 16));
    paramsName = new Vector();
    paramsValue = new Vector();
    paramsComment = new Vector();
    paramFileName = getParameter("paramfile");
    String string = readParams(paramFileName);
    if (string != null)
    return string;
    MediaTracker mediaTracker = new MediaTracker(this);
    theOriginalImage = getImage(getDocumentBase(), originalImageFileName);
    mediaTracker.addImage(theOriginalImage, 0);
    if (logoFileName != null)
    theLogo = getImage(getDocumentBase(), logoFileName);
    mediaTracker.addImage(theLogo, 1);
    try
    mediaTracker.waitForAll();
    catch (InterruptedException e1)
    return "Error while loading image";
    if (mediaTracker.isErrorAny())
    return "Error while loading image";
    if (logoFileName != null)
    logoWidth = theLogo.getWidth(this);
    logoHeight = theLogo.getHeight(this);
    imageWidth = theOriginalImage.getWidth(this);
    imageHeight = theOriginalImage.getHeight(this);
    theOriginalPixelArray = new int[imageWidth * imageHeight];
    PixelGrabber pixelGrabber = new PixelGrabber(theOriginalImage, 0, 0, imageWidth, imageHeight, theOriginalPixelArray, 0, imageWidth);
    try
    pixelGrabber.grabPixels();
    panelTitle = new Panel();
    canvasTitle = new drawCanvas();
    labelTitle = new Label();
    panelTitle.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelTitle);
    panelTitle.setBackground(bgColor);
    panelTitle.add(canvasTitle);
    canvasTitle.setImage(theLogo);
    canvasTitle.setBounds(0, 0, logoWidth, logoHeight);
    labelTitle.setText(title);
    catch (InterruptedException e2)
    return "Internal Error, Try RELOAD !";
    if (title != null)
    panelTitle.add(labelTitle);
    labelTitle.setForeground(titleColor);
    labelTitle.setFont(new Font("Dialog", 1, 14));
    panelImages = new Panel();
    panelOriginalImage = new Panel();
    canvasOriginalImage = new drawCanvas();
    labelOriginalImage = new Label();
    panelFilteredImage = new Panel();
    canvasFilteredImage = new drawCanvas();
    labelFilteredImage = new Label();
    panelImages.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelImages);
    panelImages.setBackground(bgColor);
    panelOriginalImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelOriginalImage);
    panelOriginalImage.setBackground(Color.black);
    panelOriginalImage.add("Center", canvasOriginalImage);
    canvasOriginalImage.setImage(theOriginalImage);
    canvasOriginalImage.setBounds(0, 0, imageWidth, imageHeight);
    labelOriginalImage.setText(originalCaption);
    labelOriginalImage.setAlignment(1);
    panelOriginalImage.add("South", labelOriginalImage);
    labelOriginalImage.setBackground(Color.lightGray);
    labelOriginalImage.setForeground(Color.black);
    labelOriginalImage.setFont(new Font("SansSerif", 0, 10));
    panelFilteredImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelFilteredImage);
    panelFilteredImage.setBackground(Color.black);
    panelFilteredImage.add("Center", canvasFilteredImage);
    theFilter = new FilterImplementation(paramsValue, theOriginalPixelArray, imageWidth, imageHeight);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    labelFilteredImage.setText(filteredCaption);
    labelFilteredImage.setAlignment(1);
    panelFilteredImage.add("South", labelFilteredImage);
    labelFilteredImage.setBackground(Color.lightGray);
    labelFilteredImage.setFont(new Font("SansSerif", 0, 10));
    scrollPaneParams = new ScrollPane(0);
    panelParams = new Panel();
    nbParameters = paramsName.size();
    int i = WinHeight - (33 + 7 * Yspc + logoHeight + imageHeight + 23);
    if (i < Yspc + 2 + 24)
    i = Yspc + 2 + 24;
    scrollPaneParams.setBounds(0, 0, WinWidth - 10, i);
    panelParams.setLayout(new GridLayout(nbParameters, 1, 5, Yspc / 2));
    scrollPaneParams.add(panelParams);
    panelParams.setBackground(sepColor);
    panelParameters = new Panel[nbParameters];
    labelParameters = new Label[nbParameters];
    textFieldParameters = new TextField[nbParameters];
    labelComments = new Label[nbParameters];
    for (int j = 0; j < nbParameters; j++)
    panelParameters[j] = new Panel();
    panelParameters[j].setLayout(new FlowLayout(0, 5, 1));
    panelParams.add(panelParameters[j]);
    panelParameters[j].setBackground(parColor);
    labelParameters[j] = new Label();
    labelParameters[j].setText((String)paramsName.elementAt(j));
    panelParameters[j].add(labelParameters[j]);
    labelParameters[j].setForeground(fgColor);
    labelParameters[j].setFont(new Font("Dialog", 1, 12));
    textFieldParameters[j] = new TextField(8);
    textFieldParameters[j].setText(paramsValue.elementAt(j).toString());
    panelParameters[j].add(textFieldParameters[j]);
    textFieldParameters[j].setBackground(fgColor);
    textFieldParameters[j].addKeyListener(this);
    labelComments[j] = new Label();
    labelComments[j].setText((String)paramsComment.elementAt(j));
    panelParameters[j].add(labelComments[j]);
    labelComments[j].setForeground(fgColor);
    add(scrollPaneParams);
    panelHelp = new Panel();
    labelHelp = new Label();
    panelHelp.setLayout(new FlowLayout(1, 5, 0));
    add(panelHelp);
    panelHelp.setBackground(bgColor);
    labelHelp.setText(" Change colour values and press enter ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    labelHelp.setForeground(helpColor);
    return null;
    private String readParams(String string1)
    Object object1;
    String string2;
    if (string1 == null)
    return "Filename of filter's parameters needed";
    try
    URL uRL = new URL(getDocumentBase(), string1);
    URLConnection uRLConnection = uRL.openConnection();
    uRLConnection.setDoInput(true);
    uRLConnection.setUseCaches(false);
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream()));
    string2 = null;
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    if (bufferedReader != null)
    Object object2;
    try
    for (object2 = bufferedReader.readLine(); object2 != null && string2 == null; object2 = bufferedReader.readLine())
    string2 = extractFormat(object2);
    catch ()
    string2 = object2.getMessage();
    finally
    bufferedReader.close();
    if (string2 != null)
    return string2;
    else
    return null;
    private String extractFormat(String string1)
    if (string1.length() == 0)
    return null;
    int i = 0;
    int j = string1.indexOf(" ", i);
    if (j == -1)
    return "Bad format error (space missing)";
    String string2 = string1.substring(i, j);
    if (string2.equals("TITLE"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    title = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    originalCaption = string1.substring(i, j);
    return null;
    if (string2.equals("FILTEREDCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    filteredCaption = string1.substring(i, j);
    return null;
    if (string2.equals("LOGO"))
    i = j + 1;
    j = string1.length();
    logoFileName = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALIMAGE"))
    i = j + 1;
    j = string1.length();
    originalImageFileName = string1.substring(i, j);
    return null;
    if (!string2.equals("PARAM"))
    return null;
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    paramsName.addElement(string1.substring(i, j));
    i = j + 2;
    j = string1.indexOf(32, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    try
    paramsValue.addElement(new Double(string1.substring(i, j)));
    j = string1.indexOf(34, i);
    catch (NumberFormatException e)
    return "Bad format in a PARAM line";
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    paramsComment.addElement(string1.substring(i, j));
    return null;
    public EasyFilter()
    logoHeight = 33;
    Yspc = 5;

    Addition to my above submission
    To clarify, I'll offer the US$20 to the FIRST person who offers me a workable solution to the problem, not to everyone!!!
    JMGRAHAM

  • Finding and retrieving an XML file from an application and an applet

    I have a problem.
    I have data stored in an XML file. I want to be able to call that file and store it into a document object from an application standing alone on a computer as weel as from an applet that would be running over the web.
    I don't know how to do this.
    When I use a relative path name for the application it attaches the path of the folder that contains java.exe. I could do something with the class path but this wouldn't help the end user of the application on a different computer. For similar reasons I don't want to hard code because I don't know where the final applet will be stored.
    I have a table that holds, sorts and filters the data so I want the table to collect the data, I don't want to dictate the path from the applet or the application, I want a method that is consistant with both scenarios.
    Can anyone offer some advice?

    I've just finished trying it out, here is what I did:
    String xmlDocName="filename.xml";
    java.net.URL fileURL=this.getClass().getResource(xmlDocName);
    private final String fileName = fileURL.toString().substring(6);
    The substring removes the "file:/" from the URL.
    This works fine in the IDE, I have even stored the xml file in a lower folder e.g. package_folder/xml_folder/filename.xml and replaced the xmlDocName with "xml_folder/filename.xml" and it worked fine.
    I haven't tried it in an applet because I'm running IE and as you are well aware there are problems with swing and IE applets. But you answer deserves the Duke Dollars, thank you very much.

  • (Solved) obmenu and blueman-applet won't start

    Hi,
    after update the obmenu and blueman-applet won't start. googleing arround only says the the problem is fixed.
    obmenu:
    Traceback (most recent call last):
      File "/usr/bin/obmenu", line 21, in <module>
        import obxml, gtk, gtk.glade, gobject, random, time, os, sys
    ImportError: No module named obxml
    blueman-applet
    Traceback (most recent call last):
      File "/usr/bin/blueman-applet", line 40, in <module>
        from blueman.Constants import *
    ImportError: No module named blueman.Constants
    Last edited by LRRR (2010-10-13 17:25:27)

    based on your informations( which is lacking) i'm guessing that you are using testing, mostly because only from there you can get "after updates".
    if this indeed is the case, be sure you have community-testing enabled too

  • What're the differences between JSP, Java Script, and Java Applet?

    I am confused by the concepts: JSP (Java Server Page), Java Script, and Java Applet? What are their main differences?

    I don't know about differences, but one of their main similarities is that each of them has a page in Wikipedia.
    JSP
    JavaScript
    [Java applet|http://en.wikipedia.org/wiki/Java_applet]
    There. That should give you enough information.

  • How do you highlight iHelp Buttons and List Applet fields

    How do you highlight iHelp Buttons and List Applet fields? I've followed all the steps in the Bookshelf but it seems like buttons and list applet fields do not highlight. The highlight feature only seems to work in form applets. Is this a known issue? Are there workarounds for this?
    Thanks
    Bernhard
    Edited by: Bernhard on Dec 12, 2011 2:06 PM

    Bernhard
    I remember that colors of single list applet fields cannot be changed, since the whole list is regarded as one "control" itself. It works for single fields in form applets (as you said) but not in list applets. There is a document in MyOracleSupport pointing this out, but at the moment I can't find it.
    Regarding iHelp Buttons I have no idea.

  • CFGRID and CFTREE applets not working

    Problem I can't figure out: On my production machine
    ColdFusion outputs an OBJECT tag for a CFGRID or CFTREE generated
    applet and everything works fine. On my dev machine (same OS
    (Windows 2003, patch level, CF 5 service pack, same code) for some
    reason ColdFusion outputs an EMBED tag for the CFGRID or CFTREE
    generated applet ... and the applet doesn't work or show up. I
    applied all patches and fixes for CF 5. I'm using XP and IE 6
    against these two systems. It has to be a ColdFusion or server
    setting somewhere. I've tried it on a number of machines and the
    Java VM version of the requesting machine doesn't seem to matter.
    Thanks!

    Hi,
    May be this
    thread
    will help you to fix your problem.

  • Greek lettets and java applet???

    Hello,
    I'm using Linux and i have a problem with the greek letters on the java applets on web pages....
    instead of greek letters i see little squares...
    i don't have much experience nor with linux neither with java.........
    (Sorry for my bad english)
    can u help me please?

    Are you using a browser on the Linux box and it can not display the Greek letters in the applets?
    Or is the Linux box running a servlet engine and is there a problem with the HTML pages and the applets coming from it?
    Edited by: BIJ001 on Sep 27, 2007 10:43 AM

  • Is it possible to LOAD and INSTALL applet during pre-personalization?

    Hi Friends..
    Currently, i use JCOP card
    I want to know the other way to LOAD and INSTALL applet not through CardManager..
    I mean, is it possible to LOAD and INSTALL applet during pre-personalization time?.
    Thanks in advance

    Hi,
    i want to LOAD and INSTALL Applets while pre-personalization phase..
    No, i don't want to defer the LOAD and INSTALL..In the past, we have used the pre-personalisation phase to load KDC keys onto a card and remove the ISK and set issuer specific identifiers (IIN and CIN) etc. You could also load your applet at this time if you wish. You can also load the applets at personalisation.
    How do you plan on doing the personalisation phase? If you were to use a GP scripting environment for example, the CAP files are embedded as a part of the install scripts and only loaded onto a card when you begin executing your personalisation scripts. Since I assume you will be using the small desktop printers mentioned in a different thread, you may be better off integrating the applet loading into your personalisation code (printer integration) so you do not need to double handle cards.
    Actually, is it possible to LOAD and INSTALL applet if we don't authenticate to the CardManager?..There are ways to load and install an applet without explicitly calling INIT UPDATE and EXTERNAL AUTH, but you still need to be authenticated to the card manager, otherwise anyone could manage card content. You can use install tokens and delegated management (which are all outlined in the GO Card Spec).
    Cheers,
    Shane

  • SetStartDate() and setEndDate() applet methods not working

    I am Using setStartDate() and setEndDate() applet methods to set Start and End Date of my XACUTE output. But its not working.
    document.<appletname>.getQueryObject().setStartDate(<Start Date>);
    document.<appletname>.getQueryObject().setEndDate(<End Date >);
    This is the part of the code i am using.

    Hi,
    It seems you are trying with proper format following things i can suggest.
    Check date time format which you are passing should be correct.
    also you can try setParam(SD,StartDate) and setParam(ED,EndDate)
    hope it helps!!
    Regards,
    Manoj Bilthare

  • Error when Load and Install Applet on physical Card

    Hi all,
    when I load and install Applet on physical Card, i making an error:
    SELECT
    -> 00 A4 04 00 07 A0 00 00 00 18 43 4D
    [ERROR  ] <- 6E 00
    Message: Authentification Fails
    Can anyone help me?
    Thanks!

    are you sure your card is a java card ?

  • Access Terminal and select applet

    Hi people,
    I have a question about to run the aplet in a javacard. Is there any code or other useful material about getting terminal and select applet and run the methods of the apllet in a programmable manner? Thanks for your interest...
    Edited by: POLAT on Mar 16, 2009 7:41 PM

    Honestly I haven't figured out how to pass a pin when selecting the applet, however at the minute I have a way around it:
    you will see in teh code below, I have hardcoded a default pin and I have a pin update method that can be called via a apdu,
    NOTE this example works with the code above:
    *Applet ID 41 63 63 6F 75 6E 74 41 70 70 6C
    public class AccountApplet extends Applet {
         final static byte ACCOUNT_CLA = (byte)0xB0;
         final static byte VERIFY = (byte) 0x20;
         final static byte CREDIT = (byte) 0x30;
         final static byte DEBIT = (byte) 0x40;
         final static byte GET_BALANCE = (byte) 0x50;
         final static byte UPDATE_PIN = (byte) 0x60;
         final static short MAX_BALANCE = 10000;
         final static byte MAX_TRANSACTION_AMOUNT = 100;
         final static byte PIN_TRY_LIMIT =(byte)0x03;
         final static byte MAX_PIN_SIZE =(byte)0x08;
         // Applet-specific status words:
         OwnerPIN pin;
         short balance = 109; // Starting balance of decimal 109 is 6D in hex
         public static void install(byte[] bArray, short bOffset, byte bLength) {
                        new AccountApplet(bArray, (short) (bOffset + 1), bArray[bOffset]);
         private AccountApplet(byte[] bArray, short bOffset, byte bLength){
              pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
              // bArray contains the default PIN initialization value (12345)
              bArray[0] = 01;
              bArray[1] = 02;
              bArray[2] = 03;
              bArray[3] = 04;
              bArray[4] = 05;
              bOffset = 0;
              bLength = 5;
              pin.update(bArray, bOffset, bLength);
              register();
         public boolean select() {
         if (pin.getTriesRemaining() == 0)
                   return false;
              return true;
    public void deselect() {
         pin.reset();
         public void process(APDU apdu) {
    byte[] buffer = apdu.getBuffer();
              if (selectingApplet())
                   return;
              if (buffer[ISO7816.OFFSET_CLA] != ACCOUNT_CLA)
                   ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
              switch (buffer[ISO7816.OFFSET_INS]) {
              case GET_BALANCE:          getBalance(apdu);      return;
              case DEBIT:                    debit(apdu);             return;
              case CREDIT:               credit(apdu);           return;
              case VERIFY:               verify(apdu);          return;
              case UPDATE_PIN:          updatePin(apdu);     return;
              default:                    ISOException.throwIt
              (ISO7816.SW_INS_NOT_SUPPORTED);
    private void credit(APDU apdu) {
              if (!pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
         byte numBytes = buffer[ISO7816.OFFSET_LC];
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (( numBytes != 1 ) || (byteRead != 1))
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
              byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
              if (( creditAmount > MAX_TRANSACTION_AMOUNT)
                        || ( creditAmount < 0 ))
                   ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
              if ((short)( balance + creditAmount)  > MAX_BALANCE)
                   ISOException.throwIt(SW_EXCEED_MAXIMUM_BALANCE);
              balance = (short)(balance + creditAmount);
              return;
         private void updatePin(APDU apdu) {
              if (! pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
              byte numBytes = buffer[ISO7816.OFFSET_LC];
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
                   if (byteRead != numBytes) {
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                   if ( numBytes > 8 )
                   ISOException.throwIt(SW_PIN_TO_LONG);
              if ( numBytes < 4 )
                   ISOException.throwIt(SW_PIN_TO_SHORT);     
              short offset_cdata = 05;          
              pin.update(buffer, offset_cdata, numBytes);
              pin.resetAndUnblock();
         private void debit(APDU apdu) {
              if (! pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
              byte numBytes = (byte)(buffer[ISO7816.OFFSET_LC]);
         byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (( numBytes != 1 ) || (byteRead != 1))
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
         byte debitAmount = buffer[ISO7816.OFFSET_CDATA];
              if (( debitAmount > MAX_TRANSACTION_AMOUNT)
                        ||  ( debitAmount < 0 ))
                   ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
              if ((short)( balance - debitAmount ) < (short)0)
                   ISOException.throwIt(SW_NEGATIVE_BALANCE);
              balance = (short) (balance - debitAmount);
         }      private void getBalance(APDU apdu) {
              byte[] buffer = apdu.getBuffer();
              short le = apdu.setOutgoing();
              apdu.setOutgoingLength((byte)2);
         Util.setShort(buffer, (short)0, balance);
              apdu.sendBytes((short)0, (short)2);
          * verification method to verify the PIN
         private void verify(APDU apdu) {
              byte[] buffer = apdu.getBuffer();
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (pin.check(buffer, ISO7816.OFFSET_CDATA,byteRead)
                        == false)
                   ISOException.throwIt(SW_VERIFICATION_FAILED);
         } // end of verify method
    } // end of class Account

  • Differences between Java Web Start and HTML-Applets???

    Hi,
    I'm trying to get information about the differences between JWS-Applets and 'normal' HTML-embedded Applets.
    Is it possible to develop both simultaneously in one project???
    Is there a Programming-documentation that describes the differences between JWS and HTML-Applets???
    Thanx!
    Rembrand

    Check out the link shown below:
    http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html
    All you need really is to create a JNLP file to launch your applet/application.
    ;o)
    V.V.

  • Problem with JRE and Yahoo applets

    Hi, I couldn't find any answer for this anywhere else...
    Whenever I try to play a Yahoo game, certain windows will "shake". For example, if I log into yahoo, then go to play their spades game, the applet will load without any problem. The game room will appear and everything seems to be fine. But if I click on the Start Panel, the borders of the Start menu will "shake" If I right click on anything, that menu will also shake. This only occurs while JRE is running the yahoo applet. Once I leave the yahoo game, everything returns to normal. If I use IE and MSVM, this problem does not occur. This problem does not seem to occur with other instances of Java either. Only Yahoo games. I tried searching Yahoo for an answer to this, but didn't find anything. When I tried getting help from them, they replied with an email to update Java and/or my browsers. Well, I am using version 1.4.2_04 of java, and have IE6 updated as of today. Also, I am using Opera version 7.54 and Firefox 0.93. This problem with Java and Yahoo occurs no matter which browser I am using. The only way to keep this from happening seems to be to use IE with MSVM. Any ideas?

    That page does apply. Everything that you have written indicates conclusively that the Yahoo game you're playing is the source of the problem. The fact that it works with the MS jvm but not with the Sun jvm, that the Sun jvm works with other Java applets, etc all say the same thing - that Yahoo applets wer/are coded to work with the MS jvm, which uses MS extensions in violation of the Sun/MS licensing agreements. The statement at the bottom of the page is proof positive - your spades game is not listed by Yahoo as being fixed.
    "07/17/03 - From Yahoo! Customer Care:
    We have deployed a fix for the incompatibilities with the Sun JVM� in the following games:
    Chess Gin Cribbage Euchre Bridge
    Hearts Toki Toki Boom Graffiti Pool
    We plan to upgrade the rest of the games on an ongoing basis. "
    The Yahoo applet is the problem and requires repair...

  • Flash Player linux, grey box issue (youtube vids and some applets do not display)

    I posted this question on my distro-specific forum as well as linuxquestions.org, however it appears to  be a unique problem, so here it is:
    When viewing videos on youtube.com, most other websites, and when trying  to run certain flash games, the flash applet will not display (though  the audio will play). Instead of displaying the flash applet, there  will be a grey box where the flash video or applet would normally be.
    This problem occurs on Firefox and Chromium, but not on Opera.
    My Specs are as follows:
    Distro: PCLinuxOS 2010 (32-bit)
    flash-player-plugin: 10.1-2pclos2010
    firefox: 3.6.6-1pclos2010
    swfdec has never been installed (to my knowledge)
    I did a lot of investigating about the problem but have turned up no  solutions thus far. Here are my results.
    Flash videos and applets which allow  access to the settings menu (like youtube played from their website) do  not display, however flash videos and applets which do NOT allow access  to the settings menu (including youtube videos embedded in other  websites) WILL display.
    Reinstalling flash-player-plugin and firefox through synaptic does  not solve the problem (though note that PCLOS works with rpm files, not  deb files. apt4rpm does not support the remove --purge operation,  however reinstalls are said to overwrite custom configs with stock  ones.)
    Creating a new firefox profile and/or starting FFox in safe-mode  does not solve the problem
    Creating another user and running FFox from that user will  properly display flash videos
    Comparing default plugins between my main user and new user shows  that there is no difference. So this likely rules out a defective  extension or plugin binary.
    Deleting ~/tmp/plugtmp* folders when FFox is closed does not solve  the problem.
    Removing the ~/.macromedia and ~/.adobe folders does not solve the  problem. (have checked permissions between the new test user and main  user, and they are equivalent)
    Downloading libflashplayer.so from the Adobe website and copying it  to /usr/lib/mozilla/plugins has no effect on the problem.
    I'm thinking that there might be somewhere else that flash stores  configurations for my user, and that maybe the settings there are  corrupted and would need to be purged. However frantic googling has  turned up nothing useful so far.
    Does anyone have any suggestions for me?

    The problem, at least in my case, was QtCurve's opacity. If I have opacity set to less than 100%, flash would not display for sites like Youtube and Vimeo, but worked elsewhere.
    The solution for me was to go into qtcurve's settings, and put npviewer.bin in the application exceptions section for window and menu opacity. Doing that, I was able to keep my transparent menus, and also use flash everywhere.
    You can find out what the application name is by launching your browser of choice in a terminal with qtcurve debug turned on, like so:
    QTCURVE_DEBUG=1 firefox
    If you watch through the lines that start with "QtCurve" you'll see "Application name". Look for the one that shows up when you try to load a video. In my case it was npviewer.bin. In yours, it might be nspluginviewer or something else. If you add an exception for that specific application, you'll fix your problem without having to compromise on your theme.

Maybe you are looking for

  • Can iTunes credit vouchers be used when family sharing?

    My son recently redeemed an iTunes voucher on his account but every time he tries to purchase a song, it asks me for permission and to charge it to my account as the administrator. I have been declining because I don't want it charged to my credit ca

  • Procon Latte is not working and the home page is up for sale. Is it still viable?

    It worked fine until last week. I have a password on the settings but nothing is working. Is it still a good add-on?

  • Url location of dynamically created file...

    I have a web app war that I have deployed to weblogic. This war generates some images which I want to point to from my web app browser. 1. Is there a specific directory ( like the default root of the web app ) that I can get access to create these fi

  • Need Help about 3D and revolving in illustrator

    I really need help about 3D, Please tell me that How i create 3D in illustrator i want to revolve text or shape around any object like this, any plugin? or other software required for this? if somebody know this it will be really help full    http://

  • Calculating words per minute

    Hi, trying to write a typing tutor program. Having trouble calculating the words per minute. Does anyone know what Im doing wrong? import java.awt.*; import java.util.Timer; import java.util.TimerTask; import java.awt.Component; import java.awt.Conta