Why am I getting this exception???

Every once in a while I get the following exception when starting my app, and I can't figure out why... Why??
java.lang.NullPointerException
     at javax.swing.SwingUtilities.computeIntersection(SwingUtilities.java:369)
     at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
     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.pumpEvents(EventDispatchThread.java:145)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

This is actually a very hard question. Swing is designed to be fast so it is not thread safe. That means if you do something to a swing component while its being painted, you get this type of exception. Notice how it does not mention your own code anywhere in the stack trace. The "Event Dispatcher Thread' is trying to paint something and you are probably changing its size, setting its visibility to false, removing it form its container, moving it, changing the data in its model, etc. Your code is doing something to the component at the exact moment its being painted, and this exception is thrown.
There are two general strategies for dealing with this problem:
1) When you modify swing components, use SwingUtilities.invokeLater() to make the event dispatcher thread do the work.
2) Do your work in a synchronized block, something that looks like this (say you are removing rows from a table):
synchronized ( table.getTreeLock() ) {
  // do work here...
}Either of these strategies will prevent this type of error from happening. It's a tought problem, since it can happen anywhere, is usually hard to reproduce, and difficult to verify it's actually fixed.

Similar Messages

  • Why  i always get this exception

    i have one table and i use custom renderer to format the number value inside the table to 2 decimal points and when user click on a particular cell it will pop up a dialog also with a table and display detail value correspond to the value that user click, but the problem is i always get this exception anyone knows why?
    java.lang.ArrayIndexOutOfBoundsException: 3 >= 3
         at java.util.Vector.elementAt(Vector.java:431)
         at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:618)
         at net.devicesworld.common.ui.SortableTableModel.getValueAt(SortableTableModel.java:56)
         at javax.swing.JTable.getValueAt(JTable.java:1771)
         at javax.swing.JTable.prepareRenderer(JTable.java:3724)
         at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
         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:410)
         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.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    actually i already check for the row and column index this is what i do for the getvalueat method inside the table model
    public Object getValueAt(int row, int col) {
    int rowIndex = row;
    if (indexes != null && row < indexes.length && row >=0) {
    rowIndex = indexes[row];
    if(rowIndex < 0){
    return null;//super.getValueAt(0, col);
    }else if(rowIndex >= super.getRowCount()){
    return super.getValueAt(getRowCount() - 1, col);
    }else if(col >= super.getColumnCount()){
    return super.getValueAt(rowIndex, super.getColumnCount()-1);
    }else
    return super.getValueAt(rowIndex >= getRowCount() ? getRowCount() - 1 :
    rowIndex,
    col >= getColumnCount() ? getColumnCount() - 1 :
    col);
    }

  • Why do i get this exception?

    Hi,
    i have a CompanyVO class, wich also has members such AddressVO, UserVO. As you can see, i have some other value objects inside CompanyVO.
    When i do this:
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);CustomCompanyVO is an object that has only "direct" properties of CompanyVO, stuff like companyName, companyID, companyType (basically all of them are String).
    But when i do this.
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);
    BeanUtils.copyProperties(companyVO.getAddressVO(), addressVO);I get the following excetion just on the third line (note the addressVO contain the values to be transfered to AddressVO, wich a VO inside the CompanyVO, as i said).
    java.lang.IllegalArgumentException: No destination bean specified
    at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:220)
    at ltcmelo.session.RegisterCompanyBean.saveCompanyAddressInfo(RegisterCompanyBean.java:157)
    So, if i already initialize the companyVO doesn't the addressVO and the userVO memers have to be initialized too ???
    This way i'm force to do such thing.
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);
    AddressVO auxAddressVO = new AddressVO();
    BeanUtils.copyProperties(auxAddressVO, addressVO);
    companyVO.setAddressVO(auxAddressVO);Is there a better option????

    No, no, no....
    There's a misunderstanting here! Sorry, it's my fault!
    addressVO is already initialized and populated with data.
    BUT, the addressVO that is a member of companyVO is NOT !!!
    Using BeanUtils, i'm trying to populate what's FROM addressVO (wich contains data) TO companyVO.getAddressVO (wich has not been initializes).
    So, i thought the i could initialize companyVO.getAddressVO in the way, but as i get the exception, it seems that it's not possible.
    My question is WHY is it not possible??? It seems ok to me to copy addressVO to companyVO.getAddressVO in that way.

  • Why I keep getting this exception?

    I try to introduce JSTL into my current work. I keep getting the following error
    The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this applicationAfter searching this issue on the internet, I place the standard jstl 1.1.2 in our library direction under the WEB-INF. It doesn't go away however. The container is WebSphara Community Edition with jdb 1.5.
    What is missing here?

    What version of Websphere?
    What servlet spec does it support? You can find out with this JSP snippet:
    Working with server: <%= application.getServerInfo() %><br>
    Servlet Specification: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %> <br>
    JSP version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br>
    Java Version: <%= System.getProperty("java.version") %><br>You have the files
    - jstl.jar
    - standard.jar
    both in the WEB-INF/lib directory?
    Restarted the server?
    Are you sure it is JSTL1.1.2?
    Open the file standard.jar in something like winzip.
    Take a look at the manifest.mf file to check version.
    Does standard.jar contain all the necessary tld files? c.tld - c-1_0.tld, c1_0-rt.tld

  • Why do I get this error when specifying a parameter from the URL?

    Hello,
    I am trying to "install" a parameter in a page, so that it's value can be specified in the URL and a VO updated according to this value.
    Here's is the page definition file, with an executable and a binding to a method call:
    <executables>
    <invokeAction Binds="prepareMainMenuView1" id="invokeQuery"
    Refresh="prepareModel"/>
    </executables>
    <methodAction id="prepareMainMenuView1"
    InstanceName="AppModuleDataControl.dataProvider"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="prepareMainMenuView1"
    IsViewObjectMethod="true">
    <NamedData NDName="param" NDValue="#{param.root_menu}"
    NDType="java.lang.String"/>
    </methodAction>
    if I run the MyMenu application with:
    http://127.0.0.1:7101/MyMenu-ViewController-context-root/faces/menu?root_menu=anything
    then I get this exception:
    ADF: Adding the following JSF error message: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    Do you know why? Where do I fail?
    I followed the isntruction here:
    http://www.jasonsdevelopercorner.com/?p=65
    So far I have not been able to read a parameter in a way, do you have any example on how can I use parameters from URL from within a single page in an unbounded task flow?
    I worked all the day on this, but with no luck.
    Thanks

    I solved the problem. The invoked method was not part of the VO, but was part of the AM.

  • Why do i get this error?

    Hi
    When i run my code i get this exception,
    java.lang.ClassCastException: java.lang.Integer
    at has33.main(has33.java:29)
    Why is it that i get this exception?
    And could some help me so that i doun't get this Exception?
    thanks
    nicky
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class has33{
    public static void main(String[] args) {
    Hashtable ht = new Hashtable();
    //Add vector to store results
    Vector results = new Vector();
    Object value = null;
    int keys[] = {1,2,3,4,5,6,7,8,9,10};
    //System.out.println(keys);
    String values[] = {"ben", "ben", "alex", "alex", "matt","matt", "mum", "mum", "dad", "matt"};
    // First, map keys to values in a hashtable
    Hashtable hash = new Hashtable();
    // the code matches values one by one for each of the keys
    for(int i = 0; i < keys.length; i++) {
    hash.put(new Integer(keys), values[i]);
    // Then we find each value and remove it from the hashtable
    for(int j = 0; j < values.length; j++) {
    ht = (hash);
    value = (values[j]);
    Vector v = new Vector();
    String token = null;
    StringTokenizer st = null;
    if( ht.containsValue( value )) {
    Enumeration e = ht.keys();
    while (e.hasMoreElements()) {
    String tempkey = (String)e.nextElement();
    String tempvalue = (String)ht.get(tempkey);
    if (tempvalue.equals(value)) {
    v.add(tempkey);
    ht.remove(tempkey);

    No i mean to put then strings and Integers in hashtable like this
                             hash.put(new Integer(1), ben);
                             hash.put(new Integer(2), ben);
                             hash.put(new Integer(3), alex);
                             hash.put(new Integer(4), alex);
                             hash.put(new Integer(5), matt);
                             hash.put(new Integer(6), matt);
                             hash.put(new Integer(7), ben);
                             hash.put(new Integer(8), matt);
                             hash.put(new Integer(9), dad);
                                            hash.put(new Integer(10), dad);thanks
    nicky

  • Why am I getting this error?

    Hello,
    I am trying to call my Java class from a JSP page. I am getting this error:
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\em\jsp\Test_0005fSummarySBU_0005fscreen$jsp.java:82: Wrong number of arguments in constructor.
    strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
    I don't understand why I am getting this error as I pass three paramters to the Java class, and I accept three parameters in the constructor.
    JSP:
    <!-- META TAG is necessary to ensure page recompiles--------------->
    <META Http-Equiv="Expires" Content="0">
    <META Http-Equiv="Pragma" Content="no-cache">
    <HTML>
    <!-- The two Java Classes used to build the AlphaBlox query -->
    <%@ page import="com.home.tool.reporting.*" %>
    <%@ page errorPage="run_error.jsp" %>
    <%@ page import="java.util.List,
                     java.util.Collection,
                java.net.URLDecoder" %>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE>Economic Model - Summary SBU Report</TITLE>
    <!--Run the onload here, re-retrieve params BM and Breport, pass to onload---------->
    <BODY bgcolor=#ffffff>
    <%
                    Collection strQuery = null;
                    String strEssUser = "test";
                    String strProcessingMonth = "JUL";
                    String strProcessingYear = "2002";
                    strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
                    System.out.println(strQuery);
    %>
    </BODY>
    </HTML>Java class:
    package com.home.tool.reporting;
    import java.net.URL;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class ListReturn extends ReportQueryBuilder
            public void ListReturn()
            public Collection ListReturn(String userID, String pMonth, String pYear)
                throws ReportQueryBuilderException
                //declare Collection store Value-Object pairs
                Collection c = new ArrayList();
                //declare and initialize variables
                CallableStatement cs = null;
                ResultSet rs = null;
                // declare call for stored procedure to pass in three parameters
                String pass = "{Call dbo.p_rep_srSbuList(?, ?, ?)}";
                try
                    //open CallableStatement using JDBC connection to SQL database
                    cs = con.prepareCall(pass);
                    //set IN parameters
                    cs.setString(1, userID);
                    cs.setString(2, pMonth);
                    cs.setString(3, pYear);
                    //execute call and return result set
                    rs = cs.executeQuery();
                    //loop through result set storing each record as a Value-Object pair
                    while(rs.next())
                        c.add(new ListBoxValueObjects(rs.getString(1), rs.getString(2)));
                catch (SQLException sqle)
              throw new ReportQueryBuilderException(replaceToken("Problems executing query: "+sqle.getMessage(), "'", "\\'"));
                finally
                    try
                        //close the Result Set and CallableStatement
                        rs.close();
                        cs.close();
                    catch(Exception e)
                        System.out.print("\nFATAL   : " + e);
                        System.out.print("\nFATAL   : " + e);
                return c;
    }Does anyone see whay I am getting this error??
    I can't figure out the problem!

    change this:
    <%
         Collection strQuery = null;
         String strEssUser = "test";
         String strProcessingMonth = "JUL";
         String strProcessingYear = "2002";
         strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
         System.out.println(strQuery);
    %>To this:
    <%
         Collection strQuery=null;
         String strEssUser="test";
         String strProcessingMonth="JUL";
         String strProcessingYear="2002";
         lr=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
         System.out.println(lr.getQuery())
    %>Then make a new public method in your Java called getQuery()
    public Collection getQuery();Do what you need to do to process it and return the value in getQuery. You will also probably need to make private variables in you declaration to do the processing on.

  • TS1702 "The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    Before trying the update again, use Microsoft's Fix it solution at http://support.microsoft.com/mats/Program_Install_and_Uninstall. Use it to uninstall iTunes and Quicktime. It bypasses this not uncommon problem. When the solution finishes, the selected program will be uninstalled. It can take several minutes and I have seen as much as half an hour.
    After iTunes & Quicktime are uninstalled, try the update again.

  • I get missing plug-in error when opening my online bill which is in PDF format. I am using a 2010 Macbook with the latest version of Safari and Adobe suite installed in my computer. Why do I get this error? What should I do?

    I get missing plug-in error when opening my online bill which is in PDF format. I am using a 2010 Macbook with the latest version of Safari and Adobe suite installed in my computer. Why do I get this error? What should I do?

    In relation to my previous inquiry regarding inability to view a pdf file using Safari...
    Is it possible that I can view other online bills from other website but not this particular bill from one specific website?
    Sorry if I missed any important point in this article -->Apple Safari 5.1 and Adobe Reader/Acrobat Advisory
    Thanks again!

  • Why do I get this error message when I open Organizer in Photoshop Elements 11 "Elements Organizer has stopped working"? My only option is to Close Program so I am effectively locked out of my photo catalogue.  I have reinstalled the program to no avail.

    Why do I get this error message when I open Organizer in Photoshop Elements 11 "Elements Organizer has stopped working"? My only option is to Close Program so I am effectively locked out of my photo catalogue. I have tried reinstalling the program but it made no difference to the error message.
    Could someone help please?  Steph

    Hi,
    Please give a try to Photoshop Elements (PSE) knowledge base. steps mentioned on this and see if it works.
    Regards
    Kishan

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • I received an error "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened b4

    i received an error message "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened before. yesterday did the sofware update for maverick.

    Thank you for your response, Chris. But I'm afraid I have to disagree. There are native 64 bit versions of iTunes available for OSX and Windows.
    In a 64 Bit Windows environment native 64 Bit Applications install the DLL's in a directory called "Program Files" and a directory called "Program Files (x86)" (32 Bit applications only use the ladder).
    iTunes 9 is consistent with this behavior - and it identified itself to the system as a 64 bit application (meaning it's process appears without a "*32" tag on it).

  • More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library.

    I am able to pick 4 videos from the Photo library in my iPhoneAPP but when i try to pick 5th one it throws an error:
    "More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library."

    Hello Tate r Bulic
    I don't have any idea how to remove this error,can i pick more than 5 videos from the photo library...
    If it's then please help me and gimme idea..Thanks

  • According to my network provider (Amaysim/Optus) Tethering is enabled, so why do I get this error message "to enable personal hotspot on this account, contact OPTUS"

    According to my network provider (Amaysim/Optus) Tethering is enabled, so why do I get this error message "to enable personal hotspot on this account, contact OPTUS"
    Amysim/Optus support can not help.
    I can not check or change any network settings (no APN settings)
    I have synced phone using latest itunes (10.5.3).
    Phone software is up to date (5.0.1).
    Network settings have been reset.
    SIM card has been taken out and put back in.
    Phone has been switched off/on again.
    Another sim card from virgin works ok (hotspot option is visible and can be turned on/off as required)
    The Amaysim/Optus SIM card can be put into another phone (android) and tethering/hotspot works fine.
    Can anyone provide solution to this nightmare?

    I am having the same issue although i have an iphone 5. I have contacted Live connected numerous times an tried everything imaginable to solve the issue. Is it possibly a handset issue? I cant recieve any help from optus as im with live connected, they cant help me and apple keep telling me to contact your carrier ( live connected). Seems to make me want to switch providers pretty shortly..
    please let me know if you can solve your issue and maybe it can help me too..

  • Why do I get this errorThe server responded with "502" to operation CalDAVAccountRefreshQueueableOperation.

    Why do I get this message in iCal
    The server responded with
    “502”
    to operation CalDAVAccountRefreshQueueableOperation.
    And then it disappears it is very annoying, also for the mail program it gets password rejected by server. I have checked all the settings they are correct. What's the deal ATT says its me.

    Hi, is this Mail the old defunct MobileMe perchance?
    If so, do you have an iCloud account yet?
    I understand .mac mail will still come through. Do not delete the old account yet.
    You cannot use .mac or MobileMe as type of Account, you have to choose IMAP when setting up, otherwise Mail is hard coded to change imap.mail.me.com to mail.me.com & smtp.mail.me.com to smtp.me.com, no matter what you try to enter.
    iCloud Mail setup, do not choose .mac or MobileMe as type, but choose IMAP...
    On second step where it asks "Description", it has to be a unique name, but you can still use your email address.
    IMAP (Incoming Mail Server) information:
    • Server name: imap.mail.me.com
    • SSL Required: Yes
    • Port: 993
    • Username: [email protected] (use your @me.com address from your iCloud account)
    • Password: Your iCloud password
    SMTP (outgoing mail server) information:
    • Server name: smtp.mail.me.com
    • SSL Required: Yes
    • Port: 587
    • SMTP Authentication Required: Yes
    • Username: [email protected] (use your @me.com address from your iCloud account)
    • Password: Your iCloud password
    Also, you must upgrade your password to meet the new criteria:  8 characters, including upper and lower case and numbers.  If you have an older password that does not meet these criteria, when you try to setup mail on your mac, using all of the IMAP criteria listed above, it will still give a server error message.  Go to   http://appleid.apple.com         then follow directions to change your password, then go back to setting up your mail using the IMAP instructions above.
    Thanks to dpepper...
    https://discussions.apple.com/thread/3867171?tstart=0

Maybe you are looking for

  • Adobe Cloud Apps

    Why is soundBooth missing from the Adobe Cloud Apps?

  • Calling a function from another class - help!

    I realize that this is probably a basic thing for people who have been working with JavaFX for a while, but it is eluding me, and I have been working on it for over a week. I need to call a function that is in another class.  Here's the deal.  In Ent

  • Laptop puged in shows charging but batery is not charging

    Hello, Ihave an HP Probook 4540s, and recently it started to act up, i plug it in it shows on the window pluged in,charging. The animation moves for a second and then stops. Weird thing is sometimes it charges only if i leave it for the night pluged

  • Why are my audio files separate?

    Working in FCP 7.  My clips are linked but when I make any audio adjustments they only happen on one channel.  Up until this current project if I changed any levels or added and audio keyframes I would see the adjustment on both channels.  I haven't

  • Pushing and pulling from Premiere Pro CS 5

    Hi, Recently, I came across a problem and I was wondering if you could confirm this is a limitation within Production Premium CS 5 or whether I am doing something incorrectly? If I render a sequence within Premiere Pro and push it to Encore via Adobe