exception

What kind of behaviour causes an interrupted exception?

I'm relatively new to Threading in Java and I've noticed that everytime I use Thread.sleep() I have to catch InterrupetdException. What kind of behaviour causes this, and in simple applications where I have a monitor thread can I just Ignore the exception? ...

.NET SOAP Extension is throwing NullReferenceException inside MethodInfo?

NOTE: Using .NET 2.0, and VS2005 as IDE Hello all, I'm working on logging webservice calls to our database, and finally got the SoapExtension configured and running using a very stripped-down implementation that was ported over from another project. I've set it up in the configuration file so it will run for all methods. When I call ...

ExceptProc not being called in Windows

I am currently trying to create an Exception handler built into my windows service that, on an unhandled exception, sends a message to another program. I have built the method and gotten the communication working, but it seems that every time my program throws the error, (I have a raise call in the code to force it.) windows catches it...

JSTL, Beans, and method calls

I'm working on a JSP where I need to call methods on object that come from a Bean. The previous version of the page does not use JSTL and it works properly. My new version has a set up like this: <jsp:useBean id="pageBean" scope="request" type="com.epicentric.page.website.PageBean" /> <c:set var="pageDividers" value="<%= pageBean.getPag...

Beanshell catch(ex): Exception or Throwable?

What type of exception is caught by the beanshell catch(ex): Exception or Throwable?. Example: try { .... } catch (ex) { } ...

Why is OdbcCommand.ExecuteScalar() throwing an AccessViolationException?

I have a block of code intended to pull text descriptions from a database table and save them to a text file. It looks like this (C# .NET): OdbcCommand getItemsCommand = new OdbcCommand("SELECT ID FROM ITEMS", databaseConnection); OdbcDataReader getItemsReader = getItemsCommand.ExecuteReader(); OdbcCommand getDes...

Handling uncaught exceptions in C# console application

Hi all! I'm currently writing server that hosts several modules. Server runs each module in separate AppDomain. What I want to achieve is exception isolation. I mean when one module throws exception I don't want whole process to terminate, just this specific AppDomain. I know that I can tell CLR to fallback to old behaviour (.NET 1.0) wh...

Violation reading location in std::map operator[]

I encountered a problem when running some old code that was handed down to me. It works 99% of the time, but once in a while, I notice it throwing a "Violation reading location" exception. I have a variable number of threads potentially executing this code throughout the lifetime of the process. The low occurrence frequency may be indica...

Common WCF Exception : Connection Unexpectedly Closed

I have three projects. One is a WCF Services Project, one is a WPF Project, and one is a Microsoft Unit Testing Project. I setup the WCF Services project with a data object that looks like this: [DataContract] public enum Priority { Low, Medium, High } [DataContract] public struct TimeInfo { [DataMember] public In...

How can I propagate exceptions between threads?

We have a function which a single thread calls into (we name this the main thread). Within the body of the function we spawn multiple worker threads to do CPU intensive work, wait for all threads to finish, then return the result on the main thread. The result is that the caller can use the function naively, and internally it'll make us...

always try-catch external resource calls?

Should I always wrap external resource calls in a try-catch? (ie. calls to a database or file system) Is there a best practice for error handling when calling external resources? ...

Is it possible to throw a MessageQueueException?

I am using a mock object in RhinoMocks to represent a class that makes calls to MessageQueue.GetPublicQueues. I want to simulate the exception thrown when message queueing is operating in workgroup mode, which is a MessageQueueException, to ensure that I am catching the exception correctly The MessageQueueException has no public constru...

What is the best way to execute sequential methods?

Working on a project where a sequential set of methods must be run every x seconds. Right now I have the methods contained within another "parent method", and just sequentially call them right after another. class DoTheseThings() { DoThis(); NowDoThat(); NowDoThis(); MoreWork(); AndImSpent(); } Each method must ru...

java.lang.Exception vs. rolling your own exception

At what point would you create your own exception class vs. using java.lang.Exception? (All the time? Only if it will be used outside the package? Only if it must contain advanced logic? etc...) ...

(Windows) Exception Handling: to Event Log or to Database?

I've worked in shops where I've implemented Exception Handling into the event log, and into a table in the database. Each have their merits, of which I can highlight a few based on my experience: Event Log Industry standard location for exceptions (+) Ease of logging (+) Can log database connection problems here (+) Can build report ...

Why do I get web exception when creating an XPathDocument?

Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why? ...

WindowsError: priveledged instruction when saving a FreeImagePy Image in script, works in IDLE

I'm working on a program to do some image wrangling in Python for work. I'm using FreeImagePy because PIL doesn't support multi-page TIFFs. Whenever I try to save a file with it from my program I get this error message (or something similar depending on which way I try to save): Error returned. TIFF FreeImage_Save: failed to open fil...

Will the GAC fix an ASP.NET/IIS6.0 System.OutOfMemoryException?

I have many instances of an application installed on an IIS 6.0, Windows Server 2003 box under the same application pool. They share many of the same assemblies and can not be joined in to a single application. I recently added a new instance of the application and obtained a System.OutOfMemoryException when I tried to load the ASP.NET...

Exception handling architecture

Does anybody have best practices for exception handling ? When searching the web I find a lot of best practices on a code level (don't catch general exceptions, don't rethrow new exceptions etc.) What I am looking for is best practises on a higher level, stuff like : within an application catch exceptions on the ui level. log as much ...

"System.InvalidOperationException: The object is currently in use elsewhere" - how do I resolve this?

I got this error when trying to update an image. It was a cross-thread update, but I used .Invoke(), so that shouldn't be the problem, should it. ...