Catching unhandled exceptions

Is there any way to catch all unhandled exceptions from the AWT event dispatch thread? Actually I want to display an error message in a dialog box for unhandled exceptions instead of printing to stderr.
Although, for user threads this sort of thing can be easily done by extending ThreadGroup and overriding its uncaughtException() method, but this technique seemingly cannot be used with system threads.
Any ideas will be highly appreciated.
Thank you

I checked the article referenced above and found the message listed below. This seems to be the solution that I am looking for. But I am in doubt whether it will work with non-Sun VMs, since the method relies on setting a Sun AWT specific system property. Can anyone confirm this?
Re: Catching OutOfMemoryError in multithreaded GUI
Author: wathed Jul 4, 2001 11:35 PM
Can't find any documentation to back this up, but from the source it appears you can specify an exception handler to be called for Throwables on the AWT event thread:
1) YourHandler should have a method:
public void handle(Throwable t) {    ...}
2) use the following when invoking:
java -Dsun.awt.exception.handler=package.YourHandler MainClass

Similar Messages

  • Logging Unhandled Exceptions

    Is there a way to log all exceptions, including unhandled exceptions? What I want to do is have the exception log run on all or our client workstations. When an unhandled exception occurs (Murphy's Law), I want to be able to go view the client applications exception log and see what new an interesting bugs our user's have found.

    You can catch "unhandled" exceptions as well and do what you want with them.
    Things such as NullPointerException fall under RuntimeException. If you catch that, you can log it as you see fit.
    Is that what you're asking?

  • InitCVIRTE generates error message "Unhandled exception in "MyApp.exe": 0xC0000005: Access violation reading location 0x00000000."

    Hi,
    I have converted a LabWindows CVI project to Visual Studio 2005. When I start the application i debug mode I get the message "Unhandled exception at 0x685662ba in EE352-500V.exe: 0xC0000005: Access violation reading location 0x00000000."
    It comes when the application calls:  InitCVIRTE in this context:
    int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
    // Initialize LabWindows/CVI run-time library
    if (InitCVIRTE (hInstance, 0, 0) == 0)
    return -1; /* out of memory */
    The debugger indicates that value of hInstance is 0x00400000 {unused=9460301} 
    Can someone give me a solution to this problem. I have done some search on the Web without success.
    Thanks!

    I think that exception might be coming from the data execution prevention service that is part of Win XP SP2.  The OS thinks that you're somehow trying to execute in the data segment and kills the process.  It's intended to catch worms and viruses.
    You can turn this service off for non-Microsoft programs using the control panel.
    Many pointer handling errors now report as this exception instead of as a memory violation exception.  That looks like a null pointer derefence to me.
    Menchar
    Message Edited by menchar on 11-09-2007 07:12 PM

  • Configuring a Block Step and catching an exception

    Hi,
    Can we catch an un-handled exception from an Synchronous step(proxy-send-receive), within a BPM? Can we send the error back to the Sender? How do we go about dealing it when , the process in EOIO mode. having queues...i think such exceptions will lead to queues getting held up..
    Thanks & Regards
    XA

    > Can we catch an un-handled exception from an Synchronous step(proxy-send-receive), within a BPM? Can we send the error back to the Sender?
    Unhandled Exception cuasing Response mapping failed?  if it is not then you can send response back to Sender.
    the process in EOIO mode. having queues...i think such exceptions will lead to queues getting held up..
    Yes,mostly it happens.
    Regards,
    Raj

  • Unhandled Exception of type Exception

    Im getting an error message that says Unhandled Exception of type Exception when trying to us a method or when im trying to call a vector. What does that mean? Am i missing something? I would really appreciate your help.

    Which method? Try this:
    try {
       method();
    } catch(Exception e) {
       e.printStackTrace();
    }

  • Unhandled exceptions from ESP

    Hello,
    From time to time I am getting unhandled exceptions from ESP (5.1 v4 using .NET interface). This is happening only for the high rates of updates (300 records/s). ESP is dying internally, I am not even able to catch exception.
    That is the exception from .NET Runtime:
    Application: AvidPublisher.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException Stack:  at .SYBASE.Esp.SDK.EspPublisher.publish(SYBASE.Esp.SDK.EspPublisher*, SYBASE.Esp.SDK.EspPublishable*, SYBASE.Esp.SDK.EspError*)  at SYBASE.Esp.SDK.NetEspPublisher.publish(SYBASE.Esp.SDK.NetEspMessageWriter, SYBASE.Esp.SDK.NetEspError)  at FXDerivatives.Common.StreamingPlatform.EspHelper.Publish(System.String, System.Object[][], Int32)  at FXDerivatives.Common.StreamingPlatform.EspHelper.PublishToStream(System.String, System.Collections.Generic.IEnumerable`1, Int32, PublishMode)  at FXDerivatives.Common.Aleri.AleriLogWriter.PublishToAleri(System.String, System.String, System.String, FXDerivatives.Common.Aleri.AleriLogLevel, System.String, System.String, System.Collections.Generic.Dictionary`2)  at FXDerivatives.Common.Aleri.AleriLogWriter.Write(FXDerivatives.Common.Aleri.AleriLogLevel, System.String, System.String, System.Collections.Generic.Dictionary`2)  at FXDerivatives.Common.Aleri.AleriLogWriter.Write(FXDerivatives.Common.Aleri.AleriLogLevel, System.String, System.String, FXDerivatives.Common.MarketData.CurrencyPair, System.String)  at AvidPublisher.Publishers.Publisher.LogToAleri(FXDerivatives.Common.Aleri.AleriLogLevel, System.String, System.String, System.String, System.String)  at AvidPublisher.Publishers.Publisher.PublishAll(System.String, System.String, System.Collections.Generic.Dictionary`2)  at AvidPublisher.Publishers.Publisher+<>c__DisplayClass2.b__0(System.Object, System.Collections.Generic.Dictionary`2)  at FXDerivatives.Common.Utility.Bundler`2+DistributeEventHandler[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.Collections.Generic.Dictionary`2)  at FXDerivatives.Common.Utility.Bundler`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].DistributeEvents(System.Object, System.Timers.ElapsedEventArgs)  at System.Timers.Timer.MyTimerCallback(System.Object)  at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)  at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  at System.Threading.TimerQueueTimer.CallCallback()  at System.Threading.TimerQueueTimer.Fire()  at System.Threading.TimerQueue.FireNextTimers()  at System.Threading.TimerQueue.AppDomainTimerCallback()
    That is the Applciation error:
    Faulting application name: AvidPublisher.exe, version: 0.0.0.0, time stamp: 0x54083da6 Faulting module name: MSVCR100.dll, version: 10.0.40219.1, time stamp: 0x4d5f0c22 Exception code: 0xc0000005 Fault offset: 0x00010a5d Faulting process id: 0xd78 Faulting application start time: 0x01cfc82a6a680ae9 Faulting application path: D:\FXDeriv\Apps\AvidPublisher\AvidPublisher.exe Faulting module path: C:\Windows\system32\MSVCR100.dll Report Id: 48d4d149-341f-11e4-ae8a-0050569a4c0f
    Can you please advise? Are you experiencing similar problems?

    Pardon, if I wasn't clear. there are many types of applications that are actually failing, so there is no specific scenario. I have around 20 separate applications which are listening for changes and 1 aplication which copy all data from Aleri to ESP. This app never fails, as it is basically publishing around 15 different datatables sequentially. But those 20 separate applications are failing randomly when trying to consume data, and then save data back to ESP if required. there is 1 more place when application is failing, when different threads are subscribing to stream, and ESP crashes when we call: _subscriber.connect(espError);

  • Main thread isAlive() after an unhandled exception

    It appears that the main thread is "magic" in some way; after main() dies from an unhandled exception, isAlive() still reports true and join() waits forever for the (now moribund but apparnetly undead) main thread to die.
    Is there any way to detect (reliably) whether main() is really alive, as opposed to being some sort of zombie?
    Some code which demonstrates the problem:
    public class Termination {
    public static void main (String args[]) {
    Waiter w = new Waiter();
    w.start();
    try {
    Thread.currentThread().sleep(1000);
    catch (InterruptedException e) { }
    throw new RuntimeException("Bang!"); // the thread is still
    } // alive after this???
    class Waiter extends Thread {
    Thread t;
    public Waiter () {
    t = Thread.currentThread();
    public void run () {
    while (t.isAlive()) {
    System.out.println("Waiting for " + t);
    try {
    t.join(500);
    catch (InterruptedException e) {
    System.out.println("Interrupted");
    System.out.println("Joined " + t);
    System.out.println("Terminated: " + t);
    }

    This is not necessarially a solution or answer to your question, but an observation.
    The scope from whence the thread was spawned is main, main itself executes to completion. When the exception is caught, main is no longer executing once finally() is called. However, the Thread that is spawned is still alive and well, it continues to interact with itself. The thread needs to be destroyed. Check out my changes.
    Main is "dead" when the exception is thrown, and caught is called or if finally is defined it is called, I believe.
    public class Termination {
        public static void main (String args[]) {
            Waiter w = new Waiter();
            w.start();
            try {
                Thread.currentThread().sleep(1000);
            } catch (InterruptedException e) {
                w.destroy();  //destroy child thread
                //throw new RuntimeException("Bang!");
        class Waiter extends Thread {
            Thread t;
            public Waiter () {
                t = Thread.currentThread();
            public void run () {
            while (t.isAlive()) {
                System.out.println("Waiting for " + t);
                try {
                    t.join(500);
                } catch (InterruptedException e) {
                    System.out.println("Interrupted");
                    System.out.println("Joined " + t);
            System.out.println("Terminated: " + t);
    }

  • Elementsautoanalyzer.exe crash, unhandled exception at 0x004099BA in photoshop server.exe 0xc000005: acess violation writing location 0x000000

    Elementsautoanalyzer.exe crash, unhandled exception at 0x004099BA in photoshop server.exe 0xc000005: acess violation writing location 0x000000
    This the output of visual studio debugger when it crashes.  It crashes on startup and also when the organizer is running

    The call stack is below. I know that's not likely of much interest to the "users" reading this, but if there's a Safari engineer who happens by, maybe it means something to them.
    Good catch, Bubba!
    If you've got the time, could you put through a bug report to Apple for that one?
    If you want to track the bug, the best way to do that is to register (free) as an Apple Developer:
    [Register as an Apple Developer|https://swdlp.apple.com/cgi-bin/WebObjects/SoftwareDownloadApp.woa/18 32/wo/ghc5q6Ft5BfSvqaLsj00wg/2.5]
    ... and then you can use the Apple Bug Reporter to submit the bug:
    [Apple Bug Reporter|https://swdlp.apple.com/cgi-bin/WebObjects/SoftwareDownloadApp.woa/183 2/wo/ghc5q6Ft5BfSvqaLsj00wg/2.5]

  • A catch-all "exception handler" - what's the end of an stack trace?

    I've created an application that is beeing tested these days, and I thought it would be a good idea to implement a "catch-all" exception handler so that I could notify the user when an exception occur (so that he may stop, send me the log, and to prevent errors that occur as a result of the first one).
    The way I've started implementing it is I redirect error out to a custom output stream:
    public class ConsoleOutStream extends ByteArrayOutputStream {
        private JFrame owner;
        public ConsoleOutStream(JFrame owner) {
            this.owner = owner;
         * Writes <code>len</code> bytes from the specified byte array
         * starting at offset <code>off</code> to this byte array output stream.
         * @param   b     the data.
         * @param   off   the start offset in the data.
         * @param   len   the number of bytes to write.
        public synchronized void write(byte b[], int off, int len) {
            super.write(b, off, len);
            checkForExceptions();
         * Writes the specified byte to this byte array output stream.
         * @param   b   the byte to be written.
        public synchronized void write(int b) {
            super.write(b);
            checkForExceptions();
        private void checkForExceptions() {
            reset();
            if(this.toString().indexOf("xception") != -1) {
                System.out.println("Exception!!\n\n");
                System.out.println(this.toString());
    }then i redirect System.err:
    PrintStream out = new PrintStream(new ConsoleOutStream(this));
    System.setErr(out);
    The problem is that the checkForExceptions() method will be called, e.g. 3 times for each exception - and I just want to display an error message to the user once (of course).
    Anyone done something similar?

    I'm interested in catching all "unhandled errors"how about:
    public static void main(String[] args){
        try{
        //whatever you would normally call from main
        }catch (Throwable e){
             System.out.println("There was an unhandled exception:");
             e.printStackTrace();
    }

  • Unhandled exception type MalformedURLException

    Anyway, so I've been trying to create a log in form here, quite succesfull, until I got the error:
    Unhandled exception type MalformedURLException
    And in my eyes, that url isn't malformed... (I even tried: "http://www.google.com/index.html", but giving the same error)
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    public class login extends Applet implements ActionListener
         private static final long serialVersionUID = 1L;
         JTextField username;
         JPasswordField password;
         JButton submit;
         Label l_user, l_pass, empty;
         URL url;
         public void init ()
              setSize(200, 80);
              setBackground(Color.BLACK);
              setLayout(new GridLayout(3,2));
              l_user = new Label("Username:");
                   l_user.setForeground(Color.WHITE);
                   add(l_user);
              username = new JTextField(25);
                   add(username);
              l_pass = new Label("Password:");
                   l_pass.setForeground(Color.WHITE);
                   add(l_pass);
              password = new JPasswordField(25);
                   add(password);
              empty = new Label("");
                   add(empty);
              submit = new JButton("Log In");
                   submit.addActionListener(this);
                   add(submit);
         public void actionPerformed(ActionEvent e)
              url = new URL("http://www.mywebsite.com/logincheck.php?user=" + l_user.getText() + "&pass=" + l_pass.getText());
    }

    When the compiler tells you that, it is not telling you that the URL is malformed. Indeed, it does not have a way of knowing that. What it is telling you is that the URL constructor throws exception MalformedURLException, and you have to catch it. You have to catch it even if you are sure that the argument you supply to URL() will always be fine.
    I would just tell you how simple the fix is and show you, but you should probably check out the java exceptions tutorial instead so that you understand it yourself for future reference. You need to know how to handle exceptions anyway since they are an integral part of Java. You need to use them if you do anything beyond the very basics.

  • Can't view my user control in the designer (An Unhandled Exception has occurred)

    I'm using VS 2012, looking at some code I wrote some time ago. For some reason I cannot view the XAML in the design view, only the XAML view. I'm getting an error that says, "An Unhandled Exception has occurred". I can compile the solution fine,
    but it won't let me view it. I don't know why I can't view it in the designer. Here's the error details:
    Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
    Object reference not set to an instance of an object.
       at System.Windows.StyleHelper.FindNameInTemplateContent(DependencyObject container, String childName, FrameworkTemplate frameworkTemplate)
       at System.Windows.TemplateNameScope.System.Windows.Markup.INameScope.FindName(String name)
       at MS.Internal.Data.ElementObjectRef.GetObject(DependencyObject d, ObjectRefArgs args)
       at MS.Internal.Data.ObjectRef.GetDataObject(DependencyObject d, ObjectRefArgs args)
       at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.VerifySourceReference(Boolean lastChance)
       at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
       at MS.Internal.Data.DataBindEngine.Run(Object arg)
       at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
       at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.UIElement.UpdateLayout()
       at System.Windows.Interop.HwndSource.SetLayoutSize()
       at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
       at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteUIElement.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteUIElement.CreateContent>b__11()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessQueue(CallQueue queue)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessInboundAsyncQueue(Int32 identity)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessMessage(Int32 msg, IntPtr wParam, Boolean elevatedQuery, Boolean& handled)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.RunApplication()
       at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.<>c__DisplayClass2.<Main>b__0()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
    Rod

    I stopped when I saw stuff about databinding.
    I guess your problem is you have code in your constructor.
    A prameterless constructor of a view will be called by the designer.
    This is probably trying to use things which aren't there at design time.
    You can mock them or just exit out the constructor if you're in the designer.
    public YourUserControlConstructor()
    InitializeComponent();
    if (DesignerProperties.GetIsInDesignMode(this)
    return;
    // Dependent code which produces errors
    http://social.technet.microsoft.com/wiki/contents/articles/29874.wpf-tips-designer-detection.aspx
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • In R12.1.3 we get FRM-40735: ON-ERROR trigger raised unhandled exception.

    Hello,
    after we upgrade to R12.1.3 users are getting FRM-40735: ON-ERROR trigger raised unhandled exception ORA-01001, can you please help to resolve this issue immediately.

    Can you provide the list of patches you have applied?
    In addition to the log files mentioned above, please confirm that you have no invalid objects in the database.
    Loading the System Administrator Forms Responibility Produces Error FRM-40735,ORA-06508 (Doc ID 271652.1)
    Oracle Application Return The following Error FRM-40735: ON-ERROR trigger raised unhandled exception ORA-6508 (Doc ID 797293.1)
    After Migrating To Linux, Users Are Seeing FRM-40735 When Trying To Access Forms. (Doc ID 1282488.1)
    Thanks,
    Hussein

  • FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403

    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    I am getting the above error when i am trying to change the Assignment Category field of
    an employee from Junior Staff to Senior Staff.
    Navigation People> Enter & Maintain> (B)Assignment.
    Kindly assist me to resolve this error.
    Plz note there is a promotion that is suppose to be given to some employees in our company as of
    01-APR-2010 so i had to open the closed payroll periods and do the changes. I managed to change for all
    the 9 employees but 1 employee's assignment is giving me an error as follows :
    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    The error displays after i try to save the changes made to the Assignment Category from Junior Staff to Senior Staff.
    NB: i have also tried to switch off the custom code...but its giving me same error.
    Also the element links have been defined for employment category on the links window.
    please help!!
    Edited by: 594647 on Jul 20, 2010 10:26 PM

    Release 12.1.1.
    OS is Red Hat Ent Ed 4
    i am trying to change the employee assignment category from Junior to Senior. so when i am updating the assignment details on the assignment screen (Navigation is People >Enter & Maintain> Assignment) and trying to save, the system gives error on the status bar of the application as follows:
    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    NB: Error is appearing on the Assignment screen.
    Please help!!
    Edited by: 594647 on Jul 21, 2010 2:48 PM

  • Not able to catch the exception

    Hi,
    I'm trying to run an ADF page (Test.jspx) . The only page content I have is an embedded BI report.
    I have used a report executable in my page definition.
    A sample code snippet is:
    <executables>
    <biContent id="biExecBinding1" connectionId="TMBIPresentationServerConn" path="/shared/TMSharedFolders/MOT_SalesAccount" type="biReportContent" xmlns="http://xmlns.oracle.com/bi/report/bindings">
    </executables>
    Here TMBIPresentationServerConn is the name of the connection of the BI Server.
    If BI Server is down, on running my page , an exception is being thrown by the framework.
    I want to catch this exception and perform my own logic, but since i am using a binding context for report , i am not able to catch this exception.
    Could you please let me know how can i catch the exception if BI is down?
    Thanks
    Nutan

    (as I suspected from your first post)
    You are using a version of JDeveloper that isn't available to the general public, and are asking about it on a public forum. You should use the internal Oracle forum - I don't know the URL, because I am one of the unwashed general public ;)
    John

  • Unhandled exception has occurred in your application

    I was update my NB to windows 8.1 and has a error that show on start up pls Help
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Net.WebException: An exception occurred during a WebClient request. ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\explorer_1.exe' is denied.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
    at System.Net.WebClient.DownloadFile(Uri address, String fileName)
    --- End of inner exception stack trace ---
    at System.Net.WebClient.DownloadFile(Uri address, String fileName)
    at System.Net.WebClient.DownloadFile(String address, String fileName)
    at WindowsFormsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Form.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WmShowWindow(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    WindowsFormsApplication1
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Windows/bat_starter.exe
    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    For example:
    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

    There is an auto-run program on your system that is failing.
    You will need to identify the start up programs on your system, then block them, one by one, until the error message does not appear on startup. The last blocked program will be the culprit. Repair or reinstall that program.
    If you need help identifying the startup programs on your Win 8.1 system, get help here:
    http://answers.microsoft.com/en-us/windows/forum/windows8_1?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1390235003475

Maybe you are looking for