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);
}

Similar Messages

  • 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.

  • Adding image to JDialog in Applet

    Well.. I've decided to make my Applet load via a JDialog. Which I know is possible :). And to a start I'll make a very simple Applet in the JDialog, including a background picture, which I just can't add! So to make a long story short, I want an image in my JDialog, but my code gives me a nullPointerException during the Runtime.. Here's the exact Runtime error:
    Exception in thread "main" java.lang.NullPointerException
            at applet.<init>(applet.java:16)
            at applet.main(applet.java:100)And here's my exact applet.java file:
    import java.applet.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.swing.plaf.metal.*;
    public class applet extends Applet implements Runnable
        private ImagePanel panel;   
    public applet()
         panel.createGUI();
        public void init()
        public void run()
    public void start()
         Thread thread = new Thread(this);
         thread.start();
    public void stop()
    public void destroy()
    public void paint(Graphics g)
    private class ImagePanel extends JPanel
        BufferedImage buffered = null;
        public ImagePanel(String name)
            try
                buffered = ImageIO.read(new File(name));
                setPreferredSize(new Dimension(buffered.getWidth(), buffered.getHeight()));
            } catch(IOException ioe)
                ioe.printStackTrace();
        public void paintComponent(Graphics g)
            if (buffered == null)
                g.drawString("No Image", 10, 40);
            else
                g.drawImage(buffered, 0, 0, null);
        public void createGUI()
         MetalLookAndFeel.setCurrentTheme(new BlackTheme());
            JFrame.setDefaultLookAndFeelDecorated(true);
            JDialog.setDefaultLookAndFeelDecorated(true);
            JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         JDialog dialog = new JDialog();
      dialog.setTitle("Applet loading via. JDialog");
      Container container = dialog.getContentPane();
      ImagePanel panel = new ImagePanel("background.gif");
      dialog.pack();
      dialog.setSize(1000, 1000);
      dialog.setVisible(true);
      dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        public static void main(String[] args)
         applet app = new applet();
    }And I don't see any errors, but still.. Runtime error.. -.-' So a little bit of help would really be appretaiced!

    Okay I guess I spoke to soon.. :O Now I have no Runtime error but my JDialog is completly empty.. And my BlackTheme stopped working.. Not It's a blue theme instead..
    Here take a look at my applet.java:
    import java.applet.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.swing.plaf.metal.*;
    public class applet extends Applet implements Runnable
        ImagePanel panel = new ImagePanel("background.gif");  
    public applet()
         panel.createGUI();
        public void init()
        public void run()
    public void start()
         Thread thread = new Thread(this);
         thread.start();
    public void stop()
    public void destroy()
    public void paint(Graphics g)
    private class ImagePanel extends JPanel
        BufferedImage buffered = null;
        public ImagePanel(String s)
            try
                buffered = ImageIO.read(new File(s));
                setPreferredSize(new Dimension(buffered.getWidth(), buffered.getHeight()));
            } catch(IOException ioe)
                ioe.printStackTrace();
        public void paintComponent(Graphics g)
            if(buffered == null)
                System.out.println("No image to display.");
            else
                g.drawImage(buffered, 0, 0, null);
        public void createGUI()
            MetalLookAndFeel.setCurrentTheme(new BlackTheme());
            JFrame.setDefaultLookAndFeelDecorated(true);
            JDialog.setDefaultLookAndFeelDecorated(true);
            JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         JDialog dialog = new JDialog();
      dialog.setTitle("Applet loading via. JDialog");
      Container container = dialog.getContentPane();
      ImagePanel panel = new ImagePanel("background.gif");
      dialog.pack();
      dialog.setSize(1000, 1000);
      dialog.setVisible(true);
      dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        public static void main(String[] args)
         applet app = new applet();
    }

  • Opening webpages from applet?

    is it possible to open a new web browser from an applet?

    When I do it I get java.lang.NullPointerException
    java.applet.Applet.getAppletContext. Can u please suggest why would this be?
    Thanks,
    mjossan

  • Applet.getContext problem

    Hi
    I have a problem with my applet, it won't load because of an nullpointerException in applet.getAppletContext call. I dont know what this depends on. here's my applet code:
    try{     
    URL ur=new URL("file:///C:/Patricks Filer/Test.html");     
    AppletContext ap=getAppletContext();     
    ap.showDocument(ur);     
    }catch (MalformedURLException ma)     
    System.out.println("Det gick ej att hitta filen");     
    and here's is my html code:
    <html><Applet Code="Lasare.class"width="500"Height="600">archive="Lasare.jar"L?nk till jarFilenwidth="500"Height="600"></Applet></html>
    and finally here's the out put from the console panel:
    ava.lang.NullPointerException
    at java.applet.Applet.getAppletContext(Unknown Source)
    at Lasare.<init>(Lasare.java:42)
    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)
    the code line number 42 is the line: AppletContext ap=getAppletContext();
    Greatful for help
    putte

    No it isn't in the constructor I have a Class TestLasare that extends applet lthe code skeleton looks like this.
    public class TestLasare extends Applet{
    // konstructor
    public �TestLasare(){
    // here is all the code
    public void init(){
          new TestLasare();
    }// end class TestLasare
    Putte                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error into my converted applet

    Hello, I have to convert an appletication java to an applet. I have obtained this but...
    When I try to open a file, from menu deplegable, it does not do it, and into and in the Windows� console it gives me the error:
    C:\PALEO>appletviewer index.html
    java.lang.ExceptionInInitializerError
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:141)
            at sun.awt.windows.WToolkit.initializeDesktopProperties(WToolkit.java:890)
            at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1569)
            at sun.awt.shell.ShellFolder.<clinit>(ShellFolder.java:208)
            at javax.swing.filechooser.FileSystemView.getRoots(FileSystemView.java:335)
            at javax.swing.filechooser.WindowsFileSystemView.getHomeDirectory(FileSystemView.java:649)
            at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFileChooserUI.java:214)
            at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:130)
            at javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserUI.java:152)
            at javax.swing.JComponent.setUI(JComponent.java:449)
            at javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
            at javax.swing.JFileChooser.setup(JFileChooser.java:345)
            at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
            at javax.swing.JFileChooser.<init>(JFileChooser.java:273)
            at MFileChooser.abrir(Archivo.java:844)
            at Menus$ALAbrir.actionPerformed(Menus.java:1276)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
            at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
            at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
            at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
            at java.awt.Component.processMouseEvent(Component.java:5100)
            at java.awt.Component.processEvent(Component.java:4897)
            at java.awt.Container.processEvent(Container.java:1569)
            at java.awt.Component.dispatchEventImpl(Component.java:3615)
            at java.awt.Container.dispatchEventImpl(Container.java:1627)
            at java.awt.Component.dispatchEvent(Component.java:3477)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
            at java.awt.Container.dispatchEventImpl(Container.java:1613)
            at java.awt.Component.dispatchEvent(Component.java:3477)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
            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)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission os.name read)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
            at java.security.AccessController.checkPermission(AccessController.java:401)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
            at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1276)
            at java.lang.System.getProperty(System.java:573)
            at sun.awt.shell.Win32ShellFolderManager2.<clinit>(Win32ShellFolderManager2.java:74)
            ... 41 moreBefore this, I have change my file java.policy It contains:
    grant codeBase "file:\\C:\Paleo\tablas\*" {
         permission java.io.FilePermission "<<ALL FILES>>", "read";
         permission java.io.FilePermission "<<ALL FILES>>", "write";
         permission java.util.PropertyPermission "user.language","write";
         permission java.util.PropertyPermission "user.dir", "read";
         permission java.lang.RuntimePermission "modifyThread";
         permission java.lang.RuntimePermission "exitVM";
         permission java.awt.AWTPermission "accessClipboard";
        };Why those errors??
    Thanks

    I have fixed the problem (in part). I have changed my java.poly of my j2sdk1.4.2_09 with:
    grant {
    permission java.security.AllPermission;
    };But now the problem is another one.
    In my appletd I can choose the option "Open (a file)" of a menu bar. The applet shows a new window to select the file to open. I select I file but when I chick Open, gives me this exception:
    Archivo:MFileChooser.abrirDelimitado(): Error al a�adir tabla. java.lang.NullPointerException
    The applet would have to create a new table with the content of the file, and to insert the table in a new window in the applet. But instead of doing that the exception jumps and it does not create the new window.
    I have detectec that the failure is here, but no why:
    //File "Archivo.java". the main file is "Engine.java"
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.awt.datatransfer.*;
    import javax.swing.text.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.filechooser.FileFilter;
    import analisisEspectral.*;
    class MFileChooser {
    public void abrirDelimitado(JFileChooser c, String delimitador)
              Tabla ntbl = null;       // Table to add
              DefaultTableModel ntblModel = null;
              int anterior = -1;
              int actual = -1;
              int fila = -1;
              DataHole dh = new DataHole();
    // add the table to the window, and create it
              try
                   (ntbl.jTable()).addFocusListener(new FLTablas());
                   if (Engine.mainWindow.tbls.size() == 0)
                  Dimension areaCliente = Engine.mainWindow.getContentPane().getSize();
                  int tamx = 1 * (areaCliente.width / 3);
                  int tamy = areaCliente.height;
                  int desplx = 0;
                  int desply = 0;       
            Engine.mainWindow.v_tablas = Engine.mainWindow.nuevaVentana ("PaleoPlot - Tablas", new Color(255, 155,155), tamx, tamy, desplx, desply);
                        Engine.mainWindow.v_tablas.addInternalFrameListener(new InternalFrameAdapter()
                                  public void internalFrameClosed(InternalFrameEvent e)
                                       Engine.mainWindow.tbls.clear();
                                       Menus.ItemsOnOff ioo;
                                       for (int i = 0; i < Menus.itemsOnOff.size(); i++)
                                            ioo = (Menus.ItemsOnOff)Menus.itemsOnOff.get(i);
                                            if ((ioo.nombre.compareTo("Cerrar") == 0) ||
                                                 (ioo.nombre.compareTo("Guardar") == 0) ||
                                                 (ioo.nombre.compareTo("Guardar como") == 0) ||
                                                 (ioo.nombre.compareTo("Imprimir") == 0) ||
                                                 (ioo.nombre.compareTo("A�adir fila") == 0) ||
                                                 (ioo.nombre.compareTo("Insertar fila") == 0) ||
                                                 (ioo.nombre.compareTo("A�adir columna") == 0) ||
                                                 (ioo.nombre.compareTo("Eliminar fila") == 0) ||
                                                 (ioo.nombre.compareTo("Eliminar columna") == 0) ||
                                                 (ioo.nombre.compareTo("Gr�fica") == 0) ||
                                        (ioo.nombre.compareTo("Potencia") == 0) ||
                                        (ioo.nombre.compareTo("Autocorrelacion") == 0) ||
                                        (ioo.nombre.compareTo("Fase") == 0) ||
                                        (ioo.nombre.compareTo("Potencia cruzada") == 0) ||
                                        (ioo.nombre.compareTo("Correlacion cruzada") == 0) ||
                                        (ioo.nombre.compareTo("Fase cruzada") == 0) ||
                                                 (ioo.nombre.compareTo("Fusionar") == 0))
                                                      ioo.item.setEnabled(false);
                                       Engine.mainWindow.numeroVentanas--;
                                  public void internalFrameActivated(InternalFrameEvent e)
                                       Menus.ItemsOnOff ioo;
                                       for (int i = 0; i < Menus.itemsOnOff.size(); i++)
                                            ioo = (Menus.ItemsOnOff)Menus.itemsOnOff.get(i);
                                            if (
                                                 (ioo.nombre.compareTo("Cerrar") == 0) ||
                                                 (ioo.nombre.compareTo("Guardar") == 0) ||
                                                 (ioo.nombre.compareTo("Guardar como") == 0) ||
                                                 (ioo.nombre.compareTo("Imprimir") == 0) ||
                                                 (ioo.nombre.compareTo("A�adir fila") == 0) ||
                                                 (ioo.nombre.compareTo("Insertar fila") == 0) ||
                                                 (ioo.nombre.compareTo("A�adir columna") == 0) ||
                                                 (ioo.nombre.compareTo("Eliminar fila") == 0) ||
                                                 (ioo.nombre.compareTo("Eliminar columna") == 0) ||
                                                 (ioo.nombre.compareTo("Gr�fica") == 0) ||
                                        (ioo.nombre.compareTo("Potencia") == 0) ||
                                        (ioo.nombre.compareTo("Autocorrelacion") == 0) ||
                                        (ioo.nombre.compareTo("Fase") == 0) ||
                                        (ioo.nombre.compareTo("Potencia cruzada") == 0) ||
                                        (ioo.nombre.compareTo("Correlacion cruzada") == 0) ||
                                        (ioo.nombre.compareTo("Fase cruzada") == 0) ||
                                                 (ioo.nombre.compareTo("Fusionar") == 0) )
                                                      ioo.item.setEnabled(true);
                   Engine.mainWindow.v_tablas.agregarTab(ntbl.nombreTabla());
                   Engine.mainWindow.v_tablas.agregarComponente(Engine.mainWindow.v_tablas.devolverPanel().getTabCount() - 1, ntbl);
                   Menus.ItemsOnOff ioo;
                   for (int i = 0; i < Menus.itemsOnOff.size(); i++)
                        ioo = (Menus.ItemsOnOff)Menus.itemsOnOff.get(i);
                        if (
                             (ioo.nombre.compareTo("Cerrar") == 0) ||
                             (ioo.nombre.compareTo("Guardar") == 0) ||
                             (ioo.nombre.compareTo("Guardar como") == 0) ||
                             (ioo.nombre.compareTo("Imprimir") == 0) ||
                             (ioo.nombre.compareTo("A�adir fila") == 0) ||
                             (ioo.nombre.compareTo("Insertar fila") == 0) ||
                             (ioo.nombre.compareTo("A�adir columna") == 0) ||
                             (ioo.nombre.compareTo("Eliminar fila") == 0) ||
                             (ioo.nombre.compareTo("Eliminar columna") == 0) ||
                             (ioo.nombre.compareTo("Gr�fica") == 0) ||
                    (ioo.nombre.compareTo("Potencia") == 0) ||
                    (ioo.nombre.compareTo("Autocorrelacion") == 0) ||
                    (ioo.nombre.compareTo("Fase") == 0) ||
                    (ioo.nombre.compareTo("Potencia cruzada") == 0) ||
                             (ioo.nombre.compareTo("Correlacion cruzada") == 0) ||
                             (ioo.nombre.compareTo("Fase cruzada") == 0) ||
                             (ioo.nombre.compareTo("Fusionar") == 0) )
                                  ioo.item.setEnabled(true);
                   Engine.mainWindow.tbls.add(ntbl);
                   Engine.mainWindow.activar(Engine.v_tablas);
              catch(java.lang.NullPointerException ex)
                   System.out.println(
                        "Archivo:MFileChooser.abrirDelimitado(): " +
                        "Error al a�adir tabla." + ex);
                   Engine.mainWindow.v_fija.ta.setText(
                        "Archivo:MFileChooser.abrirDelimitado(): " +
                        "Error al a�adir tabla.");
    } // end of abrirDelimitado method
    } // end of MFileChooser class
    .....Thanks very much for your anwers !!

  • Exception when use getAppletContext().showDocument(url);

    I want to open a page using getAppletContext().showDocument(yourURL), but it troughs the following exception:
    java.lang.NullPointerException
    java.applet.Applet.getAppletContext(Unkonow Source)
    This happen when i put the getappletcontext() in a method that I invoke at the end of the proces of my applet..but when I put the getAppletcontext() in the first method of my applet it works......., but because of the flow of my applet I have to put the getAppletContext() at the end...
    So my quiestion is: when do I have to use getAppletContext() and why is this exception is happening?

    Here is the code: for instance if I put getAppletcontext().showDocument(url) in the init() method or even in the onButtonClick() method it works, but the place where i have to put it is in the onSendData() method, but there doesn't work and happened the exception.....
    public class TestApplet2 extends JApplet implements ActionListener {
    UCapture active;
    JButton button;
    JComboBox scanner;
    JPanel buttonPanel;
    JPanel comboPanel;
    JPanel activePanel;
    JFrame frame;
    int scannerElegido;
    public void init() {
    try {
    System.out.println("begin..........");
    active = new UCapture();
    Evento appListener = new Evento();
    active.add_DUCaptureEventsListener(appListener);
    } catch (Exception e) {
    System.out.println("error en el constructor........");
    e.printStackTrace();
    try {
    activePanel = new JPanel();
    activePanel.setBorder(BorderFactory.createLineBorder(Color.black));
    activePanel.add(active);
    button = new JButton(" Capture ");
    button.setMnemonic(KeyEvent.VK_C);
    button.setBorder(BorderFactory.createRaisedBevelBorder());
    buttonPanel = new JPanel();
    buttonPanel.setBorder(BorderFactory.createLineBorder(Color.black));
    buttonPanel.add(button);
    Container container = getContentPane();
    container.add(active,BorderLayout.CENTER);
    container.add(buttonPanel,BorderLayout.PAGE_START);
    String[] scanners= new String[numScanner+1];
    scanners[0] = "Select Scanner";
    for (int i = 1; i <= numScanner; i++) {
    scanners[i] = active.getSensorManufacturerTR(i);
    scanner = new JComboBox(scanners);
    scanner.setSelectedIndex(0);
    scanner.setBorder(BorderFactory.createRaisedBevelBorder());
    comboPanel = new JPanel();
    comboPanel.setBorder(BorderFactory.createLineBorder(Color.black));
    comboPanel.add(scanner);
    container.add(comboPanel, BorderLayout.PAGE_END);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    onButtonClick();
    setVisible(true);
    } catch (Exception ex) {
    ex.printStackTrace();
    public void onButtonClick() {
    try {
    scannerElegido = scanner.getSelectedIndex();
    boolean openSensor = active.openSensor(scannerElegido);
    boolean captureFinger = active.captureFinger();
    } catch (Exception ex) {
    ex.printStackTrace();
    public void onSendData(Template template) {
    try {
    URL urlServlet = new URL("http://localhost:8080/triad/test.do");
    URLConnection con = (URLConnection) urlServlet.openConnection();
    // con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type","application/x-java-serialized-object");
    // send data to the servlet
    ObjectOutputStream oos = new ObjectOutputStream(con.getOutputStream());
    oos.writeObject(template.getTemplate());
    oos.flush();
    oos.close();
    // receive result from servlet
    con.getInputStream();
    ObjectInputStream inputFromServlet = new ObjectInputStream(con.getInputStream());
    Object result = (Object) inputFromServlet.readObject();
    inputFromServlet.close();
    // HERE IS WHERE THE EXCEPTION OCCURS
    URL urlServlet1 = new URL("http://localhost:8080/triad/test.do");
    System.out.println(getAppletContext().ShowDocument( urlServlet1);
    } catch (Exception ex) {
    ex.printStackTrace();
    public void stop() {
    try{
    active.closeSensor();
    catch (Exception ex) {
    ex.printStackTrace();
    public void actionPerformed(ActionEvent event) {
    }

  • Help with AudioClip files

    Hi, i got a problem with using AudioClip classes with jars, my application works normally when i use it with the command prompt, but it doesn't with a jar file, i specified the classpath in the manifest file and the main class as well, but this line of code throws me a NullPointerException:
    song = Applet.newAudioClip(getClass().getResource("./50_cent_-_candy_shop.mid"));The weird thing is that the images work, but not the file.
    Help is appreciated.

    Wow, when i use it in the command line it gives me the right path, but when i use it on the jar file it returns null.
    C:\Java\Programas\Hangman>java Play
    file:/C:/Java/Programas/Hangman/
    C:\Java\Programas\Hangman>jar -cfm Hangman.jar Manifest.mf *.class images *.mid
    C:\Java\Programas\Hangman>java -jar Hangman.jar
    Exception in thread "main" java.lang.NullPointerException
    at HangmanGUI.setEvents(HangmanGUI.java:223)
    at HangmanGUI.setComponents(HangmanGUI.java:144)
    at HangmanGUI.<init>(HangmanGUI.java:98)
    at Play.main(Play.java:5)

  • MissingResourceExc. IE 5.2

    Hello. Maybe someone can help me.
    I'm trying to run an applet in Internet Explorer 5.2 on Mac OS X which is able to run in Safari on Mac OS, IE 5.5. on Windows and Mozilla on Red Hat.
    IE 5.2 is throwing an exception..
    java.util.MissingResourceException: Can't find resource for bundle sun.applet.resources.MsgAppletViewer, key appletpanel.badattribute.exception
         at java.util.ResourceBundle.getObject(ResourceBundle.java:377)
         at java.util.ResourceBundle.getString(ResourceBundle.java:349)
         at sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:37)
         at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:699)
         at sun.applet.AppletPanel.init(AppletPanel.java:180)
         at sun.plugin.AppletViewer.init(AppletViewer.java:495)
         at com.apple.mrj.JavaEmbedding.JE_AppletViewerPanel.init(JE_AppletViewerPanel.java:48)
         at com.apple.mrj.JavaEmbedding.JE_AppletViewer.<init>(JE_AppletViewer.java:152)
         at com.apple.mrj.JavaEmbedding.JE_AppletViewerFactory.createAppletViewer(JE_AppletViewerFactory.java:81)
         at com.apple.mrj.JavaEmbedding.JE_AppletViewer.createWithAttributes(JE_AppletViewer.java:424)
         at com.apple.mrj.JavaEmbedding.JavaEmbedding.createApplet(JavaEmbedding.java:429)
    java.lang.NullPointerException
    java.lang.NullPointerException
    My applet is creating ImageIcons and reading from files which it can do in other environments....Why would IE 5.2 be throwing this particular exception?
    Thanks..

    Thank you for your post.
    I managed to resolve this error somehow. Before I did, I created a newer applet and compiled w/ version jdk 1.3.1 after removing calls to methods that are new as of 1.4 and still saw this error. So it didn't turn out to be a versioning problem.
    I wasn't using percentages in my applet tag, but your post is informative. Without realizing it at first, I had been using calculations which were returning decimals, and upon getting another error elsewhere I added code that changed the calculated values into integers. So using doubles or decimals as width and height values may have been creating this error and it may have been resolved by the code I wrote to convert these values to integers.
    Thanks again.

  • Can't create the processor JMF.

    Here is the simple code to cature a video. But I am getting an NullPointerException.
    <APPLET CODE=VideoCapture WIDTH=320 HEIGHT=300>
    </APPLET>
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import java.util.*;
    import javax.media.*;
    import javax.media.protocol.FileTypeDescriptor;
    import javax.media.protocol.DataSource;
    import javax.media.control.StreamWriterControl;
    import javax.media.format.*;
    import java.io.IOException;
    import java.lang.RuntimePermission;
    public class VideoCapture extends Applet implements ControllerListener
         Format format[] = new Format[1];
         FileTypeDescriptor outputType = null;
         Processor player = null;
         DataSink filewriter = null;
         public void init()
              format[0] = new VideoFormat(VideoFormat.CINEPAK);
              outputType = new FileTypeDescriptor(FileTypeDescriptor.QUICKTIME);
              try
                   player = Manager.createRealizedProcessor(new ProcessorModel(format,outputType));
                   System.out.println("Processor created");
              catch (IOException e)
                   System.out.println("IOException");
              catch (NoProcessorException e)
                   System.out.println("NoProcessorException");
              catch (CannotRealizeException e)
                   System.out.println("CannotRealizeException");
              DataSource source = player.getDataOutput();
              // create a File protocol MediaLocator with the location of the
              // file to which the data is to be written
              MediaLocator dest = new MediaLocator("e:\foo.mov");
              // create a datasink to do the file writing & open the sink to
              // make sure we can write to it.
              try
                   filewriter = Manager.createDataSink(source, dest);
                   filewriter.open();
              catch (NoDataSinkException e)
                   System.out.println("NoDataSinkException");
              catch (IOException e)
                   System.out.println("IOException");
              catch (SecurityException e)
                   System.out.println("SecurityException");
         public void start()
              try
                   filewriter.start();
              catch (IOException e)
                   System.out.println("filewriter can't be started");
              // Starting processor
              player.start();
              try
                   wait(5000);
              catch(InterruptedException e)
                   System.out.println("InterruptedException");
              // Stoping the Processor
              player.stop();
              // Closing the Processor
              player.close();
              try
                   wait(100);
              catch(InterruptedException e)
                   System.out.println("InterruptedException");
              // Closing DataSink
              filewriter.close();     
         public synchronized void controllerUpdate(ControllerEvent event)
                   validate();
    }I am getting this error because the following code is not working
    try
         player = Manager.createRealizedProcessor(new ProcessorModel(format,outputType));
         System.out.println("Processor created");
    }If you can help me please assist me.
    Right now I am having a great sort of difficulty due to this.

    I changed the path from e:\foo.mov to file:/e:/foo.mov
    SO now the NullPointerException is gone and new error arrives....
    java.lang.RunTimeException: No permissions to write from the applets

  • 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)

  • 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.

  • 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

Maybe you are looking for

  • Migo unplanned delivery cost

    Hi all,            Can I put delivery cost to separate account or G/L account during MIGO?               What are the configuratiosn for this …. Regards Sanjay

  • Linking 2 dimensions - NW

    Hi, Using BPC NW 7.02 I'm want to create a link between 2 dimensions (Entity and Projects). What I need is a link, that tells BPC to show me (in a report) only the projects related to the Entity I select. Does anyone know how to build that into BPC N

  • No free disk space on my Macbook Pro- why?

    Hi, i'm having a lot of trouble trying to free up disk space on my mac! I have 120g HD with 8G RAM. I'm using OS X 10.8.5 Disk Usage on Activity Monitor says i have used 110.29G and only 10.18G free, which i find ridiculous! I have backed up my compu

  • Send varible vaue one swf to another(child) swf??

    Hi I have made my project in diffrent flash files but now i m stuck to get data from child.swf to index.swf.

  • Cant play Mac made FCE4 QT movie on PC

    OK - so I made a movie with my new FCE4, exported as a Quicktime movie, 720p25 etc etc. The movie is 346mb, I burnt it to disk and my son's PC can't see the data on the disk let alone try to play it. He has the latest QT on his PC. What's going on? I