jaxb
  1. jaxb
  2. JAXB-873

Method Accessor.receive conceals exception

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This issue shows up in at least one other guise, e.g., GLASSFISH-17976. There is a problem in

      AdaptedAccessor<BeanT,InMemValueT,OnWireValueT>(Accessor<BeanT,ValueT>).receive(UnmarshallingContext$State, Object) line: 173

      public void receive(UnmarshallingContext.State state, Object o) throws SAXException {
      try

      { set((BeanT) state.target, (ValueT) o); }

      catch (AccessorException e)

      { Loader.handleGenericException(e, true); }

      catch (IllegalAccessError iae)

      { // throw UnmarshalException instead IllegalAccesssError | Issue 475 Loader.handleGenericError(iae); }

      }

      If an Exception occurs in set(), it is swallowed and nothing is reported because 'canRecover' is set to true.

      When excecuting my code it appears that unmarshalling succeeded while it did not (in my case because property setters were missing). This is the concealed message I'd like to have seen and would have saved me a lot of time:

      The property has a getter "public java.util.HashMap com.semmtech.boxmodel.properties.WorksheetProperties.getForEachCountVariables()" but no setter. For unmarshalling, please define setters. (Or if this is a collection property, make sure that the getter returns a collection instance.)

        Issue Links

          Activity

          Hide
          Martin Grebac added a comment -

          Would you please submit a testcase for this? You mean there's nothing reported to the error handler?

          Show
          Martin Grebac added a comment - Would you please submit a testcase for this? You mean there's nothing reported to the error handler?
          Hide
          Fred Wan added a comment -

          The file "testAdaptedAccessor_sources.zip" contains the sources of a testcase that demonstrates this issue. A description of the events that cause the problem is provided in the document "Description of events in AdaptedAccessor.doc".

          Show
          Fred Wan added a comment - The file "testAdaptedAccessor_sources.zip" contains the sources of a testcase that demonstrates this issue. A description of the events that cause the problem is provided in the document "Description of events in AdaptedAccessor.doc".

            People

            • Assignee:
              Iaroslav Savytskyi
              Reporter:
              Fred Wan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: