exception

NHibernate unable to load Proxy Factory

I'm so stuck with trying to get a simple NHibernate app running. I'm doing "Getting started with NHibernate" step by step. First, I got a invalid property something error (managed to fix that). Now, I get an exception: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration...

"Store metadata "CurrentBind" is not valid" in debug of ClickOnce application

When I try to access "Application.CommonAppDataPath" i get this error message: System.Deployment: Store metadata "CurrentBind" is not valid Stack Trace: at System.Deployment.Application.ComponentStore.GetPropertyString(DefinitionAppId appId, String propName) This is only in Debug. When running as an actual published cli...

Cannot determine whether a queue with the specified format name exists.

I get the exception when executing the following code. Any ideas what is wrong? string queueName = "FormatName:Direct=TCP:1.1.1.1\\Private$\\test"; MessageQueue queue; if (MessageQueue.Exists(queueName)) queue = new System.Messaging.MessageQueue(queueName); else queue = MessageQueue.Create(queueName); queue.Send(sWriter.ToStrin...

How do I raise an exception in Rails so it behaves like other Rails exceptions?

I would like to raise an exception so that it does the same thing a normal Rails exception does. Specially, show the exception and stack trace in development mode and show "We're sorry, but something went wrong" page in production mode. I tried the following: raise "safety_care group missing!" if group.nil? But it simply writes "ERR...

Custom Java exception printing when thrown

I want to design it such that whenever one of my custom exceptions is thrown, it automatically prints the stacktrace to a file. Is there a method I can override to accomplish this? Doing this would help to reduce a noticable amount of code in my project. ...

Exception subclass for Bad Object State?

I'm a moderate fan of using Exception subtypes to help describe the problem that caused the exception. For instance, let's say that I'm writing a method that does not allow int values greater than 100 to be passed in as arguments. I'll often start the method with a condition to guard against this, and throw an exception if it occurs. I'l...

How to catch exception from thread?

I am using a free .net telnet component (De.Mud.Telnet), which has several asynchronous methods you can call, and the component fires events when things happen. My problem is that the component is throwing an exception and I don't know how to catch it. There's no exception event, and the exception doesn't get thrown by my method call. ...

Handling an exception in another thread

What is the "correct" way of detecting and handling an exception in another thread in Python, when the code in that other thread is not under your control? For instance, say you set a function that requires 2 parameters as the target of the threading.Thread object, but at runtime attempt to pass it 3. The Thread module will throw an exc...

Scala bug with immutable Map in concurrent program?

I've written a Monte Carlo player for the board game Nine Men's Morris. Everything is basically immutable. The program involves lots of futures (hundreds) and a lot of modifying immutable Maps. Sometimes I get a crash with the following exception: java.lang.NullPointerException at scala.collection.mutable.HashTable$class.elemHashCod...

Passing Business Validation Error from Service layer to presentation layer

Hello All, We are using MVP pattern in our Presentation Layer(PL) and a WCF based service layer(SL). PL calls operation contracts on the SL and internally it does some business validations. If the validation passes, we return an obect (exposed as a data contract) to the PL. But if the validation fails, what is the best practice we not...

What exception should be thrown by a .NET program if it encounters invalid data?

Consider the following example: as part of configuration for my program the user supplies an XML file which should in essence describe an acyclic graph, but my program finds a graph when loading it. This is a critical error, the program cannot continue. What exception should be thrown? Other examples include trying to load a file in som...

NUnit Unit Test has "ExpectedException" but still failing on exception

I have a unit test that is failing because a System.ArgumentException is being thrown, even though I am expecting it and it's deliberate behaviour - what have I missed? [Test] [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Seconds from midnight cannot be more than 86400 in 010100712386401000000012")] public void TestPa...

ORACLE capture exception object.

Hi there any way to capture the objects (such as table and column) where an exception was thrown in ORACLE? I need to determine the object name to customize the error message showing the user the name of the table and field where the exception occurred. I know there is a variable SQLCODE and SQLERRM, but I wonder if there is any additi...

How to construct a container of MyClass, where MyClass constructor can throw?

I have something like: #include "MyImage.hpp" // MyImage wraps the Qt library image class namespace fs = boost::filesystem; class ImageCollection { public: ImageCollection(const char* path); private: const fs::path path_; deque<MyImage> instanceDeque_; } ImageCollection(const char* path) : path_(fs::is_directory(path) ? ...

Compare Delphi Exception Handlers

How would you compare MadExcept to EurekaLog as an Exception handler for your Delphi application? Why would you pick one over the other? Are there any other exception handlers for Delphi that should be considered in addition to these two? Well the answer was between Smasher and Mark, who both had good info in their comparisons but e...

What is the _xcode field of the .NET Exception type?

Dear ladies and sirs. In my unit tests I need to perform deep equality tests of two objects, which are expected to be identical. During the tests I discover some interesting fields in system types that break my code. Exception._xcode is the most recent one. Here are a couple of facts about this field: It is initialized to -532459699 i...

Java: SingleThreadScheduledExecutor & java.util.concurrent.RejectedExecutionException

Hello. I am having this problem, I have private ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); and task which is created every 50 millliseconds: executor.scheduleAtFixedRate(myTask, 0, 50, TimeUnit.MILLISECONDS); myTask sometimes take a while to complete (like 2-3 seconds or so), but new...

Solving very intermittent exception in .net app

I have an asp.net MVC app in production that very seldom but very consistently is throwing the same exception and I don't know why. I cannot, no matter what I do, reproduce the exception in neither the production nor development environments. I am logging all unhandled exceptions. I have the date/time, controller, action, exception mess...

avoiding null reference exceptions

Apparently the vast majority of errors in code are null reference exceptions. Are there any general techniques to avoid encountering null reference errors? Unless I am mistaken, I am aware that in languages such as F# is it not possible to have a null value. But thats not the question, I'm asking how to avoid null reference errors in la...

Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object

Hi Friends, I am new to RMI technology. When I am running the rmi client program, I am getting the exception : java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object. I am using jdk1.5 The argument of the remote method is the Serialized object. These are the server code... This is the Remote Inte...