Exception during event dispatching - Dont want to use Swing.invokeLater()

I am getting NullpointerException while event dispatching. I am using threads, where each thread executes soem functions and one synchonized method to update graphics (table.updateUI())
I am using thread.start to invoke the threads and not SwinUtilities.invokelater(). I know this is the problem because threads which update graphics should be invoked by invokelater, so that they are in queue in the awt event thread.
But the method that updates gui is a synchonized method, so there should not be any collision. Also invokelater runs through all the threads and then invokes each, this reduces performance.
Any help is very much appreciated.
Thanks,
JavaSeems.

Hi Teka,
Thanks for the response.
Ok following is the exception i get :-
Exception occurred during event dispatching:java.lang.NullPointerException     at sun.awt.RepaintArea.paint(RepaintArea.java:300)     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)     at java.awt.Component.dispatchEventImpl(Component.java:2663)     at java.awt.Container.dispatchEventImpl(Container.java:1213)     at java.awt.Component.dispatchEvent(Component.java:2497)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
I read soem thread stuff and soem forums, all say that whenever thread updates gui, dont invoke them using start method, use invokelater. But that degrades performance, also all threads dont run simulanouelsy.
There will be a minimum of 6 threads in my program which will run for the lifetime of the dialog, so i need all of them to run simulatenoussly. But invokelater queues them in the awt evnt thread one after the other, and they dont run together.
The thread will update gui by methods like tabelmodel.updateRow, Table.updategui. I see exceptions after these statements.
Does this info help?

Similar Messages

  • Exception during event dispatching...

    Hello, Here is the Exception.
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    int oracle.dacf.control.NavigationManager._getChangeLevel(java.lang.String, java.lang.String, boolean)
    boolean oracle.dacf.control.NavigationManager._canChangeFocus(boolean)
    boolean oracle.dacf.control.NavigationManager.validateFocusChange(oracle.dacf.control.Control)
    void oracle.dacf.control.swing.ButtonControl.focusGained(java.awt.event.FocusEvent)
    void java.awt.AWTEventMulticaster.focusGained(java.awt.event.FocusEvent)
    void java.awt.Component.processFocusEvent(java.awt.event.FocusEvent)
    void javax.swing.JComponent.processFocusEvent(java.awt.event.FocusEvent)
    Any help? Thanks.
    null

    Hi Teka,
    Thanks for the response.
    Ok following is the exception i get :-
    Exception occurred during event dispatching:java.lang.NullPointerException     at sun.awt.RepaintArea.paint(RepaintArea.java:300)     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)     at java.awt.Component.dispatchEventImpl(Component.java:2663)     at java.awt.Container.dispatchEventImpl(Container.java:1213)     at java.awt.Component.dispatchEvent(Component.java:2497)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    I read soem thread stuff and soem forums, all say that whenever thread updates gui, dont invoke them using start method, use invokelater. But that degrades performance, also all threads dont run simulanouelsy.
    There will be a minimum of 6 threads in my program which will run for the lifetime of the dialog, so i need all of them to run simulatenoussly. But invokelater queues them in the awt evnt thread one after the other, and they dont run together.
    The thread will update gui by methods like tabelmodel.updateRow, Table.updategui. I see exceptions after these statements.
    Does this info help?

  • Exception during Event Dispatch

    hi
    I am executing a particular Swing program which throws up the following exception when a particular button is clicked
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: javax/mail/MessagingException
         at rclient.<init>(rclient.java:83)
         at clientgui.actionPerformed(clientgui.java:357)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
         at java.awt.Component.processMouseEvent(Component.java:3717)
         at java.awt.Component.processEvent(Component.java:3546)
         at java.awt.Container.processEvent(Container.java:1167)
         at java.awt.Component.dispatchEventImpl(Component.java:2595)
         at java.awt.Container.dispatchEventImpl(Container.java:1216)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2458)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2223)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2132)
         at java.awt.Container.dispatchEventImpl(Container.java:1203)
         at java.awt.Window.dispatchEventImpl(Window.java:918)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:336)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:134)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:101)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)
    This exception is thrown in some computers but not in the others. Can any one let me know the reason as to why this happens? This is very urgent..... please.

    If you are facing problems in compiling the class files, you can either put the mail.jar and activation.jar any folder and append it to the classpath or put the jar files in the jre/lib/ext folder. If you are facing problems at runtime, then u need put the jar files in the application/web-inf/lib folder.
    Let me know if you need more help.
    Regards,
    Ajit

  • JFileChooser : Exception occurred during event dispatching

    Hi,
    I'm having problems with sorting in 'Details' view of JFileChooser. I'm getting the following NullPointerException when I try to sort by clicking on the header of the JTable which I get in 'Details' view of a JFileChooser.
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at java.awt.EventQueue.isDispatchThread(Unknown Source)
    at javax.swing.SwingUtilities.isEventDispatchThread(Unknown Source)
    at javax.swing.JComponent.revalidate(Unknown Source)
    at javax.swing.JTable.resizeAndRepaint(Unknown Source)
    at javax.swing.JTable.sortedTableChanged(Unknown Source)
    at javax.swing.JTable.sorterChanged(Unknown Source)
    at javax.swing.RowSorter.fireRowSorterChanged(Unknown Source)
    at javax.swing.RowSorter.fireRowSorterChanged(Unknown Source)
    at javax.swing.DefaultRowSorter.sort(Unknown Source)
    at sun.swing.FilePane$DetailsTableRowSorter.access$1301(Unknown Source)
    at sun.swing.FilePane$DetailsTableRowSorter$1.call(Unknown Source)
    at sun.swing.FilePane$DetailsTableRowSorter$1.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any operation performed in the JFileChooser after this exception will generate the same exception & no action is performed. I'm using Java 1.6.0_24. Strangely, this is happening only in client-server mode. Staand-alone is working fine.
    Please provide some urgent inputs to this problem
    Thanks
    Dilip

    Thanks 4 d reply mKorbel, I'm not creating a TableModel. I'm just creating a JFileChooser as shown below.
    JFileChooser fileChooser = new JFileChooser(location);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setDialogTitle("Choose File");
    if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
    Now, the scenario is to bringup the FileChooser, go to Details view, apply sort on any column. This action creates the mentioned NullPointerException.

  • Exception occurred during event dispatching:java.lang.NoSuchMethodError

    Hello,
    We have upgraded to the latest Oracle Application Server version 10.1.2.3.0 and the webutil version is 1.0.6.
    But we face the following error while accessing the web link. Following message captured from Java Console.
    Please suggest if you have any solutions/idea about this error. Thanks !
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    Maximum size: 50 MB
    Compression level: 0----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Downloading http://si02938.in.irt.com:7778/forms/java/frmall_jinit.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/frmwebutil.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/jacob.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/FileInformation.jar to JAR cacheDownloading cacheproxyHost=nullproxyPort=0connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.3
    Exception occurred during event dispatching:java.lang.NoSuchMethodError     at oracle.forms.webutil.common.VBeanCommon.init(VBeanCommon.java:281)     at oracle.forms.handler.UICommon.instantiate(Unknown Source)     at oracle.forms.handler.UICommon.onCreate(Unknown Source)     at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)     at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)     at oracle.forms.engine.Runform.processMessage(Unknown Source)     at oracle.forms.engine.Runform.processSet(Unknown Source)     at oracle.forms.engine.Runform.onMessageReal(Unknown Source)     at oracle.forms.engine.Runform.onMessage(Unknown Source)     at oracle.forms.engine.Runform.processEventEnd(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.processEvent(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.run(Unknown Source)
    Edited by: user12233243 on Nov 16, 2009 10:28 PM
    Edited by: user12233243 on Nov 16, 2009 10:29 PM

    hi
    read the following configuration i hope it will help u.
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd [JacobStage]
    copy jacob.jar [OraHome]\forms\java\.
    copy jacob.dll [OraHome]\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add [OraHome]\jdk\bin to the PATH:
    set PATH=[OraHome]\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
    [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/[password]@[connectstring]
    @[OraHome]\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in
    Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    10) Run your form.
    If its Correct/Helpful please mark it thanks.
    Sarah

  • "Exception occurred during event dispatching". Help me, Please!

    Hi, All:
    when I runing my program, often catch below exception, I couldn't found where I'm wrong, and Why?
    Could you please, give the below exception and
    my code a quick search, and tell me how I to do it, and Why?
    sincerely
    yoursUrey
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:987)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:917)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:858)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
    at javax.swing.JComponent.paintComponent(JComponent.java:395)
    at javax.swing.JComponent.paint(JComponent.java:687)
    at javax.swing.JComponent.paintChildren(JComponent.java:498)
    at javax.swing.JComponent.paint(JComponent.java:696)
    at javax.swing.JViewport.paint(JViewport.java:668)
    at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
    at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
    at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
    EventQueueUtilities.java:124)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:987)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:917)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:858)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
    at javax.swing.JComponent.paintComponent(JComponent.java:395)
    at javax.swing.JComponent.paint(JComponent.java:687)
    at javax.swing.JComponent.paintChildren(JComponent.java:498)
    at javax.swing.JComponent.paint(JComponent.java:696)
    at javax.swing.JViewport.paint(JViewport.java:668)
    at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
    at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
    at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
    EventQueueUtilities.java:124)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    * the code of sort part *
    class TableMouseAdapter extends MouseAdapter{
    public void mouseClicked(MouseEvent env){
    Cursor headerCursor = tableHeader.getCursor();
    String cursorName = headerCursor.getName();
    Debug.println("Cursor Name : "+cursorName);
    TableColumnModel colModel = treeTable.getColumnModel();
    selectedColumnIndex = colModel.getColumnIndexAtX(env.getX());
    boolean isLeftMouse = SwingUtilities.isLeftMouseButton(env);
    if(isLeftMouse){
    if(cursorName.equalsIgnoreCase("Default Cursor")){
    if(env.getClickCount() == 2){
    // Sort the project of that column.
    model.sort(selectedColumnIndex);
    }else if(cursorName.equalsIgnoreCase("East Resize Cursor")){
    if(env.getClickCount() == 2){
    Debug.println("XLocation : "+env.getX());
    selectedColumnIndex = colModel.getColumnIndexAtX(env.getX()-10);
    Debug.println("Column index : "+selectedColumnIndex);
    if(selectedColumnIndex>0){
    // resize the width of this column.
    Vector columnValues = getColumnValues(selectedColumnIndex);
    int maxColumnWidth = getMaxColumnWidth(columnValues, selectedColumnIndex);
    resetColumnWidth(colModel, selectedColumnIndex, maxColumnWidth);
    //>> ******** the sort of the model in TableMouseAdapter
    public void sort(int columnIndex){
    this.sortColumnIndex = columnIndex;
    (new Thread(new ProjectSort(root))).start();
    //<< ******** the sort of the model in TableMouseAdapter
    //>>********** the sort thread run method ********************************
    public void run(){
    // Get the sorter from the stack, if the stack size is 0
    // then create a new sorter for the tree-table.
    MergeSort sorter = getSizeSorter();
    if( sorter == null )
    return ;
    // Set is Ascending sort or not ,
    if(oldSortColumn == sortColumnIndex){
    if(isSortAscending){
    isSortAscending = false;
    }else isSortAscending = true;
    }else {isSortAscending = false;}
    // if sort the tree table could not disply its originality node.
    // it would be disply its sort node
    isNeedOriginalityNode = false;
    sortNode(sorter, node);
    // when sort is over, then push the sort to the stack,
    // for to used at next time.
    recycleSorter(sorter);
    oldSortColumn = sortColumnIndex;
    // After the sort, you need to update the UI, and send the update
    // event to the EventCenter.
    treeTableView.getTreeTable().updateUI();
    EventCenter.broadcast(treeTableView.getTreeTable(), EventCenter.UPDATE, treeTableView.updateHashData());
    //<<********** the sort thread run method ********************************
    //>>********** the updateUI of the treeTableView.getTreeTable() *************
    public void updateUI() {
    TreePath selecedPath= null;
    if(tree!=null){
    selecedPath = tree.getSelectionPath();
    try{
    if(tree != null) {
    tree.updateUI();
    super.updateUI();
    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background",
    "Tree.foreground", "Tree.font");
    if(tree != null && selecedPath!=null) {
    //Set the seleted path after updateUI.
    tree.setSelectionPath(selecedPath);
    }catch(Exception exp){ exp.printStackTrace(); };
    //<<********** the updateUI of the treeTableView.getTreeTable() *************

    Dear, turingcomplete :
    Thanks for your help, I was changed the thread in my code, my problem was moved.
    thank you again
    sincerely
    yours Urey

  • Exception occurred during event dispatching:java.security.AccessControlExce

    Hi,
    I' m getting an error while connecting to database ORACLE 9i.
    I'm using JDK 1.6.0
    Actually the code is about how an Japplet connects to database ORACLE 9i
    when i was connecting using normal program i had got the connection easily .
    When i used this JApplet ,i'm getting this error.
    CODE:
    import java.awt.*;
    import javax.swing.* ;
    import java.sql.*;
    import java.awt.event.*;
    import java.util.*;
    /*<applet code="jln" width=400 height=400></applet>*/
    public class jln extends JApplet
    public void init()
    JTabbedPane jtp=new JTabbedPane();
    jtp.addTab("View Marks",new VmPanel());
    getContentPane().add(jtp);
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (Exception e)
    {              e.printStackTrace();
    System.out.println("Failed to load driver.");
    class VmPanel extends JPanel implements ActionListener
    JButton b1,b2;
    TextArea ta1;
    JTextField jtf1;
    Connection con=null;
    public VmPanel()
    b1=new JButton("ok!");
    b2=new JButton("clear");
    ta1=new TextArea();
    jtf1=new JTextField(10);
    add(jtf1);
    add(b1);
    add(b2);
    add(ta1);
    b1.addActionListener(this);
    b2.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
    String str1=ae.getActionCommand();
    if(str1=="ok!")
    try
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:jlngbldb", "scott", "tiger");
    Statement stmt = con.createStatement ();
    String ht=jtf1.getText();
    System.out.println("\nHello\n");
    ResultSet rs = stmt.executeQuery("SELECT * FROM jln WHERE ht='"+ht+"'");
    while(rs.next())
    ta1.setText ("");
    ta1.setText("Name:"+rs.getObject("name")+"HallTicket:"+rs.getObject("ht")+"C.G:"+rs.getObject("cg")+"C.D:"+rs.getObject("cd")+"UNIX:"+rs.getObject("unix")+" S.T.M:"+rs.getObject("stm")+"N.N:"+rs.getObject("nn")+"I.S:"+rs.getObject("ins"));
    rs.close();
    stmt.close();
    con.close();
    catch(SQLException ex)
    System.err.println("SQLException: " + ex.getMessage());
    if(str1=="clear")
    ta1.setText("");
    jtf1.setText("");
    if(str1==null)
    ta1.setText ("");
    ta1.setText("Please enter Hall Ticket Number above....");
    }//action performed close
    }//panel closed
    AND THE ERROR IS:
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.util.PropertyPermissio
    n oracle.jserver.version read)
    at java.security.AccessControlContext.checkPermission (AccessControlConte
    xt.java:321)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
    85)
    at java.lang.System.getProperty(System.java:627)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:433)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:548)
    at java.sql.DriverManager.getConnection(DriverManager.java :180)
    at VmPanel.actionPerformed(jln.java:60)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
    63)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2183)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased (BasicButtonL
    istener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5921)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3316)
    at java.awt.Component.processEvent (Component.java:5686)
    at java.awt.Container.processEvent(Container.java:1960)
    at java.awt.Component.dispatchEventImpl(Component.java:4360)
    at java.awt.Container.dispatchEventImpl(Container.java :2018)
    at java.awt.Component.dispatchEvent(Component.java:4194)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4222
    at java.awt.LightweightDispatcher.processMouseEvent (Container.java:3886)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3816)
    at java.awt.Container.dispatchEventImpl(Container.java:2004)
    at java.awt.Component.dispatchEvent (Component.java:4194)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:592)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:270)
    at java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.
    java:198)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:171)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)
    I'm getting this error when i pressed the OK! JButton.
    PLEASE ! help me by correcting this error.
    Thank You.

    Presumably you are running this via a browser where the applet is served from the server.
    Applets can only connect back to the origination server and using the name that the origination server was accessed with.
    And that has nothing to do with JDBC, all connections work that way.
    Your driver uses a connection thus it will not work unless it attempts to connect to the server that originated the applet.
    Solutions
    1. Connect to the server
    2. Sign the applet
    3. Modify the policy file of each client that will run the applet. This is not a good idea in an unsecure network.
    Note as well that in an unsecure network is most often a bad policy to have an applet directly accessing a database regardless.

  • Exception occured during Event Dispatching

    Hi,
    I am getting the following error,
    Exception occured during Event Dispatching:
    java.lang.NoSuchMethodError:java/net/URLEncoder.encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    at getURLPostString2.<init> (bytecode 552)
    at getURL2.<init> (bytecode 200)
    at testFrame.actionPerformed(bytecode 224)
    at java.awt.Button.processActionEvent(bytecode 12)---- --
    I initially had URLEncoder.encode() method in getURLPostString2.java then i removed that method from that class itself. i have the right method now in testFrame.java, there is an other class called fetchURL.java which uses the same method and it doesnot throw any exception. but the same exception is occuring in getURLPostString2.java even when i removed encode method from getURLPostString2.java. i have done all the necessary stuff like saving it and recompiling it but still the problem persists
    i am using jeode evm to compile my java files
    why is this weird problem occuring even when we have removed that method.

    That is kinda odd. Did you try deleting the old .class files first? Cuz if you delete the old class files and then recompile and still get the error than I would have to guess that you didn't fix the proble. Maybe you have some old code lying around that is still trying to call an old method? Maybe you have fixed the file with the wrong methods in it but not fixed the file that called those methods? That actualy seems to be right because a NoSuchMethodError really aught to be caught at compile time because the compiler checks to be sure all the calls you make actualy exist.

  • Information Regarding :Exception occurred during event dispatching

    Hi,
    I frequently get this exception when I click a button in a dialog and it opens up another frame of window. The exception trace includes java internal classes and my program classes line numbers. I have searched the net but could not get any concrete answer.
    Is this problem in java packages or should we take care of something in our code to avoid such exceptions.
    Below is the exception trace..........................
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1141)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4795)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4748)
    at javax.swing.JComponent._paintImmediately(JComponent.java:4692)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4495)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:409)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
    at java.awt.Dialog$1.run(Dialog.java:540)
    at java.awt.Dialog.show(Dialog.java:561)
    at java.awt.Component.show(Component.java:1192)
    at java.awt.Component.setVisible(Component.java:1147)
    at com.mycomp.example.DialogView.showWindow(DialogView.java:91)
    at com.mycomp.example.showWindow(StatusController.java:83)
    at com.mycomp.example.handleOk(ExampleController.java:842)
    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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5159)
    at java.awt.Component.processEvent(Component.java:4956)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3674)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    Thanks in advance.

    Hi All,
    Thanks for the replies and information posted by you.
    Below is some code snippet: ( complete code posting is difficult) ;-)
    Dialog1 is open, clicking on button say start it hides the current Dialog1 and opens the status dialog for Dialog1.
    Also, we are making the current Thread to sleep to avoid flickering.
    dialog1.hideWindow(); // Hide current window...
    Thread.currentThread().sleep(5); // sleep to avoid flickering..
    statusDialog.showWindow(); // to display status window..
    I will check and try to do modifications as per your suggestions.
    Thanks.

  • JTabbedPane: Exception occurred during event dispatching:

    Hi,
    I have a JTabbedPane where the tabs can be added dynamically by the method:
    private void addNewTab(JTable aTable) throws java.lang.NullPointerException
    final JTable t = aTable;
    Thread addTab = new Thread()
    public void run()
    JScrollPane scroller = new JScrollPane();
    JTable table;
    if (t==null)
    table = new JTable(columns, 0);
    else
    table = t;
    table.setColumnsEditable(colEditable);
    cachedTables.addElement(table);
    scroller.getViewport().setView(table);
    jtp.insertTab("Tab " + cachedTables.size(), null, scroller, "Tab", cachedTables.size()-1);
    jtp.updateUI();
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    jtp.setSelectedIndex(cachedTables.size()-1);
    jtp.validate();
    addTab.start();
    The problem is that occasionally (20% of the times) I receive this exception:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicTabbedPaneUI.rotateInsets(BasicTabbedPaneUI.java:1159)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabAreaInsets(BasicTabbedPaneUI.java:951)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.calculateTabAreaHeight(BasicTabbedPaneUI.java:924)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.paintContentBorder(BasicTabbedPaneUI.java:637)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.paint(BasicTabbedPaneUI.java:358)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
         at javax.swing.JComponent.paintComponent(JComponent.java:395)
         at javax.swing.JComponent.paint(JComponent.java:687)
         at javax.swing.JComponent.paintChildren(JComponent.java:498)
         at javax.swing.JComponent.paint(JComponent.java:696)
         at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
         at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
         at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
         at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Does none know, how I can solve the problem?
    Thanks,
    Diego.

    Fix the NullPointerException. The stack trace tells you the line that caused the problem.

  • Exception occurred during event dispatching: ArrayIndexOutOfBoundsException

    Java GUI app that runs fine in NT, ported over to Linux (sparc), recompiled and I get the following traceback when I run it, happens whenever I generate a SWING event. JDK 1.3.0. I have the same problem with the swingset sample app as well:
    Exception occurred during event dispatching:
    java.lang.ArrayIndexOutOfBoundsException: -1017
         at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:1485)
         at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:1355)
         at java.awt.Component.dispatchEventImpl(Component.java:2509)
         at java.awt.Container.dispatchEventToSelf(Container.java:1233)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2449)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:2314)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2189)     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
         at java.awt.Container.dispatchEventImpl(Container.java:1200)
         at java.awt.Window.dispatchEventImpl(Window.java:912)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:333)
         at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
    Here is also a small sample piece of code that makes it happen too. Whever I "hover" over the button this occurs.
    public class Test
    public static void
    main(String[] argv)
    throws Exception
    // set up GUI
    JFrame frame = new JFrame();
    frame.setBounds(0, 0, 100, 100);
    JPanel panel = new JPanel();
    frame.getContentPane().add(panel);
    panel.setLayout(new BorderLayout());
    panel.add(new JButton("Push me"), BorderLayout.NORTH);
    panel.add(new JLabel("Hello world"), BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
    return;

    In the case of this problem, it happens EVERY TIME I run the application (and happens with Swingset too) and it DOES affect the application. I can't click on buttons, etc. All swing events seem to generate this trace back. I tried recompiling all the code thinking I might have a bad class file or something, but to no avail. Could this be a version mis-match? I'm running Linux 6.2.

  • Exception occurred during event dispatching: Null pointer exception

    All,
    i have an applet which opens an applet window. in this applet window i have a list box.
    When a value in the list box is selected, i need to access a method in the applet(held in another class) that launches another window
    however i get the following error:
    Exception occurred during event dispatching: Null pointer exception
    (hope thats clear enough)
    p.s. i have created an instance of the class.

    That is not clear at all, but the cause for the exception is very easy:
    something is null that should not be null :)

  • Exception occurred during event dispatching: java.lang.UnsatisfiedLinkError

    Hi,
    Greetings. I am watching the following error in linux. I greatly appreciate your help.
    Thanks
    Rajkumar
    Exception occurred during event dispatching:
    java.lang.UnsatisfiedLinkError: no test in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at test.<clinit>(test.java:3)
    at Test.action(Main27.java:926)
    at java.awt.Component.handleEvent(Component.java:5341)
    at Test.handleEvent(Main27.java:1023)
    at java.awt.Window.postEvent(Window.java:1614)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.dispatchEventImpl(Component.java:3631)
    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.pumpEventsForHierarchy(EventDispatchThread.java:141)
    at java.awt.Dialog$1.run(Dialog.java:542)
    at java.awt.Dialog$3.run(Dialog.java:569)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:567)
    at Main27.first(Main27.java:67)
    at Main27.action(Main27.java:163)
    at java.awt.Component.handleEvent(Component.java:5341)
    at java.awt.Component.postEvent(Component.java:3885)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.dispatchEventImpl(Component.java:3631)
    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)

    In your test.java (Which must be yours, since all serious classes have capitalised names) you are trying to load a JNI library with
    static {
       System.loadLibrary("test");
      }Somewhere you should have a library file, I think called libtest.so, but the JVM can't find it.
    Find out where it is and put -Djava.library.path=<the directory>
    on the java command.

  • Exception during event processing

    I have an application which has an "exception catcher" at the bottom that performs some "exit work" that I need done when the program terminates abnormally.
    In certain places of the program, I automatically have the program quit and exit by dividing by zero to trigger an exception. Up until today, this technique has worked nicely.
    Today, however, I tried to do it in the middle of an AWT Event (a menu selection from a frame), in the following method:
    public void actionPerformed(ActionEvent event)
    Instead of the exception being handled by my routine, the program instead hangs without getting to the "catch" command that I usually use and instead generates the following sequence of error messages:
    Exception occurred during event dispatching:
    java.lang.ArithmeticException: / by zero
    at WTPFrame.actionPerformed(wtp.java:5335)
    at java.awt.AWTEventMulticaster.actionPerformed(Unknown Source)
    at java.awt.MenuItem.processActionEvent(Unknown Source)
    at java.awt.MenuItem.processEvent(Unknown Source)
    at java.awt.MenuComponent.dispatchEventImpl(Unknown Source)
    at java.awt.MenuComponent.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.run(Unknown Source)
    Is there any thing I can do to allow this exception to pass through to my handler so that the program doesn't hang?
    Thanks,
    Bruce

    When I was describing the business of subclassing an exception, this was independent of your hanging problem.
    The hanging thing is a consequence of the way that threading is done in a GUI application.
    Your app (by the sound of it) has two threads of execution running. The "main" thread is listening to the socket and running the game. The "EventDispatcher" thread is listening to the mouse and keyboard and redrawing the GUI.
    When a GUI event handler is called, this call is done by the event dispatcher thread. If you throw an exception from the handler, the loop in the event dispatcher thread just prints the stack trace and goes on listening for more mouse and keyboard events.
    To get the threads to communicate, you need for one thread to set a flag that the other thread can read. To interrupt the socket read, you need to call interrupt on the main thread from the gui thread. Lastly, to get the app to exit you must call System.exit().
    class Foo {
      volatile boolean weHaveToExit = false;
      Thread mainThread;
      // this method is called when the user clicks the exit button
      void exitMenuHandler() {
        weHaveToExit = true;
        mainThread.interrupt();
      public static void main(String[] av) {
        mainThread = Thread.currentThread();
        // create the menu
        // attach the event handler to it
         while(!weHaveToExit) {
             // process a game move
         System.exit(0);

  • Exception during event

    when i run my applet in the bronswer i get the folowing error:
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at sun.applet.AppletSecurity.checkAccess(Unknown Source)
         at java.lang.ThreadGroup.checkAccess(Unknown Source)
         at java.lang.ThreadGroup.<init>(Unknown Source)
         at java.lang.ThreadGroup.<init>(Unknown Source)
         at Ball.mousePressed(Ball.java:69)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(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.pumpOneEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source
    in the applet i have two thread .
    maybe the problem is in the thread?
    the code is:
    public void mousePressed(MouseEvent e)
         tg=new ThreadGroup("");
    t=new Thread(tg,this);
         t.setName("ball");
         t.start();
         setEnabled(false);
         }

    Your applet is performing an access to some harddisk resources or some network resources for which permission is not available.
    Using two threads should not give you that error.
    To solve give permission by updating the permissions file.
    Use java/bin/policytool.exe

Maybe you are looking for

  • Display of the field

    Hi, My report is based on XML Publisher template, output is EXCEL, I have one char field whose values are displayed in a strange format: e.g. Value of the field 0941001E01 is displayed as 9.41E+06 wherease 0741001G01 is displayed as 0741001G01 which

  • Vision + Box Question

    Does the new Vision + box run extraordinarily hot by design ? I have the new box and the fan at the back never seems to come on. The box gets incredibly hot during operation, far too hot to touch the surface. I cant believe they designed the box with

  • External USB Drive Not Shown in Finder... HELP!!!

    After upgraded to the latest OS X Lion, external USB drives plugged to my macbook pro (named A) won't show anything. I've tried cmd+opt+r+p twice but no luck; however, i am able to see it in Disk Ultilities and Storage in About This Mac... Another sa

  • How can I use loop in graphical message mapping

    The source input XML is like: <bookstore>   <book>        <item1>xxx</item1>        <item2>yyy</item2>   </book>   <book>         <item1>zzz</item1>        <item2>www</item2>  </book> </bookstore> I want to create an output XML like <output>    <item

  • K8N and Mushkin 222 doesn't work!

    Hey guys, I just bought an A64 3200+, MSI K8N Plat, and 1gig of Mushkin 222 special.  I've tried running it at 200mhz 2-2-2-5, 2-2-2-6, 2-2-2-10, 2-2-2-11, 2-2-2-12 @ 2.65v, 2.70v, 2.75v, and 2.8v but no luck yet.  The ONLY setting that's been able t