[ http://jira.jboss.com/jira/browse/JBAS-1289?page=history ]
Scott M Stark resolved JBAS-1289:
---------------------------------
Resolution: Done
Fix Version: JBossAS-3.2.7 Final
JBossAS-4.0.2RC1
JBossAS-5.0 Alpha
The unnecessary exception logging and wrapping has been removed.
> JDBCCustomFinderQuery hides ObjectNotFoundException
> ---------------------------------------------------
>
> Key: JBAS-1289
> URL: http://jira.jboss.com/jira/browse/JBAS-1289
> Project: JBoss Application Server
> Type: Bug
> Components: EJBs
> Versions: JBossAS-3.2.7 Final
> Reporter: David Deuchert
> Assignee: Scott M Stark
> Priority: Minor
> Fix For: JBossAS-3.2.7 Final, JBossAS-4.0.2RC1, JBossAS-5.0 Alpha
>
>
> When a custom finder method returns an ObjectNotFoundException, the exception
> is logged as an error and re-wrapped inside a more generic FinderException.
> There are two problems here:
> 1) The hiding of the ObjectNotFoundException
> 2) The extra logging of an error level message, the application code might
> be expecting an ObjectNotFound exception (test for existance) and does not
> require logging...
> The following is a code snippet that shows a diff between the current code
> and a potential fix:
> /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCCustomFinderQuery.java
> - Line #134
> ***************
> *** 134,143 ****
> }
> catch(InvocationTargetException e)
> {
> ! log.error("Error invoking custom finder " + finderMethod.getName(),
> ! e.getTargetException());
> ! throw new FinderException("Errror invoking cutom finder " +
> ! finderMethod.getName() + ": " + e.getTargetException());
> }
> }
> --- 134,149 ----
> }
> catch(InvocationTargetException e)
> {
> ! Throwable t = e.getTargetException();
> ! if (t instanceof FinderException) {
> ! // Just quietly rethrow the original finder exception...
> ! throw (FinderException)t;
> ! } else {
> ! log.error("Error invoking custom finder " +
> finderMethod.getName(
> ),
> ! t);
> ! throw new FinderException("Errror invoking cutom finder " +
> ! finderMethod.getName() + ": " + t);
> ! }
> }
> }
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development