Error in my applet..

ok so i'm working on this small applet for an assignment for one of my programming classes. i've got it nearly completely written, But when i try to view it via the html page that its embedded in, all I get is a big blue square (blue isnt even supposed to be my applet's background...) When i view it on my machine, it doesnt give me any runtime errors, so I have no clue whats going on. I asked my professor for help on it but he wasnt able to give much..
heres a copy of my code:
import java.awt.*;
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
public class gpacalc extends JApplet implements ActionListener
    Container contentPane = getContentPane();
    JTextField [] outfields;
    JLabel out1;
    JLabel out2;
    JLabel out3;
     JTextField course;
     JTextField hours;
     JTextField grdexpt;
     int count = 0;
     int tothours = 0;
     int grdpts = 0;
     int totcredits = 0;
     double gpavg = 0;
    public void init()
    // Create a panel object and set its layout manager to put
    // the components in a column
        JPanel mainpanel = new JPanel();
        mainpanel.setLayout(new GridLayout(15, 2, 5, 5));
        mainpanel.setBackground(Color.yellow);
   // Create a labels for the form
        JLabel title = new JLabel("GPA Calculator");
        JLabel spaceholder = new JLabel(" ");
        JLabel courselab = new JLabel("Enter Course Name");
        JLabel hrslab = new JLabel("Enter Course Hrs.");
        JLabel gradelab = new JLabel("Enter Expected Grade");
        JLabel total = new JLabel("Total Semester Hrs.");
        JLabel grade = new JLabel("Total Grade Credits");
        JLabel gpa = new JLabel("Est. Grade Point Avg.");
     // Creates all of the needed text fields       
        course = new JTextField(30);
        hours = new JTextField(30);
          grdexpt = new JTextField(30);
          out1 = new JLabel("0");
          out2 = new JLabel("0");
        out3 = new JLabel("n/a");
    // Creates the ADD button
        JButton add = new JButton("Add Course Info.");
        add.addActionListener(this);
     // Adds everything to the panel
        mainpanel.add(title);
        mainpanel.add(spaceholder);
        mainpanel.add(courselab);
        mainpanel.add(course);i
        mainpanel.add(hrslab);
        mainpanel.add(hours);
        mainpanel.add(gradelab);
        mainpanel.add(grdexpt);
        mainpanel.add(total);
        mainpanel.add(out1);
        mainpanel.add(grade);
        mainpanel.add(out2);
        mainpanel.add(gpa);
        mainpanel.add(out3);
        mainpanel.add(add);
        mainpanel.add(spaceholder);
          //creates the output text fields in the array
          for(int x=0; x<6; x++)
               outfields[x] = new JTextField(30);
               outfields[x].setEditable(false);
               mainpanel.add(outfields[x]);
    // Now add the panel to the content pane
        contentPane.add(mainpanel);
     }  // End of init()
   public void actionPerformed(ActionEvent ev)
          int credits = 0;
          final int MAX = 6;
          String result = "";
          String grade ="";
          String hrs = "";
          count += 1;//count to see the number of courses added
             if(count<=MAX)
                  //sets result = Coursename - grade
               result = course.getText() + " - " +grdexpt.getText();
               grade = grdexpt.getText();
               //If-else stmts to assign grade point value for given grade
               if(grade.equals("a") || grade.equals("A"))
                    grdpts = 4;
               else if(grade.equals("b") || grade.equals("B"))
                    grdpts = 3;
               else if(grade.equals("c") || grade.equals("C"))
                    grdpts = 2;
               else if(grade.equals("d") || grade.equals("D"))
                    grdpts = 1;
               else
                    grdpts = 0;
                 //Reads in the text for the #hours, and parses it to an int
                 // for calculation.
                 hrs = hours.getText();
               credits = Integer.parseInt(hrs);
               tothours += credits;
               totcredits += (credits*grdpts);
                 gpavg = totcredits/tothours;//calculates GPA
                 //sets hours, credits, gpa fields
                 out1.setText(""+tothours);
                 out2.setText(""+totcredits);
                 out3.setText(""+gpavg);
                 //puts the result string into appropriate field
               outfields[count].setText(result);
               //clears out the input fields.
               course.setText("");
               hours.setText("");
               grdexpt.setText("");
            }//end if
            else
                 course.setText("Max Number of courses");
                 hours.setText("entered, please refresh");
                 grdexpt.setText("your browser.");
} heres the html file code that calls the applet:
<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--gpadispp.html
A document to test the gpacalc JApplet
-->
<html>
<head><title>HTML Document that calls a JApplet </title>
</head>
<body>
<p>
<object codetype="application/java"
  code= "gpacalc.class"
  width="300"
  height="400">
</object>
</p>
</body>
</html>the source file is named gpacalc.java (gpacalc.class after compiled..)
if anyone can help me figure out where i've gone wrong, i'd be greatly appreciative.
thanks,
ceola

thanks for the assistance!
i went through what harmmeijer said, and this is the error it gave me.
java.lang.NullPointerException
     at gpacalc.init(gpacalc.java:82)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
basic: Exception: java.lang.NullPointerException
heres a snip of the code that threw the exception:
          for(int x=0; x<6; x++)
               outfields[x] = new JTextField(30); //Exception thrown here
               outfields[x].setEditable(false);
               mainpanel.add(outfields[x]);
          }i have an idea of what the problem is, i'm going to try and fix it now. thanks again :)
ceola

Similar Messages

  • Error loading java applet

    I downloaded and installed j2se_1.4.1. Now every time I go to a site which needs the java applet, it gives "error loading java applet" (or something like that). I already uninstalled it and reinstalled it, but I keep getting that error. Can someone help me out please??
    I use win XP home and Internet Eplorer 6
    thanx

    I also have the same problem!
    can someone help us PLEASE ?!!!

  • Error while using applet in Jspx

    Hi all,
    I creating an applet application using java 1.6, and run successfully if i run it with HTML page.
    But when i create a jspx page with using oracle webcenter library, i cannot run the applet, it return this error in the java console:
    network: Cache entry not found [url: http://127.0.0.1:7101/Application9-Project1-context-root/faces/, version: null]
    basic: error: Incompatible magic value 1013478509 in class file my/applet/app/client/Applet1.
    java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file my/applet/app/client/Applet1
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file my/applet/app/client/Applet1
    basic: Loading Java Applet Failed...
    security: Accessing keys and certificate in Mozilla user profile: null
    Is there anyone encountered the same problem ?
    Regards,
    Constantin B.

    Not "corrupt", just not a class file at all. The decimal value 1013478509 converts to the hex value 3C68746D, which in ASCII represents "<htm". So the request for a class file returns an HTML file.

  • Error while calling applet in HTML in SAP NWDS

    Hi,
    We have written a java code with Main method and we are trying to run it on web. So we have written another piece of HTML code where we are calling the othe program with applet. But getting below error.
    Below is exce[ption I am getting while running jree charts made in java :
    Java Plug-in 1.6.0_24
    Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    java.lang.reflect.InvocationTargetException
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.InstantiationException: org.jfree.chart.demo.BarChartDemo
    at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.InstantiationException: org.jfree.chart.demo.BarChartDemo
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    ... 15 more
    Exception: java.lang.reflect.InvocationTargetException
    Below is html code run to call applets :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" title="http://www.w3.org/TR/html4/loose.dtd">" class="link">http://www.w3.org/TR/html4/loose.dtd">
    (http://www.w3.org/TR/html4/loose.dtd)
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Hello</title>
    </head>
    <body>
    <applet code=org.jfree.chart.demo.BarChartDemo archive="src.jar" width="320" height="120"></applet>
    </body>
    </html>
    Please suggest.
    Regards
    Agamani

    Hi,
    Though there are a lot of importing parameters, you should give only one structure for outtable, and read as index 1 and index 2.
    FORM GET_SPRAS TABLES intable   STRUCTURE itcsy
                                              outtable  STRUCTURE itcsy.
      DATA: lv_kunnr LIKE kna1-kunnr.
      CLEAR: GV_SPRAS.
      lv_kunnr = intable-value.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = lv_kunnr
        IMPORTING
          output = lv_kunnr.
      SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1
        WHERE KUNNR = lv_kunnr.
      IF sy-subrc = 0.
        READ TABLE outtable INDEX 1.
        outtable-value = gv_spras.
        MODIFY outtable INDEX 1.
        READ TABLE outtable INDEX 2.
        outtable-value = gv_land1.
        MODIFY outtable INDEX 2.
      ENDIF.
      IF gv_land1 EQ 'DE'.
        CLEAR: GV_LAND1,
               GV_SPRAS.
      ENDIF.
    ENDFORM.
    Edited by: Srinivas Kalluri on Mar 30, 2009 5:00 AM
    Edited by: Srinivas Kalluri on Mar 30, 2009 5:10 AM

  • Error while calling applet from Javascript via LiveConnect and WebDriver

    Hi all,
    I am trying to call applet Java code from Javascript via WebDriver.
    Given the following two cases:
    - calling a static method: Integer.parseInt("42")- constructing a new object: new String("Hello world")My Javascript code looks like this:
    document.appletId.Packages.java.lang.Integer.parseInt("42");
    new document.appletId.Packages.java.lang.String("Hello world");When executing this code in Firefox via the Firebug Javascript console everything works fine and I get the expected results. However, when executing this code via the JavascriptExecutor from WebDriver only the call to the static method succeeds, the construction of the new object leads to the following error: "Attempt to call a default method on object with no invokeDefault method."
    I don't have any idea what is going wrong here, so any help would be greatly appreciated.
    Thanks!

    Hello Gerard, Hello Krishna,
    -> The liveCache application failed with COM error::
                                   40028 Illegal timestamp in rough timegrid
    More details about COM error 40028 you will see in TA /n/sapapo/om10
         -> Return code: 40028 -> execute ::
    Invalid time stamp in the time buckets profile relation     
    ( om_ts_tgrelinvalidstamp )     
       < click on '?' mark >
    -> Open an OSS message in accordance with SAP note 167280 if further help
         needed to solve the issue on your system.
    Thank you and best regards, Natalia Khlopina

  • ClassNotFound error while running applet from Web application

    hi everyone,
    I have a web application deployed in Tomcat web server. I have HTML file at the level of WEB-INF. And all class files under WEB-INF/classes. But while ruuning the application it giving following error.
    load: class com.app.AppletTest not found.
    java.lang.ClassNotFoundException: com.app.AppletTest
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Here the HTML file applettest.html
    <html>
         <head>
              <title>Multiple Image Upload</title>
         </head>
         <body>
              <applet code="com.app.AppletTest" width="300" height="300">
              </applet>
         </body>
    </html>
    And Java applet file is
    package com.app;
    import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Graphics;
    public class AppletTest extends Applet
         public void init()
              System.out.println("Init called");
              this.setBackground(new Color(180,200,250));
         public void start()
              System.out.println("Start called");
         public void paint(Graphics g)
              g.drawString("welcome Hello World",50,50);
              System.out.println("Paint called");
         public void stop()
              System.out.println("Stop called");
         public void destroy()
              System.out.println("Destroy called");
    Thanks.

    Hi,
    if u put ur com.app.AppletTest file @ WEB-INF Directry, then this problem will solve easily.
    you have to put applet package(com.app.AppletTest) @ WEB-INF Directry. Since
    Applet is using by html, u have to keep applet with html file.
    if applet class have interaction with other classes, u have to seperate all related class to applet to seperate package and put them @ WEB-INF folder.

  • Error with signed applet "class can't be instantiated"

    hi,
    I developed an applet to make a ftp connexion to upload files from the local disk and the applet is already signed. At first I compiled it with the 1.4 version and I got (from other computers) the error "class not found". Then I used the target 1.1 option and now I get the error "class can't be instantiated"
    Do I need any additional code?
    I am using all these imports
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.JComponent;
    import javax.swing.JProgressBar;
    import javax.swing.*;
    Thanks

    go to
    Tools->Internet Options->Advanced
    Look for "Java (Sun)" (normally near Microsoft VM). I uncheck all the Microsoft VM options but am not sure if that is really necessary.
    Also play with Control Panel, you should see "Java Plug-in" in there and be able to configure browsers a bit with that.

  • Javascript error while invoking applet method

    Hi All,
            I am using some javascript to handle the applet in an irpt file. When I invoke the method getRowCount() on an applet(document.appletname.getRowCount()) I am getting the below error.  But this error comes only when my network bandwidth is low. When my network bandwidht is high I am not getting this error. Does anyone know how to handle this error .
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Wed, 6 Jul 2011 03:31:28 UTC
    Message: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    Line: 192
    Char: 2
    Code: 0
    Thanks in advance
    Shaji

    Hi,
             Below is my code where I am using an ICommand Applet to execute a query in the database and fetch the records. When I try to find the total number of records returns by the query in the IRPT page using document.SearchData.getRowCount() I am getting the below error. When I run thru citrix everything is working fine. But when I run thru Lan I am getting this error
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Wed, 6 Jul 2011 03:31:28 UTC
    Message: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    Line: 192
    Char: 2
    Code: 0
    Applet code in IRPT file
    <APPLET NAME="SearchData" CODEBASE="/XMII/Classes" CODE="iCommand" ARCHIVE="illum8.zip" WIDTH="1" HEIGHT="1" MAYSCRIPT>
              <PARAM NAME = "QueryTemplate" VALUE="XXXXX_ProcessMessages/XX_Integration/XXXXX/Receiver/GUI_IN/GUIQuery_IN">
              <PARAM NAME = "DisplayTemplate" VALUE="XXXX_ProcessMessages/XX_Integration/XXXXX/Receiver/GUI_IN/GUI_IN_iCommand">
              <PARAM NAME="InitialUpdate" VALUE="false">
              <PARAM NAME="UpdateEvent" VALUE="displayResults">
         </APPLET>
    Regards
    Shaji
    Edited by: Shajikc on Jul 6, 2011 4:35 PM

  • Error Message in Applet

    Does anyone know what could cause the following error message?
    I have tried putting "System.err.println("Test");" into my code, so that when I run it in TextPad I can see what is going on. However, even if I put it as the first line of init, nothing appears!
    Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle sun.applet.resources.MsgAppletViewer, key appletpanel.badattribute.exception
    at java.util.ResourceBundle.getObject(ResourceBundle.java:314)
    at java.util.ResourceBundle.getString(ResourceBundle.java:274)
    at sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:39)
    at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:666)
    at sun.applet.AppletPanel.init(AppletPanel.java:182)
    at sun.applet.AppletViewer.<init>(AppletViewer.java:175)
    at sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.java:80)
    at sun.applet.AppletViewer.parse(AppletViewer.java:1062)
    at sun.applet.AppletViewer.parse(AppletViewer.java:996)
    at sun.applet.Main.run(Main.java:138)
    at sun.applet.Main.main(Main.java:80)
    Any suggestions would be much appreciated.
    JB

    It is because you have in html applet tag parameter "with" or "height" set to xx% and it should be set to exact value when you run applet in appletviewer.

  • Error message in applets

    Hi,
    I have got the following error message :
    ava.lang.SecurityException: class "ImageFilter3"'s signer information does not match signer information of other classes in the same package
         at java.lang.ClassLoader.checkCerts(Unknown Source)
         at java.lang.ClassLoader.preDefineClass(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    when i have generated a certificate for an applet and installed it on my system. when i am trying to run the following applet in Internet explorer i got the above exception. How can i solve it...
    bye

    :) never mind, stupid mistake! (another) but i'm sure there will be more!
    quick question though (so i dont' waste the thread)
    when i close my browser when i've loaded my own applet, the browser eats resources to the point where it freezes my AMD2.4ghz 512mb ram computer! :(
    any suggestions?

  • I use blackboard, since the latest update to 3.6.14, I get errors with caching applets, use IE and works fine. Whats happened and what can I do to resolve it?

    Error Cache:
    Unable to update files in cache.
    Name: myApplet
    java.net.MalformedURLException: no protocol: jar/dragndrop_applet.jar
    I get a bunch of these Cache Errors. Happens with application only, its blackboard hosted by continuinged.uml.edu.
    Run the same thing using IE it has no problems. Firefox till the latest upgrade was also working fine.
    What can I do to resolve this problem?

    There's a bug in 3.6.14 with Java applets. 3.6.15 was released last Friday to fix that bug. Use '''Help > Check for Updates''' to start the update process to 3.6.15.

  • "java.rmi.UnmarshalException: error unmarshalling" at Applet with RMI comm.

    Hello,
    I am trying to make an Applet work with an RMI server, but i keep getting the same exception again and again whatever i do.
    More specifically, i get the following :
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.net.MalformedURLException: unknown protocol: c
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at server.ClientDemo.initGUI(ClientDemo.java:100)
         at server.ClientDemo.<init>(ClientDemo.java:85)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.MalformedURLException: unknown protocol: c
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at sun.rmi.server.LoaderHandler.pathToURLs(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
         at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
         at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
         at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
         at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         ... 13 more
    The exeption is thrown at the following line :
                   remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
    This is the code of the server which seems to be running ok:
    if(System.getSecurityManager()==null)
                   System.setSecurityManager(new SecurityManager());
              registry = LocateRegistry.createRegistry(1099);
              RMIServer sr=(RMIServer) UnicastRemoteObject.exportObject(new ServerDemo(),1099);
              registry.rebind(RMIServer.REGISTRY_NAME, sr);
    and the client:
    registry = LocateRegistry.getRegistry("localhost");
    remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
    Thank you in advance
    Alex
    Forgot to mention that i am setting the security policy and codebase programmatically:
    System.setProperty("java.security.policy","C:\\Users\\Alex\\workspace\\Demo\\grantall.policy");
              System.setProperty("java.rmi.server.codebase","C:\\Users\\Alex\\workspace\\Demo\\bin");
    Edited by: Alkon on May 15, 2008 4:31 PM

    I edited the code that sets the security and i am now getting the following error, again at the lookup:
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.io.EOFException
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at server.ClientDemo.initGUI(ClientDemo.java:101)
         at server.ClientDemo.<init>(ClientDemo.java:91)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.EOFException
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 15 more

  • ERROR in my applet program

    When I execute my applet, it gives me this error:
    Exception in thread "main" java.lang.NoSuchMethodError: main
    However when it runs in the appletviewer fine. Heres the code:
    import java.applet.Applet;
    import java.awt.*;
    import javax.swing.*;
    public class slideshow extends Applet implements Runnable
            //creates the main thread
         Thread mainthread=null;
         //the amount of sleep time for the thread
         int time=2000; //milliseconds
            int x=1;
            int numberofimages=5; //this variable is needed since the paint function will know how many
            private Image bgimage1;
            private Image bgimage2;
            private Image bgimage3;
            private Image bgimage4;
            private Image bgimage5;
            String parameter;
         public void init()
                    parameter = getParameter("totalimages");
                    int numimages = (parameter==null? 0:Integer.parseInt(parameter));
                    numberofimages=numimages;//setting the global to this value
                    String imagename = getParameter( "name" );
                    String imagename2 = getParameter( "name2" );
                    String imagename3 = getParameter( "name3" );
                    String imagename4 = getParameter( "name4" );
                    String imagename5 = getParameter( "name5" );
                    bgimage1=getImage(getDocumentBase(), imagename);
                    bgimage2=getImage(getDocumentBase(), imagename2);
                    bgimage3=getImage(getDocumentBase(), imagename3);
                    bgimage4=getImage(getDocumentBase(), imagename4);
                    bgimage5=getImage(getDocumentBase(), imagename5);
              //constructs the thread
              mainthread=new Thread(this);
              //starts the thread
              mainthread.start();
        public void run(){
              while(mainthread!=null)
                    {try{
                  //makes the thread sleep
                  mainthread.sleep(time);
              catch(Exception e){}
              //repaints the applet
              repaint();
        public void stop()
              if(mainthread!=null){mainthread.stop();}
        public void paint(Graphics g)
                if (x==1)
                   g.drawImage(bgimage1,0,0,getWidth(),getHeight(),this);
                   //draws image the full size of the applet
                if (x==2)
                   g.drawImage(bgimage2,0,0,getWidth(),getHeight(),this);
                if (x==3)
                   g.drawImage(bgimage3,0,0,getWidth(),getHeight(),this);
                if (x==4)
                   g.drawImage(bgimage4,0,0,getWidth(),getHeight(),this);
                if (x==5)
                   g.drawImage(bgimage5,0,0,getWidth(),getHeight(),this);           
                x++;
                if (x>numberofimages)
                   x=1; 
    //end     
    }     

    When you say "execute" do you mean you are trying to launch your Applet as an application like:
    java slideshow
    That won't work because your code is only an Applet. When you invoke a class with the java.exe command, you need a main method and your code doesn't have one. You'll also need to explicitly call init() and run(), and you'll need to provide a Frame to hold your Applet.

  • Jdbc-odbc error in an applet

    I'm trying to use a jdbc-odbc driver to connect to a db. When I do this using an application I have not problems but I'm trying to do the same in an applet and I get this error message:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc
    Here is the part of the program where it happens
    try {
    Class.forName(driver);
    } catch(Exception ex) {
    setError("Can't find Database driver class: " + ex);
    return;
    I hope you can tell me

    copy this line in {jre}/lib/java.policy
    jre = java runtime directory
    permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc";

  • Error when deleting applet from card

    I have a JCOP 41 card, where I am working with.
    I use the JCOP plugin (3.1.0.5) within Eclipse (SDK 3.0.1).
    I've uploading some applets to my card, but there resides 1 applet on my card that I can't remove anymore, the other can be removed correctly.
    Here is a log including a correct removal and an incorrect removal of an applet.
    LOG
    cm> card-info
    Card Manager AID : A000000003000000
    Card Manager state : OP_READY
    Application: SELECTABLE (--------) "phil0Display"
    Application: SELECTABLE (--------) "phil0Wallet"
    Load File : LOADED (--------) A0000000035350 (Security Domain)
    Module : A000000003535041
    Load File : LOADED (--------) "phil0pkDisplay"
    Module : "phil0Display"
    Load File : LOADED (--------) "phil0pkWallet"
    Module : "phil0Wallet"
    cm> delete |phil0Wallet
    cm> delete |phil0pkWallet
    cm> delete |phil0Display
    jcshell: Error code: 6985 (Conditions of use not satisfied)
    jcshell: Wrong response APDU: 6985
    cm> card-info
    Card Manager AID : A000000003000000
    Card Manager state : OP_READY
    Application: SELECTABLE (--------) "phil0Display"
    Load File : LOADED (--------) A0000000035350 (Security Domain)
    Module : A000000003535041
    Load File : LOADED (--------) "phil0pkDisplay"
    Module : "phil0Display"
    What is going wrong here ??
    Is my card corrupt ??
    Thanks beforehand.

    There are circumstances where you cannot delete an applet (see Java Card spec). For example, if a static field of a class holds a reference to an object belonging to that applet's context. Nevertheless, you should be able to delete the entire package using the following shell command:
    delete -r <PKGAID>

  • Error on installing applet into JAVA Simulator

    Hello all, i have a very basic question (well...for this you can see how newbie i am...)
    I'm having problems installing an applet into the simulator.
    My helloWorld.src file looks like this:
    powerup;
    // Select the installer applet
    0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
    // create HelloWorld
    0x80 0xB8 0x00 0x00 0x0b 0x09 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x1 0x00 0x7F;
    // Select HelloWorld
    0x00 0xA4 0x04 0x00 9 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x1 0x7F;
    powerdown;I run cref like this:
    cref -o demoeeand apdutool like this:
    apdutool helloWorld.scr > hello.outthen, the result i get is:
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    Opening connection to localhost on port 9025.
    Connected.
    Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x01
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 90, SW2: 00
    CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 0b, 09, a0, 00, 00, 00, 62, 03, 01, 0c, 01, 00, Le: 00, SW1: 64, SW2: 43
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 0c, 01, Le: 00, SW1: 6d, SW2: 00so, the 6443 means
    Applet not found for installation.
    �Cause: An attempt was made to create an applet instance, but the applet code was not installed on the card.
    �Solution: Verify that the applet package has been downloaded to the card.
    so, what step did i miss here??
    thank you
    PS: i also tried with JCWDE but the error was the same
    Message was edited by:
    Helri

    I've noticed that my applet uses the java.lang package. For what i've read the CREF only has installed the Installer Applet and the javacard.framework package, so can that be the problem? i.e., do I have first to load the java.lang package into the simulator??
    I really need help...i'm literally stuck on this....

Maybe you are looking for

  • How do i use my itunes giftcards for clash of clans

    i'm having difficulty paying for gems in clash of clans with an itunes gift card.  they want a credit card, but i don't have one.  thanks.

  • Unable to add mp3 files to iTunes 10.3.1.55 (Windows 7)

    Issue:  iTunes and Windows explorer crash (freeze, locks up, stops working) when I add mp3's to iTunes.  I am using the drag and drop method but have also tried the File>Add File... option.  Same result. After this occurs, I have to open the Task Man

  • Deployment ADF BC Application

    This Is a first time for deploying ADF BC application and I use JDeveloper 11g (TP3) and I have Stand alone OC4J 10.1.3.2.but I can not deploy the application please for all the experience persons please I want step by step for deploying the ADF appl

  • Content-aware-fill and magic-wand-tool

    Hello! I use the content-aware-fill to remove some text from a photo. To do so, I use the "Polygonal Lasso Tool", select the text with a generous border and click edit -> fill -> content-aware-fill. This works fine, but selecting a text with the lass

  • Boot Camp 5 Download Issue

    Boot Camp 5.05.033 is supposed to be a .zip file.  However, after the dl I don't see this but do see:  Two blue folders (Boot camp and $WinPeDriver$) and an .xtml "page."  The folders contain several files each, none of which are .zip.  Am I download