JiBX
  1. JiBX
  2. JIBX-199

Certain characters in binding name cause runtime issues

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.5
    • Fix Version/s: JiBX 1.1.6
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows XP, running from within Eclipse 3.3. JRE/JDK 1.5
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      I have a small test case where I was exploring the use of JiBX, and I decided to try and use the name="whatever" format for the binding tag to name the bindings. I selected two names "old-version" and "543 version" for the restore. Both of these caused a runtime error like so:

      org.jibx.runtime.JiBXException: Binding information for class com.cdmtech.jibxtest.Library must be regenerated with current binding compiler
      at org.jibx.runtime.BindingDirectory.getFactoryFromName(BindingDirectory.java:134)
      at org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:174)
      at org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:193)
      at com.foobar.jibxtest.Main.main(Main.java:19)

      However, "543version" and "oldversion" worked just fine. If these characters are not supported, there should be an error to this effect during the build process. Also, the documentation makes no mention of unsupported characters.

      Also, I recieved the following error during the build while trying it with "5.4.3 version" for the name:

      [echo] Binding JiBX bindings in Jibx-huh...
      [bind] [Ljava.lang.String;@29ab3e
      [bind] [Ljava.lang.String;@1a99561
      [bind] Error running binding compiler
      [bind]
      [bind] *** Error during code generation for file 'C:\kmerrima\Java_Dev\workspace\Jibx-huh\bindings\restore2.jibx' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***
      [bind] java.lang.IllegalStateException: Internal error: Expected com.foobar.jibxtest.Book.JiBX_5.4 on stack, found com.foobar.jibxtest.Book
      [bind] full stack:
      [bind] 0: java.util.LinkedList
      [bind] 1: com.foobar.jibxtest.Book
      [bind] 2: org.jibx.runtime.impl.UnmarshallingContext
      [bind] at org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:420)
      [bind] at org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:537)
      [bind] at org.jibx.binding.classes.MethodBuilder.appendCallVirtual(MethodBuilder.java:894)
      [bind] at org.jibx.binding.def.ObjectBinding.genUnmarshalCall(ObjectBinding.java:579)
      [bind] at org.jibx.binding.def.ObjectBinding.genUnmarshalAttributeCall(ObjectBinding.java:676)
      [bind] at org.jibx.binding.def.ObjectBinding.genAttributeUnmarshal(ObjectBinding.java:933)
      [bind] at org.jibx.binding.def.ComponentProperty.genAttributeUnmarshal(ComponentProperty.java:149)
      [bind] at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:290)
      [bind] at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167)

      Both of these seem like pretty significant errors. I have attached my eclipse project, though you will need to fix the dependencies and build process.

        Activity

        Hide
        personwholives added a comment -

        oops. Forgot to mention. The example only includes one of the names that caused the problems. The other, you'll have to change it to. (Should have been fairly obvious).

        Show
        personwholives added a comment - oops. Forgot to mention. The example only includes one of the names that caused the problems. The other, you'll have to change it to. (Should have been fairly obvious).
        Hide
        Dennis Sosnoski added a comment -

        Corrected code, and will add documentation on legal name characters (Java identifier part characters).

        Show
        Dennis Sosnoski added a comment - Corrected code, and will add documentation on legal name characters (Java identifier part characters).

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            personwholives
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: