JiBX
  1. JiBX
  2. JIBX-195

org.jibx.runtime.JiBXException: Marshaller class "userDefinedMarshallerClass" does not allow name to be set

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: JiBX 1.1.5
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Fedora distribution with JiBX 1.1.5
    • Number of attachments :
      0

      Description

      About the creation of a custom marshaller that implements IMarshaller and IUnmarshaller interface to handle an hashmap (similar to HashMapper.java located in example21), if IAliasable interface is not implemented by the marshalling/unmarshalling class, binding compiling crashes with the following exception :

      org.jibx.runtime.JiBXException: Marshaller class HashMapper does not allow name to be set
      at org.jibx.binding.def.DirectObject.<init>(DirectObject.java:192)
      at org.jibx.binding.def.BindingBuilder.unmarshalDirectObj(BindingBuilder.java:737)
      at org.jibx.binding.def.BindingBuilder.unmarshalMapping(BindingBuilder.java:1601)
      at org.jibx.binding.def.BindingBuilder.unmarshalMappings(BindingBuilder.java:983)
      at org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(BindingBuilder.java:1799)
      at org.jibx.binding.Utility.loadBinding(Utility.java:293)
      at org.jibx.binding.Utility.loadFileBinding(Utility.java:413)
      at org.jibx.binding.Compile.compile(Compile.java:296)
      at org.jibx.binding.Compile.main(Compile.java:385)

        Activity

        Hide
        Dennis Sosnoski added a comment -

        It looks like you're trying to use a name="..." attribute with the reference to the marshaller and unmarshaller class, which is only allowed if the marshaller/unmarshaller implements IAliasable. This should be caught and reported by the binding validation, though, rather than throwing an exception during code generation.

        It would help if you can attach a zipped project to demonstrate the problem, including an Ant build.xml for the project. If that's difficult, just copying the portion of the binding which references your HashMapper class into this bug report would be useful.

        Show
        Dennis Sosnoski added a comment - It looks like you're trying to use a name="..." attribute with the reference to the marshaller and unmarshaller class, which is only allowed if the marshaller/unmarshaller implements IAliasable. This should be caught and reported by the binding validation, though, rather than throwing an exception during code generation. It would help if you can attach a zipped project to demonstrate the problem, including an Ant build.xml for the project. If that's difficult, just copying the portion of the binding which references your HashMapper class into this bug report would be useful.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Assignee Dennis Sosnoski [ dsosnoski ]
        Summary org.jibx.runtime.JiBXException: Marshaller class "userDefinedMarshallerClass" does not allow name to be set
        org.jibx.runtime.JiBXException: Marshaller class "userDefinedMarshallerClass" does not allow name to be set
        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:
            Clavreul Mickael
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: