1. JiBX
  2. JIBX-284

Undefined or unusable namespace when running binding compiler with generated binding


    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.2.1
    • Fix Version/s: JiBX 1.2.2
    • Component/s: CodeGen
    • Labels:
    • Number of attachments :


      Generated binding results in

      [echo] Running JiBX binding compiler
      [bind] Error running binding compiler
      [bind] *** Error during code generation for file 'wssec-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 ***
      [bind] org.jibx.runtime.JiBXException: Undefined or unusable namespace "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
      [bind] at org.jibx.binding.def.NameDefinition.fixNamespace(NameDefinition.java:160)
      [bind] at org.jibx.binding.def.BindingBuilder.unmarshalValue(BindingBuilder.java:683)
      [bind] at org.jibx.binding.def.BindingBuilder.unmarshalStructureChildren(BindingBuilder.java:993)
      [bind] at org.jibx.binding.def.BindingBuilder.unmarshalMapping(BindingBuilder.java:1798)
      [bind] at org.jibx.binding.def.BindingBuilder.unmarshalMappings(BindingBuilder.java:1127)
      [bind] at org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(BindingBuilder.java:2118)
      [bind] at org.jibx.binding.Utility.loadBinding(Utility.java:314)
      [bind] at org.jibx.binding.Utility.loadFileBinding(Utility.java:431)
      [bind] at org.jibx.binding.Compile.compile(Compile.java:212)

      The binding was created using the attached ws-security schema and customization file with the ant command:

      <java classname="org.jibx.schema.codegen.CodeGen" fork="yes" classpathref="classpath" failonerror="true">
      <arg value="-c" />
      <arg value="custom-jibx-wssec-gen.xml" />
      <arg value="-t" />
      <arg value="$


      " />
      <arg value="schema/oasis-200401-wss-wssecurity-secext-1.0.xsd" />

      A workaround is to manually change the 2nd line of the generated binding from:
      <namespace uri="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" default="elements"/>
      <namespace uri="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" default="elements" prefix="wsse"/>

      Interestingly, this problem did not occur when using codegen with multiple schema including this one. The problem only started when this schema was split off into a separate code gen target.

      1. custom-jibx-wssec-gen.xml
        0.4 kB
        Nigel Charman
      2. oasis-200401-wss-wssecurity-secext-1.0.xsd
        11 kB
        Nigel Charman


        Dennis Sosnoski added a comment -

        Fixed tracking of namespace usages by element and attribute names so that required <namespace> element is added to binding definition.

        Dennis Sosnoski added a comment - Fixed tracking of namespace usages by element and attribute names so that required <namespace> element is added to binding definition.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s JiBX 1.2.2 [ 15120 ]
        Resolution Fixed [ 1 ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]


          • Assignee:
            Dennis Sosnoski
            Nigel Charman
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: