JiBX
  1. JiBX
  2. JIBX-419

Inconsistent classpaths when using a base binding file in CodeGen

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.2.2
    • Fix Version/s: None
    • Component/s: CodeGen
    • Labels:
      None
    • Environment:
      Java 1.6
    • Number of attachments :
      2

      Description

      Dennis,
      I'm having a problem using codegen with based binding (which I need for the schema-library).
      Since I'm calling codegen from java, I can't change the classpath or my current directory and I can only specify relative paths.
      I have to use -t (target dir) which specifies the source and binding file location. -i requires a path from my working location, but the generated binding file ends up specifying the this link to the base binding file as relative to the compile root.
      Just unzip this file, change line 1 to point to your core/lib and run it... it fails on the third codegen.
      Take a look at the <include path="..."> in person-binding.xml
      Thanks,
      Don
      My test schema looks like this
      person.xsd <- address.xsd <- company.xsd

        Activity

        Hide
        Don Corley added a comment -

        When I say change line 1, I mean in the run.sh script in this zip file.

        Show
        Don Corley added a comment - When I say change line 1, I mean in the run.sh script in this zip file.
        Hide
        Don Corley added a comment -

        This patch should fix the problem.
        The first two lines are optional, they say if the binding location is relative, make it relative to the target dir.
        The second two lines fix this bug.
        If the binding file location is at or below the target directory, don't include the target directory name.
        Dennis... nice code; easy to understand. Better than my code.
        Don

        Show
        Don Corley added a comment - This patch should fix the problem. The first two lines are optional, they say if the binding location is relative, make it relative to the target dir. The second two lines fix this bug. If the binding file location is at or below the target directory, don't include the target directory name. Dennis... nice code; easy to understand. Better than my code. Don
        Don Corley made changes -
        Field Original Value New Value
        Attachment codegen.patch [ 53882 ]
        Hide
        Don Corley added a comment -

        Added patch for 1.2.4 release

        Show
        Don Corley added a comment - Added patch for 1.2.4 release
        Don Corley made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Dennis Sosnoski [ dsosnoski ] Don Corley [ doncorley ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: