exception

WebHttpBinding: Log all errors to service logfile

I have a self-hosted WCF service that uses a WebHttpBinding. In the implementation of the service, all exceptions are caught and a appropriate message is returned to the caller. All exceptions are also logged to the service logfile. catch (Exception ex) { _log.Error("Error posting message", ex); WebOperat...

C++ Access violation when calling dll function

I have a function definition in my VC++ Win32 DLL DEMO2_API void ProcessData(char* i_buff, unsigned short i_len, char* o_buf, unsigned *o_len, unsigned short *errorCode) { __describe (i_buff,&i_len,o_buf,o_len,errorCode); } This dll function is called by a c# application. When called, it generate access violation exception. Afte...

Invalid Operation Exception - "Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on."

"If necessity is the mother of invention, I'd like to kill the guy who invented this." -Jimmy Buffet I don't care if 100 people with a million reputation jump down my throat for saying this, but who ever thought of throwing this exception deserves a fate worse than death. I have QUITE LITERALLY copied and pasted code from ...

Collection was modified exception linq-to-objects

I got a strange exception when trying to find out if a property in a list of objects is equal for all objects. This is my code: bool lvNoGuests = pvBillData.Reservering.Dagen.All(x => { return x.AantalKinderen == pvBillData.Reservering.Dagen[0].AantalKinderen && x.AantalVolwassenen == pvBillData.Reservering.Dagen[0].Aan...

LINQ query null reference exception

Hi! I have the next query: var bPermisos = from b in ruc.Permisos where b.IdUsuario == cu.Id select new Permisos(){ Id=b.Id, IdUsuario=b.Id, IdPerfil=b.Id, Estatus=b.Es...

How are exceptions allocated on the stack caught beyond their scope?

In the following code, the stack-based variable 'ex' is thrown and caught in a function beyond the scope in which ex was declared. This seems a bit strange to me, since (AFAIK) stack-based variables cannot be used outside the scope in which they were declared (the stack is unwound). void f() { SomeKindOfException ex(...); throw ...

XAML Parsing Exception

I have a simple XAML page that load fine when it is loaded as part of any application within Visual Studio. However, when I deploy this application using ClickOnce, I get the following exception: Type : System.Windows.Markup.XamlParseException, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ...

Where is this exception caught and handled?

In some code I've been reading, I've come across this : class Someclass { public static void main(String[] args) throws IOException { //all other code here...... } } If main() throws an exception, in this case its an IOException, where is it caught and handled? EDIT: Is this considered bad pract...

c++ exception parameter

Hello there, I have a question regarding the following code snippet I came across in one of our older libraries. try { throw "this is an error message"; } catch( char* error ) { cout << "an exception occured: " << error << endl; } My understanding of the behavior in this case is, that the error message is thrown by value, which m...

WCF service fails to start when more than one service is available.

I am running a WCF service from inside a exe (for debugging, it will be moved to the windows service when deployed) I got one service running fine inside of it however when I run a second service I get the exception System.InvalidOperationException was unhandled Message=The ChannelDispatcher at 'http://backupsvr:8082/' with contract(s...

org.xml.sax.SAXParseException: The entity "ndash" was referenced, but not declared.

I'm parsing the the following... <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE tox:message SYSTEM "http://tox.sf.net/tox/dtd/tox.dtd"&gt; <tox:message xmlns:tox="http://tox.sourceforge.net/"&gt; <tox:model owner="scott" package="queue" function="appendFact"> <tox:parameter value=" By John Smith &ndash; Thu Feb 25, 4:54 pm ET&lt;br...

Java Socket exception while trying to reach .NET WCF web service on IIS

When I call, the service's method, I have Web Service Exception happening which I couldn't figure out for now. The issue is this, I am running NetBeans 6.8 against IIS 7.0 with the Web Service written using WCF: javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset at com.sun.xml.internal.ws.transport.htt...

Destruction of string temporaries in thrown exceptions

Consider the following code: std::string my_error_string = "Some error message"; // ... throw std::runtime_error(std::string("Error: ") + my_error_string); The string passed to runtime_error is a temporary returned by string's operator+. Suppose this exception is handled something like: catch (const std::runtime_error& e) { st...

Why is the Catch(Exception) almost always a bad Idea?

Why is the Catch(Exception) almost always a bad Idea? ...

Exception calling when TimeZoneInfo.ConvertTimeToUtc for certain DateTime values

When I run the code for this specific value of dt, an exception is thrown when I call the ConvertTimeToUtc Method. My local Machine timeZoneId is "GMT Standard Time" var tzi = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); var dt = new DateTime(1995, 4, 2, 2, 55, 0); var t = TimeZoneInfo.ConvertTimeToUtc(dt, tzi); The e...

Why it could not find the main class?

I have a very simple code: package mygame; public class RunGame { public static void main(String[] args) { System.out.println(args[0]); } } I can compile that code but I cannot run it. When I type "java RunGame" in the command line I get: Exception in thread "main" java.lang.NoClassDefFoundError: RunGame (wrong...

Is there possibility that a finally block might not excute?

We know that no matter whether an exception is thrown, or caught and handled it, the finally block will get executed, So i was curious that is there any possibility that finally block will not executed. And if System.exit() is called either in try or catch, then also will the finally gets called? ...

php classes exception handling question

There's an open book quiz for a job application I'm doing, and it's obviously highlighted a shortcoming in my php knowledge. Note, I'm not asking for the answer directly, I'm asking to be shown what I'm misunderstanding/lacking in how to answer it. The question is: 3. Finish the following class to print "Person->name has been zapped" ...

Silverlight -RIA Services-This EntitySet of type <> does not support the 'Add' operation.

In Silverlight project I have this exception when I tried to Add a new object to a DataGrid when a button is clicked. In the DomainService class.. I know I have to implement the Add operation for the new Entity I'm putting, but how can I do that? I mean I did the class, the get method but how do I do the insert operation, I can't see m...

NullPointerException using Graphics2D in custom JPanel

I'm extending JPanel to make a custom drawing panel, but am getting a NullPointerException and can't work out why. I've removed code until it's pretty bare, but the error is still occuring. package testdraw; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JPanel; public class Dr...