[jbossts-issues] [JBoss JIRA] Created: (JBTM-530) Thrown Exceptions often loose the original cause

Davide Cavestro (JIRA) jira-events at lists.jboss.org
Thu Apr 16 12:31:23 EDT 2009


Thrown Exceptions often loose the original cause
------------------------------------------------

                 Key: JBTM-530
                 URL: https://jira.jboss.org/jira/browse/JBTM-530
             Project: JBoss Transaction Manager
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Transaction Core
    Affects Versions: 4.5.0
            Reporter: Davide Cavestro


In JBossTM exceptions are often catched and left behind in favor of a new dedicated Exception (or Error) contextually thrown.
This lead to a steady lack of information about the origin of the final symptom.

As an example, see the following code snippet (extracted from com.arjuna.ats.internal.arjuna.objectstore.JDBCStore.JDBCStore())
...
		try
		{
			initialise("");
		}
		catch (Exception e)
		{
			throw new ObjectStoreError();
		}
...

Here the original exception "e" is lost in favor of a new ObjectStoreError. No one will never know the cause of the thrown ObjectStoreError, nor see what's wrong without using a debugger (if ever available).

Since I saw the binary distribution of JBossTM (at least version 4.5.0) is compiled for Java 1.5, I suppose you aren't denied to use the standard exception chaining mechanism introduced since Java 1.4 (namely the java.lang.Throwable.cause field)

Please consider refactoring your code to chain the exception causes. It would be very useful.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossts-issues mailing list