exception

RestEasy - Unable to find MessageBodyReader?

一曲冷凌霜 提交于 2019-12-30 09:22:08
问题 I've written a simple RestEasy client proxy to perform an iTunes search. It looks like this: @Path("/") public interface AppleAppStoreLookupClient { /** * Attempts to lookup an apple app store item by its ID * * @param id * The item ID * @return The app details */ @GET @Path("/lookup") @Produces(value = { "text/javascript" }) public AppleAppDetailsResponse lookupByID(@QueryParam("id") String id); } My JSON model class is simple, as well. In fact, for the first call all I want is the

Why there are no OutOfMemoryError subclasses?

≡放荡痞女 提交于 2019-12-30 09:08:31
问题 As we all know, there are multiple reasons of OutOfMEmoryError (see first answer). Why there is only one exception covering all these cases instead of multiple fine-grained ones inheriting from OutOfMEmoryError ? 回答1: I'd expect because you really can't do anything else when that happens: it almost doesn't matter WHY you ran out, since you're screwed regardless. Perhaps the additional info would be nice, but... I know tomcat tries to do this "Out Of Memory Parachute" thing, where they hold

Eclipse Unhandled event loop exception, no more handles Windows 7

╄→гoц情女王★ 提交于 2019-12-30 08:17:11
问题 My Eclipse is used to develop Android Apps. It worked fine until one day, a Unhandled event loop exception is prompt. The log is shown below. To trigger the error prompt, just unfocus the text editor in eclipse and focus it again, then the prompt is triggered, For example, click on the Package explorer (Red circle) and click on the code (Green circle) in Main.java in Eclipse. (.xml are the same). But, if I unfocus the code by clicking Package Explorer (Red circle) then click on the title of

Handling Floating-Point exceptions in C++

半世苍凉 提交于 2019-12-30 08:16:16
问题 I'm finding the floating-point model/error issues quite confusing. It's an area I'm not familiar with and I'm not a low level C/asm programmer, so I would appreciate a bit of advice. I have a largish C++ application built with VS2012 (VC11) that I have configured to throw floating-point exceptions (or more precisely, to allow the C++ runtime and/or hardware to throw fp-exceptions) - and it is throwing quite a lot of them in the release (optimized) build, but not in the debug build. I assume

Why use try and catch() in C++?

吃可爱长大的小学妹 提交于 2019-12-30 08:14:07
问题 I understand that try and catch() are used for exception handling, just in case an error or crash would occur in the program under certain cases. I also understand how they work. But why use try and catch() ? Why not just use an if() statement that looks for a certain case and if that case is true, it does cout << //error code ? 回答1: Exception handling: can be used with constructors and operators that have no opportunity to return a separate error code (they could set the object into some

Is there a reason why NullReferenceException does not give the name of the variable?

☆樱花仙子☆ 提交于 2019-12-30 08:13:49
问题 The ArgumentNullException has a ParamName property to indicate which argument was passed as null. Why does the NullReferenceException not have a similar property? Would it have been technically possible to implement within .Net? 回答1: A NullReferenceException is thrown by the CLR when it tries to navigate a null reference. This isn't necessarily associated with a variable, and in particular the CLR really doesn't care where it came from - it's just a value on the stack. Compare that with

Unhandled exception

耗尽温柔 提交于 2019-12-30 08:13:15
问题 What is the best way to handle an unhandled exception in a WPF application? 回答1: You can use DispatcherUnhandledException : XAML (App.xaml): <Application x:Class="App.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="wndMain.xaml" DispatcherUnhandledException="Application_DispatcherUnhandledException"> Code Behind (App.xaml.cs/vb: private void Application_DispatcherUnhandledException(object sender, System

Problems solving “Cannot access disposed object.” exception

拟墨画扇 提交于 2019-12-30 08:07:23
问题 In my current project there is a Form class which looks like this: public partial class FormMain : Form { System.Timers.Timer timer; Point previousLocation; double distance; public FormMain() { InitializeComponent(); distance = 0; timer = new System.Timers.Timer(50); timer.AutoReset = true; timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); timer.Start(); } private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (previousLocation != null) { // some

C# rethrow an exception: how to get the exception stack in the IDE?

我是研究僧i 提交于 2019-12-30 07:55:52
问题 There has been discussion here before about the correct way to rethrow an exception. This question, instead, is about how to get useful behavior from Visual Studio when using rethrow. Consider this code: static void foo() { throw new Exception("boo!"); } static void Main(string[] args) { try { foo(); } catch (Exception x) { // do some stuff throw; } } The exception that comes out has the correct stack trace, showing foo() as the source of the exception. However , the GUI Call Stack window

External Exception EEFFACE in Delphi

自作多情 提交于 2019-12-30 07:54:06
问题 While debugging my application with Delphi 2009, I sometimes get the following exception occurring: (source: beholdgenealogy.com) This only happens occasionally, but after pressing OK, then my IDE and program both may freeze. If I am lucky I can sometimes do a File/SaveAll in Delphi, but sometimes I can't. Either way I am stuck and then the only thing I can do is use Windows Task Manager to shut down Delphi. Of course, if I was unable to SaveAll, then I lose all the edits I had made since