Menu

#44 RBUTILS-043 (RbChecker) some exceptions are not caught

_RbUtils_0.14
open
redfish
7
2009-02-13
2007-12-17
No

Affected version: 0.10, 0.11-SNAPSHOT-03
We use a custom filechecker; its loadBundle() method may throw RuntimeException. If so, the xml generated by the logger is not valid and the number of processed files is wrong.

We get something like this in the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<rbchecker version="0.11-SNAPSHOT-02" root="C:\projects\kli\data\src" generatedOn="Thu Aug 30 19:34:17 CEST 2007">
<file name="ext/one.rbInfo" classname="ext.one" locale="">
<file name="Unknown Error" classname="Exception" locale="">
<exception message="Unable to get rbInfo type">
<![CDATA[java.lang.IllegalArgumentException: Unable to get rbInfo type
at com.cimpa.rb.RbInfo.getRbInfoType(Unknown Source)
at com.cimpa.rb.WTFileChecker.loadBundle(Unknown Source)
at org.ktc.rbutils.rb.check.FileChecker.checkIsRbMissing(FileChecker.java:169)
at org.ktc.rbutils.rb.check.FileChecker.performCheck(FileChecker.java:108)
at org.ktc.rbutils.rb.check.MainChecker.doCheck(MainChecker.java:140)
at org.ktc.rbutils.rb.check.MainChecker.process(MainChecker.java:109)
at org.ktc.rbutils.rb.check.RbCheckerUtility.process(RbCheckerUtility.java:120)
at org.ktc.rbutils.rb.check.RbCheckerUtility.mainNoExit(RbCheckerUtility.java:139)
at org.ktc.rbutils.rb.check.RbCheckerUtility.main(RbCheckerUtility.java:92)
]]>
</exception>
</file>
</rbchecker>

Discussion

  • Anonymous

    Anonymous - 2007-12-17

    Logged In: YES
    user_id=1897664
    Originator: YES

    This only occurs with customfile checker with methods checkIsRbMissing() and checkLocalesInSync()

    Workaround: the custom filechecker should override the buggy method(s) with something like this:
    /**
    * {@inheritDoc}
    */
    protected boolean checkIsRbMissing() {
    final boolean isMissing = true;
    try {
    super.checkIsRbMissing();
    }
    catch (Exception e) {
    fireException(e);
    }
    return isMissing;
    }

     
  • redfish

    redfish - 2008-01-07
    • assigned_to: nobody --> redfish4ktc
     
  • redfish

    redfish - 2008-07-03
    • milestone: 763842 --> 857202
     
  • redfish

    redfish - 2008-08-26

    Logged In: YES
    user_id=1468241
    Originator: NO

    The workaround of 2007-12-17 18:32 is buggy.
    Do this otherwise the method always returns true:
    try {
    isMissing = super.checkIsRbMissing();
    }

    Note: with this workaround, 2 errors will be logged: an exception + missing ressource bundle error.

     
  • redfish

    redfish - 2009-02-13
    • milestone: 857202 --> _RbUtils_0.14
     

Log in to post a comment.