JiBX
  1. JiBX
  2. JIBX-249

Binding compiler fails when a custom marshaller/unmarhsaller is missing a no-argument constructor

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Trivial Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: JiBX 1.1.6
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      When using a custom marshaller/unmarshaller that doesn't have a no-argument constructor (just the aliased constructor), the JiBX binding compiler will output the following error message:

          • Error during code generation for file 'binding.xml' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***

      This error no longer occurs once a no-argument constructor is added to the class.

      I was originally under the assumption that I had the option of using a no-argument constructor or the aliased constructor, but it appears the no-argument constructor is required. This being the case, the compiler should output a more informative error message as it does for other binding problems.

        Activity

        Dennis Sosnoski made changes -
        Field Original Value New Value
        Assignee Dennis Sosnoski [ dsosnoski ]
        Hide
        Dennis Sosnoski added a comment -

        It's not necessary to supply a default constructor if the class is only being used with an element name provided. I've added a test case to verify that this works correctly in the current code.

        If there's some location in the binding where the marshaller/unmarshaller is being used without providing an element name that would explain why the default constructor is being accessed.

        It would be good to provide a better warning for this case, but that's difficult to do in the current code - and since this is not a common problem it's probably not worth the effort.

        Show
        Dennis Sosnoski added a comment - It's not necessary to supply a default constructor if the class is only being used with an element name provided. I've added a test case to verify that this works correctly in the current code. If there's some location in the binding where the marshaller/unmarshaller is being used without providing an element name that would explain why the default constructor is being accessed. It would be good to provide a better warning for this case, but that's difficult to do in the current code - and since this is not a common problem it's probably not worth the effort.
        Dennis Sosnoski made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Sean Parmelee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: