Applet NullPointerException/noClassDefFound

Hi,
i'm new to Java and VERY new to applets. I have an applet that works fine when i start it from eclipse, but when i try starting it in a browser window i get the following Exception:
Java(TM) Plug-in: Version 1.4.2_05
C:/Inetpub/wwwroot/SampleFish/bichlbach.dxf
java.lang.ExceptionInInitializerError
     at org.geotools.cs.LocalCoordinateSystem$Cartesian.<init>(LocalCoordinateSystem.java:87)
     at org.geotools.cs.LocalCoordinateSystem.<clinit>(LocalCoordinateSystem.java:106)
     at map.DefaultMapContext.<init>(DefaultMapContext.java:55)
     at dialogs.MainApplet.start(MainApplet.java:74)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
     at org.geotools.units.Unit.<clinit>(Unit.java:101)
     ... 6 more
So everything in the namespace org.geotoos.... is in a package.
I would think it's a nullpointer exception, but as it works fine when i start it from eclipse, it can't really be that.
If i try to refresh the page, i get a noclassDefFound Exception:
java.lang.NoClassDefFoundError
     at map.DefaultMapContext.<init>(DefaultMapContext.java:55)
     at dialogs.MainApplet.start(MainApplet.java:74)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
The initialisation of the class DefaultMapContext uses a class from the package the first time. So maybe there's something wrong with my classpath? But why does it find it the first time?
Any help would be great!

Hi,
I also have receive same thing that. My applet work
fine with Applet Viewer, but when i try with HTML
page, it gets the sane error and deosn't work.
Any help and guide!
Hi liz, have you solve your work?
May be guide me?
ThanksNotice the previous posts occurred in September of 2004. It is not likely that you will get a response.
When you say "I also receive the same thing..." do you mean you have the same identical error? That seems unlikely, especially since it works in AppletViewer. You probably have a different problem. It is nearly impossible to say what it is unless you post more information, especially the error message and code.
I think the best approach is to try a simple Applet (like Hello World) to make sure you have the basics correct. If this works, start adding more and more of your code until it stops working. This will give you a clue as to what part of your code is causing the problem.

Similar Messages

  • Embedded Java Applet NullPointerException in JSPX pages

    We have a ADF web application programmed in JDeveloper 11g (11.1.2.4.0), which was migrated over from a 10g (10.1.3.5.0) project
    Within the application, occasionally, we need to call a Java Applet which is placed in a public_html/applet folder. The jars show up in the Web-Content tab of the ViewController in the Application Navigator, just like it did in 10g.
    The applet tag looks like this:
    <applet height="100" width="100" code="applet.SetupApplet" archive="applet/SSetupApplet.jar">
                <param name="debug" value="true"/>   
    </applet>
    I've also tried calling the applet with the Java deploy applet script
    <trh:script source="http://java.com/js/deployJava.js"></trh:script>
        <trh:script>
            var attributes = {code:'applet.SetupApplet',
            archive:'applet/SSetupApplet.jar'};
            var parameters = {} ;
            var version = '1.6' ;
            deployJava.runApplet(attributes, parameters, version);
       </trh:script>
    When I navigate to the login.jspx page that has this tag, it pops the Java Console open, but doesn't actually run the applet (or show the prompts to allow using the Applet). Instead, the applet is shown with an error and the error says "NullPointerException". I've double-checked the path and it's correct (with incorrect paths, I get a ClassNotFoundException). In the application server logs, I see the following error:
    <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on IPADDRESS during the configured idle timeout of 5 secs>
    I created a normal .jsp file that's outside the ADF Faces Context in the applet folder. Navigating to it with the same applet tags does have the Java applet run without the socket error. The same code in 10g works fine.
    Is there anything I'm missing?
    Thanks.

    Hi,
    this is how I did it in 11g R1: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf
    Frank

  • Reloading applet in opera throws NullPointerException in SunGraphics2D

    i have an Applet, which checks for Sun JVM. If MS JVM, it aborts. If Sun JVM, it starts new JApplet.
    Everything is working fine, until i tried to reload the html page with the applet tag in it.
    On MS IE, it is working. The Applet is stopped and then restarted.
    On Mozilla, it is working.
    But on Opera, the following Exception is thrown after i have reloaded the page once.
    After reloading, the Exception is also thrown everytime i scroll the page or reload the page.
    java.lang.NullPointerException
         at sun.java2d.SunGraphics2D.<init>(Unknown Source)
         at sun.awt.image.SunVolatileImage.createGraphics(Unknown Source)
         at java.awt.image.VolatileImage.getGraphics(Unknown Source)
         at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
         at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
         at javax.swing.JComponent.paint(Unknown Source)
         at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
         at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
         at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
         at java.awt.Container.paint(Unknown Source)
         at sun.awt.RepaintArea.paint(Unknown Source)
         at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)
    As said, i'm using an Applet class and an JApplet class. the Applet class has only AWT components,
    the JApplet class has swing components (a list and a few JButtons).
    i'm using a thread, but it is not started.
    also, after the reload in opera, the whole applet is started again (as usual), and AFTER the last debug message,
    this exception is thrown. so there is no code of myself after that last debug message.
    i am using java 1.4.2-beta, but users told me they have the same problem with my applet on other computers with
    other jvms.

    i tried a beta-version of opera 7.20 and here are some source code line numbers visible:
    perhaps someone can tell me now, what's happening there and give me a tipp how to solve this problem.
    java.lang.NullPointerException
    at sun.java2d.SunGraphics2D.<init>(SunGraphics2D.java:212)
    at sun.awt.image.SunVolatileImage.createGraphics(SunVolatileImage.java:176)
    at java.awt.image.VolatileImage.getGraphics(VolatileImage.java:223)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4768)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4748)
    at javax.swing.JComponent.paint(JComponent.java:798)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1312)
    at sun.awt.RepaintArea.paint(RepaintArea.java:177)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
    at java.awt.Component.dispatchEventImpl(Component.java:3678)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Nullpointerexception in applet...

    Hi!
    I have got a jsp page and an applet. The jsp page set some parameters for applet, but I cannot access those in the applet, because there is a nullpointer exception in the java console
    (line 38 ->
    System.out.println(getParameter("__sessionid")==null ? "null" : getParameter("__sessionid"));
    Please help me, I can't find where the problem is! Thank You very much!
    Viktor
    Here are the source:
    **************************** JSP **************************************
    <HTML>
    <HEAD><TITLE>Title of Applet page</TITLE></HEAD>
    <BODY>
    <APPLET CODE="StartApplet.class" WIDTH=150 HEIGHT=250>
    <PARAM NAME="__sessionid" VALUE="<%= request.getSession().getId() %>">
    <PARAM NAME="__username" VALUE="<%= request.getRemoteUser() %>">
    <PARAM NAME="__principal" VALUE="<%= request.getUserPrincipal().toString() %>">
    </APPLET>
    </BODY>
    </HTML>
    ***************************** APPLET *************************************
    * StartApplet.java
    * Created on 2006. szeptember 19., 16:28
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    * @author VHORVATH
    public class StartApplet extends javax.swing.JApplet {
    String SessionID = new String();
    String UserName = new String();
    String Principal = new String();
    * Creates a new instance of StartApplet
    public StartApplet() {
    super();
    System.out.println("processing();");
    processing();
    void preProcessing() {
    System.out.println(getParameter("__sessionid")==null ? "null" : getParameter("__sessionid"));
    System.out.println(getParameter("__username")==null ? "null" : getParameter("__username"));
    System.out.println(getParameter("__principal")==null ? "null" : getParameter("__principal"));
    SessionID = getParameter("__sessionid");
    UserName = getParameter("__username");
    Principal = getParameter("__principal");
    void processing() {
    System.out.println("preProcessing();0");
    preProcessing();
    try {
    ObjectOutputStream oos;
    ObjectInputStream ois;
    HttpURLConnection uc;
    URL servletPath = new URL("http://127.0.0.1:7001/ProgrammaticSecurityWithWebApplications/OwnServlet");
    uc = (HttpURLConnection)servletPath.openConnection();
    uc.setDoOutput(true);
    uc.setDoInput(true);
    uc.setUseCaches(false);
    uc.setRequestMethod("POST");
    uc.addRequestProperty("Cookie", "JSESSIONID="+SessionID);
    uc.addRequestProperty("_User", UserName);
    uc.addRequestProperty("_Principal", Principal);
    oos = new ObjectOutputStream(uc.getOutputStream());
    oos.writeObject("k�nya2");
    oos.flush();
    oos.close();
    ois = new ObjectInputStream(uc.getInputStream());
    String resp = (String)ois.readObject();
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"A v�lasz:!\n"+resp,"Figyelem!",javax.swing.JOptionPane.INFORMATION_MESSAGE);
    catch(IOException ioe) {
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"Hiba a kapcsolatfelv�tel sor�n! (IOException)\n"+ioe.getMessage(),"Figyelem!",javax.swing.JOptionPane.WARNING_MESSAGE);
    catch(ClassNotFoundException cnfe) {
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"Hiba a kapcsolatfelv�tel sor�n! (ClassNotFoundException)\n"+cnfe.getMessage(),"Figyelem!",javax.swing.JOptionPane.WARNING_MESSAGE);
    ****************************** ERROR MESSAGE **************************
    java.lang.NullPointerException
         at java.applet.Applet.getParameter(Unknown Source)
         at StartApplet.preProcessing(StartApplet.java:38)
         at StartApplet.processing(StartApplet.java:49)
         at StartApplet.<init>(StartApplet.java:33)
         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.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-4" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    oh, yeah! Thank you!
    but... the applet does not throw exception, but i cannot access the parameter value of jsp page, this line
    System.out.println(getParameter("__sessionid")==null ? "null" : getParameter("__sessionid"));
    writes this to the output : "null"
    hmm...
    this is my new code:
    * StartApplet.java
    * Created on 2006. szeptember 19., 16:28
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    * @author VHORVATH
    public class StartApplet extends javax.swing.JApplet {
    String SessionID = new String();
    String UserName = new String();
    String Principal = new String();
    * Creates a new instance of StartApplet
    public void init() {
    System.out.println("preProcessing");
    SessionID = new String();
    UserName = new String();
    Principal = new String();
    preProcessing();
    public void start() {
    //super.start();
    System.out.println("processing");
    processing();
    void preProcessing() {
    System.out.println(getParameter("__sessionid")==null ? "null" : getParameter("__sessionid"));
    System.out.println(getParameter("__username")==null ? "null" : getParameter("__username"));
    System.out.println(getParameter("__principal")==null ? "null" : getParameter("__principal"));
    SessionID = getParameter("__sessionid");
    UserName = getParameter("__username");
    Principal = getParameter("__principal");
    void processing() {
    try {
    ObjectOutputStream oos;
    ObjectInputStream ois;
    HttpURLConnection uc;
    URL servletPath = new URL("http://127.0.0.1:7001/ProgrammaticSecurityWithWebApplications/OwnServlet");
    uc = (HttpURLConnection)servletPath.openConnection();
    uc.setDoOutput(true);
    uc.setDoInput(true);
    uc.setUseCaches(false);
    uc.setRequestMethod("POST");
    uc.addRequestProperty("Cookie", "JSESSIONID="+SessionID);
    uc.addRequestProperty("_User", UserName);
    uc.addRequestProperty("_Principal", Principal);
    oos = new ObjectOutputStream(uc.getOutputStream());
    oos.writeObject("k�nya2");
    oos.flush();
    oos.close();
    ois = new ObjectInputStream(uc.getInputStream());
    String resp = (String)ois.readObject();
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"A v�lasz:!\n"+resp,"Figyelem!",javax.swing.JOptionPane.INFORMATION_MESSAGE);
    catch(IOException ioe) {
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"Hiba a kapcsolatfelv�tel sor�n! (IOException)\n"+ioe.getMessage(),"Figyelem!",javax.swing.JOptionPane.WARNING_MESSAGE);
    catch(ClassNotFoundException cnfe) {
    javax.swing.JOptionPane.showMessageDialog(new javax.swing.JDialog(),"Hiba a kapcsolatfelv�tel sor�n! (ClassNotFoundException)\n"+cnfe.getMessage(),"Figyelem!",javax.swing.JOptionPane.WARNING_MESSAGE);
    }

  • Connection nullpointerexception on reload of applet

    I have the following sqlj code in an applet to retrive data from an oracle database. After this the code goes onto draw the data in the applet using AWT (that code isn't shown here).
    My trouble is that when I get to the following line Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection(); I get a Null Pointer exception, but only after refreshing the applet.
    Is there something in need to add to close or null the conntection?
    So to overcap I get a NullPointerException only when I refresh the applet. It runs perfectly the first time. The applet need to be refreshed because the data in the table gets updated and the applet needs to be refreshed to show the data changes.
    public void getFlowSpaceData() throws SQLException {
    // MyIter iter;
    String strUserName = getParameter("paramUserName");
    String strFlowName = new String();
    Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection();
    strQuery = "select FLOWNAME FROM FLOWMANAGER.TMP_FLOWNAMES WHERE USERNAME ='" + strUserName +"'";
    PreparedStatement pstmt0 = con.prepareStatement(strQuery);
    ResultSet rs0 = pstmt0.executeQuery();
    while (rs0.next()) {
    strFlowName = rs0.Long postings are being truncated to ~1 kB at this time.

    Just wanted to update the post that I came up with a solution. I created a sepreate thread and it now works fine, but the sqlj code does take some time to load. I was wondering if somone could take a quick look at my code and see if their is anyway I could extact the data faster.
    String strUserName = getParameter("paramUserName");
    strQuery = "select FLOWNAME FROM FLOWMANAGER.TMP_FLOWNAMES WHERE USERNAME ='" + strUserName +"'";
    Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha2.us.oracle.com:1525:ORCL", "flowmanager", "ur2c001").getConnection();
    PreparedStatement pstmt0 = con.prepareStatement(strQuery);
    ResultSet rs0 = pstmt0.executeQuery();
    while (rs0.next()) {
    strFlowName = rs0.getString(1);
    rs0.close();
    pstmt0.close();
    strQuery = "select FLOWNAME, USERNAME, PANELROW, PANELCOL, RELATEROW, RELATECOL, OBJTYPE, BASECODE, INDUSTRYID, PANELNUM, BUSINESSPROCESSID FROM flows WHERE flowname ='" + strFlowName + "' ORDER BY PANELNUM";
    PreparedStatement pstmt1 = con.prepareStatement(strQuery);
    ResultSet rs1 = pstmt1.executeQuery();
    int r = 0;
    int c = 0;
    while (rs1.next()) {
    intObjType[r][c]= rs1.getInt(7);
    strID[r][c] = rs1.getString(11);
    Long postings are being truncated to ~1 kB at this time.

  • Multithreaded graphics applet gets NullPointerException

    Hi!
    This is a complex issue and the code's big, so i'll try
    to explain the main part.
    I have five classes.
    AppletClass (this one extends Applet)
    GraphicItem (just a little sprite which can draw itself)
    Thread1 (draws a bunch of GraphicItems in background on a Graphics which is set by setg() in this class)
    Thread2 (draw a random clolor text line in background
    on a Graphics which is set by setg() in this class)
    Drawer (a thread that draws an image set in
    the constructor ona graphics which is set by setg() in this class)
    What is it for: Well, this is a dubble buffering example,
    where two threads draw into one image which works
    as a buffer and then another thread draw that image
    into the applet area.
    The problem is that when Thread1 in run() calls
    gitem.draw(g) where g is Graphics i sometimes
    get NullPointerException, also, it happenes in some
    other place but i cannot pinpoint it. Also,it happenes
    always when i restart applet w/o reloading in
    JBuilder (nor the browser).
    The thing is that i do not use synchronized or
    imageUpdate() in the Drawer (imageUpdates() does
    nothing), so it is possible for two or more object to
    have access to the same Graphics object at the same
    time. Also, while Drawer draws the image, the other
    thread are drawing onto the image. So, there might
    be a conflict, i think. The other other is that when
    i comment out all Thread.sleep() the image get
    clobbered. That is, the GraphicItem is a cross of
    random color, so i shoudl see thousands of crosses of
    random color, but i thousands of crosses of pretty
    much the same color as it seems like Random is not
    working or drawing is broken.
    Anyway, any idea how to properly implement such
    thing? What precautions shoudl i take and which
    conflicts and how should i resolve?
    And, of course, in what cases NullPointerException is
    generated? I mean, what exxctly does it mean and
    when usually occurs?
    PS: Don't you think it is weird to get such
    exception in a language which officially
    has no pointers? :)

    Why it SOUNDS like is the Image you are drawing may not be completly loaded yet.. so the first few times it's blitted ( and possibly if it gets bumped out of memory ) attempting to draw it will throw a null pointer.
    I solved that in my own code by using a MediaTracker on the image when it was created to make sure that it is loaded and ready to be draw immediatly.

  • Refresh applet sqlj NullPointerException URGENT!

    I have the following sqlj code in an applet to retrive data from an oracle database. After this the code goes onto draw the data in the applet using AWT (that code isn't shown here). My trouble is that when I get to the following line Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection(); I get a Null Pointer exception only after refreshing the page using F5.
    So to overcap I get a NullPointerException only when I refresh the applet. It runs perfectly the first time. The applet need to be refreshed because the data in the table get updated and the applet need to be refreshed to show the data changes.
    public void getFlowSpaceData() throws SQLException {
    // MyIter iter;
    String strUserName = getParameter("paramUserName");
    String strFlowName = new String();
    Connection con = Oracle.connect("jdbc:oracle:thin:@ebalpha:1525:ORCL", "flowmanager", "xxxxx").getConnection();
    strQuery = "select FLOWNAME FROM FLOWMANAGER.TMP_FLOWNAMES WHERE USERNAME ='" + strUserName +"'";
    PreparedStatement pstmt0 = con.prepareStatement(strQuery);
    ResultSet rs0 = pstmt0.executeQuery();
    while (rs0.next()) {
    strFlowName = rs0.getString(1);
    rs0.close();
    pstmt0.close();
    strQuery = "select FLOWNAME, USERNAME, PANELROW, PANELCOL, RELATEROW, RELATECOL, OBJTYPE, BASECODE, INDUSTRYID, PANELNUM, BUSINESSPROCESSID FROM flows WHERE flowname ='" + strFlowName + "' AND username ='" + strUserName +"' ORDER BY PANELNUM";
    PreparedStatement pstmt1 = con.prepareStatement(strQuery);
    ResultSet rs1 = pstmt1.executeQuery();
    int r = 0;
    int c = 0;
    while (rs1.next()) {
    intObjType[r][c]= rs1.getInt(7);
    strID[r][c] = rs1.getString(11);
    //strIDQuery = strIDQuery + 'or ID =' + strinID
    intRowRelation[r][c] = rs1.getInt(5);
    intColRelation[r][c] = rs1.getInt(6);
    c++;
    if(c > 4) {
    r++;
    c = 0;
    rs1.close();
    pstmt1.close();
    PreparedStatement pstmt2 = con.prepareStatement(strQuery);
    ResultSet rs2 = pstmt2.executeQuery();
    r = 0;
    c = 0;
    int i = 0;
    int intSTRLENGTH = 0;
    while(i < 24){
    strQuery = "select name, descr, role from BUSINESSPROCESS WHERE ID = '" + strID[r][c] + "'";
    pstmt2 = con.prepareStatement(strQuery);
    rs2 = pstmt2.executeQuery();
    rs2.next();
    intSTRLENGTH = rs2.getString(1).length();
    if (intSTRLENGTH > 17){
    strLabel1[r][c] = rs2.getString(1).substring(0,17);
    strLabel2[r][c] = rs2.getString(1).substring(18,intSTRLENGTH);
    }else {
    strLabel1[r][c] = rs2.getString(1).substring(0,intSTRLENGTH);
    strLabel2[r][c] = " ";
    intSTRLENGTH = rs2.getString(2).length();
    if (intSTRLENGTH > 17){
    strDescr1[r][c] = rs2.getString(2).substring(0, 17);
    strDescr2[r][c] = rs2.getString(2).substring(18,intSTRLENGTH);
    }else{
    strDescr1[r][c] = rs2.getString(1).substring(0,intSTRLENGTH);
    strDescr2[r][c] = " ";
    c++;
    i++;
    if(c > 4) {
    r++;
    c = 0;
    rs2.close();
    pstmt2.close();
    con.close();
    con = null;
    Thanks for you Assistance! It's greatly appreciated!
    Chris Wallace

    After further research I notice that if I Clear classload cache after every load before I refresh the applet it works fine. I can't have the user brining up the the consule windows and pressing x to clear classloader. Just thought I would give this futher information to help limit what the problem could be.

  • NullPointerException at sun.applet.AppletPanel.findAppletJDKLevel

    Hi,
    we have a online HTML page containing an <applet> and different <iframe> definitions. By clicking a HTML link or calling Applet.getAppletContext().showDocument(), other HTML pages containing other applets are loaded into the referenced frame. All applets have identical archive and codebase attributes, allowing them to communicate with each other.
    This works actually very well. The problem is that sometimes newly loaded applets do not start, and a red cross appears in the inner frame. In all cases, the following exception appears in the java console (which does not happen if everything works fine):
    java.lang.NullPointerException
    at sun.applet.AppletPanel.findAppletJDKLevel(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)
    We experienced this on customer clients using
    - Windows XP or Vista
    - SUN Java 1.6 (e.g. Java 1.6.0_02), Java 1.5 worked so far
    - Firefox2, IE6, IE7
    Any ideas?
    We use the JarIndex mechanism to enable dynamical class loading, could that cause problems?

    After installing JRE1.6.0_02, the problem occured now as well, but didn't occur under the previously JRE1.5.0_07 version.
    For me, it seems to be some classloader related timing problem and occurs even in the following scenario:
    I have a main frame m, containing an inner frame a with applet A and an empty inner frame b.
    1. at startup, A gets loaded into a. A starts well.
    2. A loads a second Applet B via <applet> into b. B starts well.
    3. Click HTML button within m loads a third Applet C via <applet> into b. Using Java 1.6, B does sometimes not start (see first post)
    4. Click HTML button within m loads B via <applet> into b. This works.
    5. Click HTML button within m loads C via <applet> into b. This works sometimes, sometimes not.
    So, the class needed at that moment (whatever that is) is actually available but cannot be loaded properly at first start for some reason.
    As said before, codebase and archive tags are exactly the same. Javascript is not used at all. I couldn't set up a test environment to simulate this effect, so I'm sorry that I couldn't supply any code example.
    Does anyone could give me a hint please?

  • NoClassDefFound in Applet

    HI !
    I'm getting a NoClassDefFound exception when trying put my applet in a package.When I dont use package statement everything works fine but as soon as I put the package statement i get following exception :
    ava.lang.NoClassDefFoundError: Hej (wrong name: JavaFiler/Hej)
         at java.lang.ClassLoader.defineClass0(Native Method)
         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 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)
    java.lang.NoClassDefFoundError: Hej (wrong name: JavaFiler/Hej)
         at java.lang.ClassLoader.defineClass0(Native Method)
         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 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)
    �My html file looks like this
    <HTML>
    <HEAD>
    <TITLE> Patricks Uppgift</TITLE>
    </HEAD>
    <BODY>
    <CENTER>
    <APPLET CODE="Hej"Width="450"Height="500">
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>
    [ /CODE]
    My appletfile is in a directory Javafiler where the html also is and the classpath is set to both C.\ and C:\JavaFiler.
    any suggestions anyone?
    Greatful for all help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Thanks for your reply but it seems not to be the problem. When I remove the package statement in my javafile it compile and runs without problemand the files are still in the same directory. The problem to me seems to be the package statement and how to get the html file to understand that the files are in the same directory as before but with a package statement.
    Here's what I got changing the applet tag
       inl�sning: klassen �JavaFiler.Hej finns inte.
    java.lang.ClassNotFoundException: �JavaFiler.Hej
         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.FileNotFoundException: C:\JavaFiler\�JavaFiler\Hej.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         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
    java.lang.ClassNotFoundException: �JavaFiler.Hej
         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.FileNotFoundException: C:\JavaFiler\�JavaFiler\Hej.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         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
    [ /CODE]

  • Oracle Web Publisher: NullPointerException when starting Java Applet

    Hi there,
    I'm using Express Server 6.3.4 and Web Publisher 6.3.2 and have created a very simple web briefing -- just a basic web page to see whether it works.
    Now when browsing the sample page, an applet is loaded and tells me that several Oracle java classes are loaded. But in the end it fails:
    java.lang.NullPointerException at oracle.olap.webAgent.express.Express.execute(Unknown Source) at ....
    Does anybody know any solution?
    Stefan

    Yes, I tried a sample "application" -- the same error. I'm using IE5.5. To locate the "bug", I did the following:
    I saved the generated HTML code (including the applet tag and all parameters) and loaded that "static" page using SUN's appletviewer. After a short error message (something like "Error in xwd_init: you provided extra input '\'") the applet was loaded and displayed properly. So I know that there's neither a classpath problem nor classes are missing.
    Thank you for your help.
    Stefan

  • Applet - JNLP2Manager NullPointerException bail out

    All,
    when trying to run my applet I get the following error in the Java console.
    java.lang.NullPointerException
         at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
         at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(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)
    Error while initializing manager: java.lang.NullPointerException, bail outAnyone knows what the problem is here?
    The applet is packaged within a war and deployed on a Weblogic AS.
    I use Java 1.6.0_14 to compile and launch the applet.
    The applet is started with the following code:
        <script src="http://www.java.com/js/deployJava.js"></script>
        <script>
            var attributes = { code:'test.MyApplet',  width:600, height:910} ;
            var parameters = {jnlp_href: '/jnlp/my-applet.jnlp'} ;
            deployJava.runApplet(attributes, parameters, '1.6');
        </script>Thanks in advance.

    All,
    when trying to run my applet I get the following error in the Java console.
    java.lang.NullPointerException
         at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
         at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(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)
    Error while initializing manager: java.lang.NullPointerException, bail outAnyone knows what the problem is here?
    The applet is packaged within a war and deployed on a Weblogic AS.
    I use Java 1.6.0_14 to compile and launch the applet.
    The applet is started with the following code:
        <script src="http://www.java.com/js/deployJava.js"></script>
        <script>
            var attributes = { code:'test.MyApplet',  width:600, height:910} ;
            var parameters = {jnlp_href: '/jnlp/my-applet.jnlp'} ;
            deployJava.runApplet(attributes, parameters, '1.6');
        </script>Thanks in advance.

  • NullPointerException from applet

    I am new of Java
    Help
    After compiling my program:
    import java.applet.*;
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    class Read extends Applet
    public String read()
    try
    URL url = new URL(getCodeBase(),"cont.txt");
    InputStream inStream = url.openStream();
    BufferedReader buf = new BufferedReader(new InputStreamReader(inStream));
    String numero = buf.readLine();
    buf.close();
    return numero;
    catch(MalformedURLException e)
    String numero;
    return numero = "Ecc1";
    catch(IOException e)
    String numero;
    return numero = "Ecc2";
    catch(NullPointerException e)
    String numero;
    return numero = "Ecc3";
    finally
    when load applet from HTML-file the program catch ever
    this exception:
    NullPointerException
    Grazie

    You might want to check to make sure that you have your path and classpath set to point to the right directories. If you are unsure of how to set your classpath then just do a search of the forums using "classpath" as the search key. The question of how to set a classpath has been asked and answered many times over.
    Good luck.

  • NoClassDefFound when running applet from a jar

    I have a project defined in Oracle JDeveloper 3.2 which runs fine with the appletviewer. However, when I create
    a JAR of the project (including all the libraries), Netscape gives me this error.
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleConnection
    at java.lang.ClassLoader.resolveClass(Compiled Code)
    at java.lang.ClassLoader.loadClassInternal(Compiled Code)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(Compiled Code)
    at oracle.jdbc.driver.OracleDriver.connect(Compiled Code)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at Silly.myApplet.dbConnection(Compiled Code)
    at Silly.myApplet.doSqlQuery(Compiled Code)
    at Silly.myApplet.jbInit(Compiled Code)
    at Silly.myApplet.init(Compiled Code)
    * at netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compiled Code)
    at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
    at java.awt.EventDispatchThread.run(Compiled Code)
    at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
    The class oracle/jdbc/driver/OracleConnection is in the JAR, as are the two called classes it claims not to find in these errors:
    # Verifier error oracle/jdbc/dbaccess/DBError.throwBatchUpdateException(Ljava/lang/String;Ljava/lang/String;II[I)V: Cannot find class java/sql/BatchUpdateException# Verifier error oracle/jdbc/driver/OracleConnection.initialize(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Loracle/jdbc/dbaccess/DBAccess;Ljava/util/Hashtable;)V: Cannot find class java/util/Map
    I would appreciate any help.
    TIA.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleConnectionI can think of a handful of reasons why you are getting that error message. But, let's see your html file, just that portion that deal with the <APPLET>, <OBJECT> and <EMBED> tags. I'm particularly interested in how you specify the jar file(s). Are you doing it this way:
    <APPLET CODE="myApp" CODEBASE="." ARCHIVE="myApp.jar,Oracle.jar" WIDTH=100 HEIGHT=100></APPLET>
    I am assuming that oracle libraries are in a jar file, are you putting that jar file inside of your jar file -- that would never work. If that's what you did, you must either extract the contents of libraries jar and then jar them together with your class files or keep the jar separate and use a manifest to specify the CLASSPATH.
    V.V.

  • Applets-NoClassDefFound:javax/swing/JApplet

    Does the jar,class,HTML files have to be on a server to run on the Web? They now reside
    on my C: drive and I get this message when I launch my HTML. Do I load the JAVA plug-in
    HTML converter here also? If it is possible to have the Web access the applets on my C: drive
    how do I point it to this location?

    Hi,
    Yes, your jar, class and HTML files need to reside on a server if you want them to be available for the web.
    Yes, you'll need to load the Java plug-in HTML converter here also. Normally, it will install only once but the code is required to let the browser know it needs to use another java plugin than the browser's default.
    I don't think you can point the applets from the server to your local drive. You can perhaps try to assign a drive letter on the server to your local drive and create a virtual directory pointing to this drive. If this works, the rest should also work (although this is not recommended).
    Kurt.

  • Mysterious null pointers during Applet.paint(g)

    I'm working with the paint function of my applet, which uses double buffering, and I occassionally get an odd null pointer exception, which does not halt its excution, but I believe may be linked to some other unusual behavior regarding components not being painted correctly.
    I've been staring at this thing for a while now and I am completely out of ideas.
    For debugging purposes, I've expressly checked each object invovled in the painting to ensure that it isn't null, but the exception is still being thrown and java is telling me that the exception is being trown on line numbers that have only a closing brace (see code)
    Any help is much appreciated
    Here's the code... state is an extension of Container and loading is just a label to display when I'm changing different containers in and out of state
           public void paint(Graphics g) {
              if(offscreen == null) offscreen = createImage(500, 480);
              else {
                      Graphics g1 = offscreen.getGraphics();
                      if(!dontPaint) {
                        if(loading != null && loading.isVisible()) loading.setVisible(false);
                        if(state!=null) state.paint(g1);
                   else {
                        if(g1 != null) {
                             g1.setColor(Color.black);
                             g1.fillRect(0, 0, 500, 480);
                        if(!loading.isVisible() && loading!=null) loading.setVisible(true);
                      if(g != null) g.drawImage(offscreen, 0, 0, null);
            }here's an example of the errors:
    java.lang.NullPointerException
            at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:48)
            at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:715)
            at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
            at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2782)
            at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2772)
            at StarDart.paint(StarDart.java:113)
            at StarDart.update(StarDart.java:96)
            at sun.awt.RepaintArea.paint(RepaintArea.java:172)
            at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
            at java.awt.Component.dispatchEventImpl(Component.java:3586)
            at java.awt.Container.dispatchEventImpl(Container.java:1437)
            at java.awt.Component.dispatchEvent(Component.java:3367)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:190)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:144)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

    I do have a thread which is always running; I use the Runnable interface. Here is my run() function:
         public void run() {
              while(!stopRunning) {
                   for(; sessionInput(); state.handleInput(inBuf));
                           repaint();
                        try {
                                   Thread.sleep(100L);
                        } catch(InterruptedException interruptedexception) { System.out.println(interruptedexception); }
              }The for loop manages my networking code. Should I be putting the call to repaint() in a try block?
    Does this have something to do with synchronization?

Maybe you are looking for