JiBX
  1. JiBX
  2. JIBX-221

Cannot define name in structure when using custom un/marshaller + related issues

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: JiBX 1.1.6
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      All
    • Number of attachments :
      0

      Description

      According to the binding tutorial, a name is not required on a mapping for a concrete-type if a custom marshaller-unmarshaller pair is defined. However, when I try to set a name on a structure that resolves to such a mapping, I get an error: "name attribute not allowed on concrete mapping reference". This seems inconsistent with the above exception but it's not the real problem.

      When I do set the mapping element to abstract="true" and set a name on the structure, I get the following exception:

      Error running binding compiler
      org.jibx.runtime.JiBXException: Unable to change access permissions for <init> in class [my-package].JiBX_MungeAdapter
      at org.jibx.binding.classes.ClassItem.makeAccessible(ClassItem.java:298)
      at org.jibx.binding.def.ObjectBinding.genNewInstanceCode(ObjectBinding.java:440)
      at org.jibx.binding.def.ObjectBinding.genNewInstanceCall(ObjectBinding.java:488)
      at org.jibx.binding.def.ObjectBinding.genNewInstance(ObjectBinding.java:963)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:267)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:314)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:810)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:954)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:314)
      at org.jibx.binding.def.MappingDefinition.generateUnmarshalImplementation(MappingDefinition.java:644)
      at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:855)
      at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:669)
      at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:792)
      at org.jibx.binding.Compile.compile(Compile.java:305)
      at org.jibx.binding.Compile.main(Compile.java:385)

      This seems pretty strange since this is created by Jibx i.e. why can't it change what it creates? And the name of the element has nothing to do with my code.

      The only think I thought might be an issue is that the binaries for the custom mapped class are not provided for updating but the error doesn't refer to that class anyway and the name of the element is not relevant to that class.

      It seems that I should be able to define the element name on the structure instead of defining a new mapping for every name I want to map my type to.

        Activity

        Hide
        Dennis Sosnoski added a comment -

        This bug report is unfortunately too vague to verify. If anyone sees this occur, please attach an Ant project to demonstrate the problem.

        Show
        Dennis Sosnoski added a comment - This bug report is unfortunately too vague to verify. If anyone sees this occur, please attach an Ant project to demonstrate the problem.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            James Watson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: