exception

Java Desktop app with Ms Access.

My Db connection is error "class not found exception!". I want to show in java jTable with query result.. static Connection databaseConnection()throws ClassNotFoundException{ Connection con=null; File file=new File("PlayDb/PlayIS.mdb"); try{ Class.forName("sun.jdbc.odbc.jdbcodbcDriver"); ...

SQLite query throwing exception in Android

Im trying to get an object form my SQLite database in my Android application. I know that the contact is in the database because when I add it and try finding by ID, it returns the object. When I try finding by first and last name, though, it throws an exception and Im left with a null reference. Here is the query: cursor = mDb.query(D...

Trapping COM exception in F#

I have some F# code that calls a method on a COM Automation object. Sometimes that COM object throws an exception. I tried wrapping the calls to the COM object in a try...with block: try do some COM stuff with _ -> Printf.printf "got an exn\r\n" But the exception-handling code isn't called at all, the application just d...

NServiceBus without input queue

Is it possible to use NServiceBus in an application without having any input queues? Reason is, I have an ASP.NET MVC application that sends messages to other applications when something happens (e.g. a new user registers). The web application never recieves any responses or other messages and therefore I would like not to bog the app. ...

newbie: throw new exception - can we change exception name?

Hello all, I'm trying to work with exceptions. So I have something like: If something bad occurs: throw new CreateContactException($codigo, $result->msg); Later on, I will, try and if not ok, catch: try { createContact(); } catch(CreateContactException $e) { $error .= 'An error occurred with the code:'.$e->getCode().' and ...

Files organization: Where should exception extended classes be placed ?

Let's say we have several exception classes that extends exception. My question is, in order to proper organize our files, where should those classes be placed ? i.e - Are they helper classes? One on it's on file? Ok. Respecting naming conventions. Ok. But then we group those files and in what folder should we put them? On a folder...

Runtime Exception in Android JUnit testing

I have a simple HelloWorld Activity that I try to test with an Android JUnit test. The application itself runs like it should but the test fails with an "java.lang.RuntimeException: Unable to resolve activity for: Intent { action=android.intent.action.MAIN flags=0x10000000 comp={no.helloworld.HelloWorld/no.helloworld.HelloWorld} } at n...

How to prevent expected exceptions from breaking the debug test run?

When running MSTEST unit tests in debug mode, the execution stops in every expected exception that is thrown. My test looks like this [TestMethod()] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowExceptionWhenPassingNull() { object data = null; target.CheckNull(data); } the target method looks like t...

catch a custom exception - do we need to require or include the CustomException class?

Hello all, To throw an exception we need to include a CustomException class. include_once("CustomException.class.php"); Ok. On another file, when we use the try/catch blocks, do we need to require or include, our CustomException class again? Thanks in advance, MEM ...

Regular expression: find range except for one letter or a range

Hello, How can I use the negation within square brackets as an exception, to find e. g. everything between a-z except for the the range from m-o? [a-z^m-o]? Thanks in advance! By the way: it's not for the sake of this example that I ask, but to be able to exclude ranges within ranges, or even single letters within ranges. I am pretty ...

Handling Exceptions - Fatal error: Uncaught exception 'EppCommandsExceptions' with message 'Command syntax error'

Fatal error: Uncaught exception 'EppCommandsExceptions' with message 'Required parameter missing' The line in question: throw new EppCommandsExceptions($result->msg, $codigo); Why am I having this error on this line? On EppCommandsExceptions.class.php I have this class that extends Exception: class EppCommandsExceptions ex...

WPF ResourceDictionary Item has already been added using ComponentResourceKey

Hello, I have the following ResourceDictionary that gets merged into my Themes/Generic.xaml file <DataTemplate DataType="{x:Type model:RequirementResourceRelation}" x:Key="{x:Static local:Resources.RequirementResourceRelationListTemplateKey}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> ...

Determine if code called from an exception handler (using statement)?

I want to do something mildly silly. In my Dispose() method for an object, I want to print a debug trace for the object, telling me all events which happened while it was alive. But as this takes time and money, I only want to do this if Dispose() is being called because an exception was thrown. So I would like to do if (exceptionIsC...

VS2008 Out of memory exception

every couple hours or so, when compiling my solution (fairly big one), i'm keep getting the following exception: C:\WINNT\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1353,9): error MSB4018: The "ResolveAssemblyReference" task failed unexpectedly. C:\WINNT\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1353,9): error MSB...

What is the java equivalent of AggregateException from .net?

In .net the AggregateException class allows you to throw an exception containing multiple exceptions. For example, you would want to throw an AggregateException if you ran multiple tasks in parallel and some of them failed with exceptions. Does java have an equivalent class? The specific case I want to use it in: public static void r...

C++ get call stack from std::exception

Hi, how can I print the full call stack when a std::exception raises? ...

Wrapping logging within an exception object

I currently have this class that another programmer in my team coded: public static class SoapExecuter { private static readonly ILog logger; public static Exception ExecuterException { get; private set; } public static bool IsSoapException { get { if (ExecuterException == null) ...

Android: StreamCorruptedException while sending an image as byte array over bluetooth

I try to send an image over bluetooth to another device. This works mostly fine, but sometimes, I get a StreamCorruptedException: Wrong format: 0x27 on the receiving device. Anybody knows what this means? And how can I avoid that? ...

Apache DefaultHttpClient invocation results in "java.lang.RuntimeException: Stub!"

I'm dipping my toes into Android development. I have a project that will interface with a RESTful resource and I'm trying to figure out how to do a basic GET with params over HTTP. From everything I've read, the consensus seems to be favoring HTTPClient over HttpURLConnection. I've written a wrapper class with a method that takes care o...

how to log error to file, and not fail on exception

I am downloading a file from the net, and it fails even though I am doing: for p in query: try: except IOError as e: print e; If there is an error, I want to log it, and then continue on with the next file. In this loop, I am trying to download an image, if for some reason the filename was bad, or the website was down, etc., I w...