exception

what is java exception?

What is java exception? Is an exception considered an error? When should I throw exceptions? How many kind of exceptions? ...

good documentation about "avoid catching throwable", in context of weblogic server

hi all, i am currently refactoring an existing codebase (EJBs...) to rip out all blocks where a Throwable is catched inside of the EJB. try { ... do some business logic } catch(Throwable t){ ... log and swallow ... :-( } i want/need to convince the people around me with proper documentation that "catching throwable" is a no-g...

How to specify allowed exceptions in WCF's configuration file?

Hello! I´m building a set of WCF services for internal use through all our applications. For exception handling I created a default fault class so I can return treated message to the caller if its the case or a generic one when I have no clue what happened. Fault contract: [DataContract(Name = "DefaultFault", Namespace = "http://...

c# exception handling on background threads using Thread pool

Hi The application I am working on uses thread pool. Here's the basic pseudo code. On the main thread foreach(Object obj in Component.GetObject()) { //Invoke the thread pool providing the call back (method to be called on the background// thread) and pass the object as the parameter. } //Wait for the threads to complete. The "Com...

What is this exception ?

I am getting this exception while reading the shapes in excel sheet in c#: on code line of if (worksheet.Shapes.Count >= iCurrentRowIndex) { } Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Worksheet'. This operation failed because the QueryInterface call on the COM...

Why is my code stopping and not returning an exception?

I have some code that starts a couple of threads to let them execute, then uses a while loop to check for the current time passing a set timeout period, or for the correct number of results to have been processed (by checking an int on the class object) (with a Thread.Sleep() to wait between loops) Once the while loop is set to exit, it...

Java Swing GUI exception - Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException: Vector Enumeration

I get this exception when i run my application. I dont have any idea what is going wrong here. Can someone help please. Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException: Vector Enumeration at java.util.Vector$1.nextElement(Vector.java:305) at javax.swing.plaf.basic.BasicTableHeaderUI.getPref...

effect of undefined opcodes on the (original) Intel 8086/88

Since the original 8086 and 8088 do not have a software exception for illegal instructions, how do they behave when fed such, for instance "FF FF" (not an opcode) ? Do they stall, do it reset itself, possibly emitting a special cycle indication on its control bus ? ...

Exceptions generated by external component are fatal unless "enable.unmanaged.code.debugging" is on

Hi there, I have been struggling with unhandled fatal exceptions within an application that uses an external COM library. Enabling unmanaged code debugging magically turns the indescript fatal exceptions into well-defined, catcheable, exceptions. I can now go ahead and change my code so that these exceptions never occur, but is there ...

[Java]Queue in while loop, cannot modify the value?

This is my code: Iterator it = queue.iterator(); while(it.hasNext()){ random = randNumber(1,2); if(random == 1){ queue.poll(); } else { queue.add("new"); queue.poll(); } } It gives me: Exception in thread "test" java.util.ConcurrentModificationException at java.util....

sun.awt.image.PNGImageDecoder$PNGException: crc corruption

Hello I'm working in a big java project, with about 400 classes. Suddenly I got this error sun.awt.image.PNGImageDecoder$PNGException: crc corruption at sun.awt.image.PNGImageDecoder.getChunk(PNGImageDecoder.java:699) at sun.awt.image.PNGImageDecoder.getData(PNGImageDecoder.java:707) at sun.awt.image.PNGImageDecoder.produce...

java nested for() loop throws ArrayIndexOutOfBoundsException

I'm working through a JPanel exercise in a Java book. I'm tasked with creating a 5x4 grid using GridLayout. When I loop through the container to add panels and buttons, the first add() throws the OOB exception. What am I doing wrong? package mineField; import java.awt.*; import javax.swing.*; @SuppressWarnings("serial") public class...

Keep Hibernate Initializer from Crashing Program

I have a Java program using a basic Hibernate session factory. I had an issue with a hibernate hbm.xml mapping file and it crashed my program even though I had the getSessionFactory() call in a try catch try { session = SessionFactoryUtil.getSessionFactory().openStatelessSession(); ...

Green Exceptions?

When unhandled exceptions are encountered in VStudio usually the debugger highlights the line YELLOW as the line that threw the exception. However sometimes I encounter exceptions where the debugger highlights them green as shown: I've always treated them as normal exceptions, but today I decided to ask since google/bing produced no ...

dynamic GridView in CreateChildControls throws a "RegisterRequiresControlState can only be called before and during PreRender" exception

I am trying to add a GridView dynamically to a SharePoint Web Part. Right now, the first time I load the gridview, everything works fine. My gridview has an edit column enabled... so when I click that, it throws an exception when I try and add the gridview control on the postback. The exception: "RegisterRequiresControlState can only b...

Ignoring "Content is not allowed in trailing section" SAXException

I'm using Java's DocumentBuilder.parse(InputStream) to parse an XML document. Occasionally, I get malformed XML documents in that there is extra junk after the final > that causes a SAXException: Content is not allowed in trailing section. (In the cases I've seen, the junk is simply one or more null bytes.) I don't care what's after t...

COMException in System.WIndows.Forms.dll with Interactive Brokers TWS API

Hi, I've been trying to run the sample project provided with the tutorial at stockbotprogramming http://www.stockbotprogramming.com/sharpcibtutorial1.php , but I keep getting a COMException every time I run the application. I have the TWS Client running and the sample VB projects provided with the API are able to connect just fine, but ...

Performance of "returning" from a Try block

Exception handling on Windows boxes (at least for C++) takes a performance hit if you exit a try block prematurely (such as executing a return statement) the same as if an exception were thrown. But what about C#? Is there a performance hit for returning prematuraly from a try block, whether through a return statement or break statemen...

C# Find out what column caused the Sql Exception

Hi. I'm getting an exception from SQL Data Reader (MS SQL as datastore) and I'd like to know which column name causes this Exception to be thrown. But I cannot find it in the InnerException.. nowhere. ((System.InvalidOperationException)ex.InnerException).StackTrace: System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i) System.D...

ASP.NET - Exception logging approach for concurrent user scenario

I am involved in designing a asp.net webforms application using .NET 3.5. I have a requirement where we need to log exceptions. What is the best approach for exception handling, given that there would be concurrent users for this application? Is there a need or possibility to log in exceptions at a user level? My support team in-char...