exception

What is the cause of intermittent Async_ExceptionOccurred errors in a silverlight app?

I have a Silverlight 3 app deployed at multiple customer sites. Customers are occasionally getting a System.Reflection.TargetInvocationException with an inner exception of Async_ExceptionOccurred. What is the cause of this? Is it just unreliability in the communications with the server? Is there any way to configure WCF to do an automat...

Is it possible to catch out of memory exception in java?

I'm developing a program that would require huge amount of memory, and I want to catch when out-of-memory exception happens. I had heard this is not possible to do, but curious if there is any development on this end. ...

Why can I "fake" the stack trace of an exception in Java?

If I run the following test, it fails: public class CrazyExceptions { private Exception exception; @Before public void setUp(){ exception = new Exception(); } @Test public void stackTraceMentionsTheLocationWhereTheExceptionWasThrown(){ String thisMethod = new Exception().getStackTrace()[0].getMe...

Java interface: method signature declared as throws Exception; implemented as throws a subclass of Exception [CLOSED]

Hi all, I have the following interface declaration: public interface SomeInterface { void someMethod() throws Exception; } I use a third party to generate an implementation of this class (JavaCC - for the curious) The generated class looks naively like this: public class SomeClass implements SomeInterface { public void so...

What is "[DCC Fatal Error] frm_Test.pas(381): F2084 Internal Error: C15700"?

Hello, I am upgrading a project from Delphi 2009 to D2010 and came across the following Internal Error [DCC Fatal Error] frm_Test.pas(381): F2084 Internal Error: C15700 when calling (ILocalizable(TMyProgram.MainForm.AbilitiesForm)).Localize('c:\test.txt'); Here are the definitions: ILocalizable = interface ['{4DF36053-2651...

Force break on any exception thrown in program

When coding in C# I like not to handle exceptions because it makes it easier to figure out where and why things went wrong. However, I can't give anyone a program that doesn't handle exceptions. Can I somehow force Visual Studio to break on every exception, including those thrown inside try/catch blocks? ...

Silverlight 3 XamlReader Exception not caught

Hi, when I use XamlReader.Load() with an invalid XAML string, the resulting XAMLParseException is not caught although beeing in a try-catch-block: try { UIElement xamlCode = XamlReader.Load(XamlText) as UIElement; } catch (Exception ex) { ErrorText = ex.Message; } The code is called from the Tick-Event of a Disp...

Is there an analogue to Java IllegalStateException in Python?

IllegalStateException is often used in Java when a method is invoked on an object in inappropriate state. What would you use instead in Python? ...

(c#) NullReferenceException??? I've got a constructor what's going on?

I am trying to write code for an assignment for the c# intro class at my college but am ahead and am running into problems. I am getting a NullReferenceException when i run the program - i think the problem is coming from the fact that i am creating a 'Line' which contains the 'Point' class... i have tried for 3hrs to fix this - any help...

java.lang.Long cannot be cast to java.lang.String

I need to iterate a List<myClass> in a jsp. This is how I obtain the list: (when I commented it, the page loaded just fine). <% List<myClass> pjList = null; StringBuffer ejbQuery = new StringBuffer(); EntityManagerFactory emf = Persistence.createEntityManagerFactory("myPersistence"); EntityManager em = emf.cre...

java.net.MalformedURLException: no protocol

Im getting Java exception like: java.net.MalformedURLException: no protocol My program trying to parse XML string by using Document dom; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); dom = db.parse(xml); The XML string contains: String xml = "<?xml version=\"1.0\" ...

C# How to handle multiple exceptions which does all the same?

In my code I have a method with multiple catch statements, which perform all the same statement. I'm not sure this is the correct way to implement this. How would you do this? public void LoadControl(ControlDestination controlDestination, string filename, object parameter) { try { // Get filename with extension ...

File Handling Issue

hi all, I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason an how to avoid it? xmldocument x= new xmldocument(); x.open(); // change a value of the node every time x.save(); x=null this i...

C# Parameter is Not Valid Error

I keep getting an error in the following code when I close the print preview window or move the print preview window. I can't seem to understand why this is happening. It happens on the g.DrawString() line. As far as I can tell nothing has been disposed of either. protected override void OnPaint(PaintEventArgs e) { Graphi...

C# switch statement

Should I throw NotImplementedException() on default: if I have cases for all possible enum types? ...

OracleConnection throwing exception

I'm learning how to work with Oracle and am using C#/Visual Studio. Just as a reference, I'm following this simple tutorial, and have all the prerequisites done (database installed and ODAC with dev tools installed). The following code that's supposed to create an object for connection to a database throws an exception saying "Object ref...

Data Entities Connection String Problem

I must have changed something somewhere, but damned if I can figure out what it is. I have a DAL that handles all my data access (as is a DAL's wont) to my SQL Server DB. This includes the Entity Model, the repository classes and the connection string in the App.Config file. Somewhere along the piece, I must have changed something and...

Java: Exceptions

Hi, Why is this code correct: try { } catch(ArrayOutOfBoundsException e) { } and this wrong: try { } catch(IOException e) { } This code is wrong because in the try-body never an IOException is thrown, but in the first body there is also never throw a ArrayOutOfBoundsException. And the first code-piece is correct. Why?? Can I ...

Using messengerApi in visual studio (c#) in any windows, compatibility issue.

I'm Trying to develop a project that interacts with Live Messenger (8.5, 9.0 and higher) I can't get it to work in windows XP, whenever i try to instantiate a MessengerClass (available in the messengerAPI) it gives me an exception, however, in windows vista, this error doesn't happen (same exact code, tested in more than one XP and more ...

.NET windows service getting stopped abruptly

HI Guys, I have created a windows service which spawns three threads.The first thread wakes up every 15 sec, the second thread wakes up every min. and the third thread once in a day. My Code looks something like this: var timer1 = new Timer(); timer1.Elapsed += ProcessTimerEvent1; timer1.Interval = 60000; ...