JiBX
  1. JiBX
  2. JIBX-440

Multi-module build does not use bindings from referenced modules

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.2.3
    • Fix Version/s: JiBX 1.2.3
    • Component/s: BindGen, maven plugin
    • Labels:
      None
    • Number of attachments :
      1

      Description

      A maven project contains two modules (module1 and module2). Module1 contains some bindings. Module2 contains some extra bindings, that build upon those of module1.

      In a multi-module build, one should only reference the bindings of module1. However, it appears as if one must repeat them.

      To reproduce, run "mvn process-classes" for the attached sample project.

        Activity

        Hide
        Don Corley added a comment -

        Alexandros,
        Does this project work when you execute from the command line?
        (ie., java -jar jibx-bind.jar ...)
        Don

        Show
        Don Corley added a comment - Alexandros, Does this project work when you execute from the command line? (ie., java -jar jibx-bind.jar ...) Don
        Hide
        Alexandros Karypidis added a comment -

        Hi Don,

        The behavior from command line is identical. Specifically, even though JiBX reports "using binding XXX" for both files, it appears as if the first one is not taken into account while processing the second:

        D:\ade\ws\prj>java -jar D:\ade\jibx\lib\jibx-bind.jar -v module1\src\main\config\binding.xml module2\src\main\config\binding.xml
        Using paths:
        D:\ade\jibx\lib\jibx-bind.jar
        D:\ade\jibx\lib\bcel.jar
        D:\ade\jibx\lib\jibx-run.jar
        D:\ade\jibx\lib\xpp3.jar
        D:\ade\jibx\lib\stax-api.jar
        D:\ade\jibx\lib\wstx-asl.jar
        .
        Using bindings:
        module1\src\main\config\binding.xml
        module2\src\main\config\binding.xml
        Running binding compiler version jibx_1_2_3_SNAPSHOT
        Error: Cannot find information for class module1.BaseType; on mapping element at (line 2, col 52, in binding.xml)
        Error running binding compiler
        org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of validation errors
        at org.jibx.binding.Utility.loadBinding(Utility.java:358)
        at org.jibx.binding.Utility.loadFileBinding(Utility.java:420)
        at org.jibx.binding.Compile.compile(Compile.java:217)
        at org.jibx.binding.Compile.main(Compile.java:384)

        Show
        Alexandros Karypidis added a comment - Hi Don, The behavior from command line is identical. Specifically, even though JiBX reports "using binding XXX" for both files, it appears as if the first one is not taken into account while processing the second: D:\ade\ws\prj>java -jar D:\ade\jibx\lib\jibx-bind.jar -v module1\src\main\config\binding.xml module2\src\main\config\binding.xml Using paths: D:\ade\jibx\lib\jibx-bind.jar D:\ade\jibx\lib\bcel.jar D:\ade\jibx\lib\jibx-run.jar D:\ade\jibx\lib\xpp3.jar D:\ade\jibx\lib\stax-api.jar D:\ade\jibx\lib\wstx-asl.jar . Using bindings: module1\src\main\config\binding.xml module2\src\main\config\binding.xml Running binding compiler version jibx_1_2_3_SNAPSHOT Error: Cannot find information for class module1.BaseType; on mapping element at (line 2, col 52, in binding.xml) Error running binding compiler org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of validation errors at org.jibx.binding.Utility.loadBinding(Utility.java:358) at org.jibx.binding.Utility.loadFileBinding(Utility.java:420) at org.jibx.binding.Compile.compile(Compile.java:217) at org.jibx.binding.Compile.main(Compile.java:384)
        Hide
        Don Corley added a comment -

        Alexandros,
        First, thank you very much for spending the time to include an example.
        Since you are getting an error on the command line, you probably have an error in your binding file.
        I looked through the JiBX examples and the documentation and I can't seem to find a sample with a pre-compiled base class.
        Sorry, but I'm not an expert on JiBX bindings, I maintain the maven plugin. I was assigned your bug since the description seemed like the problem was with the maven plug-in.
        Can you repost your question in the JiBX user list. You can ask for the correct binding file syntax to include a pre-compiled jibx binding class.
        Include the example that you posted for me.
        I'm sure somebody here can help you.
        Don

        Show
        Don Corley added a comment - Alexandros, First, thank you very much for spending the time to include an example. Since you are getting an error on the command line, you probably have an error in your binding file. I looked through the JiBX examples and the documentation and I can't seem to find a sample with a pre-compiled base class. Sorry, but I'm not an expert on JiBX bindings, I maintain the maven plugin. I was assigned your bug since the description seemed like the problem was with the maven plug-in. Can you repost your question in the JiBX user list. You can ask for the correct binding file syntax to include a pre-compiled jibx binding class. Include the example that you posted for me. I'm sure somebody here can help you. Don
        Hide
        Alexandros Karypidis added a comment -

        Will do!

        Thank you!

        Show
        Alexandros Karypidis added a comment - Will do! Thank you!

          People

          • Assignee:
            Don Corley
            Reporter:
            Alexandros Karypidis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: