castor
  1. castor
  2. CASTOR-1568

When I try to generate the classes, the source generator simply hangs.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.0.4
    • Component/s: XML code generator
    • Labels:
      None
    • Environment:
      java 1.4, windows XP
    • Number of attachments :
      5

      Description

      When I try to generate the classes, the source generator simply hangs.

        Issue Links

          Activity

          Hide
          Edward Kuns added a comment -

          Attaching a patch that exposes the problem. There's an infinite loop, as shown in my comment above. The hack in the patch short circuits the infinite loop, which involves some classes that have themselves as their superclass and other classes that have themselves as their super-superclass. The hack also allows generation of the class Math. This hack allows class generation to complete (I don't know if it is accurate or not) but on the compliation step I get a lot of cyclic inheritence and complaints about "private not allowed here" before I get an out of memory error.

          I don't understand this code well enough to understand how to fix this problem, but hopefully this helps you solve it!

          Show
          Edward Kuns added a comment - Attaching a patch that exposes the problem. There's an infinite loop, as shown in my comment above. The hack in the patch short circuits the infinite loop, which involves some classes that have themselves as their superclass and other classes that have themselves as their super-superclass. The hack also allows generation of the class Math. This hack allows class generation to complete (I don't know if it is accurate or not) but on the compliation step I get a lot of cyclic inheritence and complaints about "private not allowed here" before I get an out of memory error. I don't understand this code well enough to understand how to fix this problem, but hopefully this helps you solve it!
          Hide
          Werner Guttmann added a comment -

          Thanks, Edward. It's actually quite odd that I don't get the loop anymore after fixing the namespace to package mapping. As a aworkaround this should be sufficient, but I agree that we should look at this loop more carefully.

          Show
          Werner Guttmann added a comment - Thanks, Edward. It's actually quite odd that I don't get the loop anymore after fixing the namespace to package mapping. As a aworkaround this should be sufficient, but I agree that we should look at this loop more carefully.
          Hide
          Edward Kuns added a comment -

          Attaching a minimal schema that produces this problem.. Reproducing this problem (the infinite loop) requires two instaces of the same element (in two different complex types) where the name and type are the same except for case. I imagine that the fpml schema as the same sort of tihng where an element becomes its own grandparent. The schema attached shows where an element becomes its own parent.

          Show
          Edward Kuns added a comment - Attaching a minimal schema that produces this problem.. Reproducing this problem (the infinite loop) requires two instaces of the same element (in two different complex types) where the name and type are the same except for case. I imagine that the fpml schema as the same sort of tihng where an element becomes its own grandparent. The schema attached shows where an element becomes its own parent.
          Hide
          Edward Kuns added a comment -

          I don't know how to prevent the cyclic inheritence loops that are causing the problem, but here is a patch that catches the inheritence loops and prevents them from causing an infinite loop.

          This doesn't fix the root problem, which is why it's called "partial-patch"

          Show
          Edward Kuns added a comment - I don't know how to prevent the cyclic inheritence loops that are causing the problem, but here is a patch that catches the inheritence loops and prevents them from causing an infinite loop. This doesn't fix the root problem, which is why it's called "partial-patch"
          Hide
          Werner Guttmann added a comment -

          As I have just committed a patch fixing the issue with incorrent member naming for element references that point to global element defs in 'type' mode (CASTOR-1645), I will be closing this as resolved. Edward, can I please ask you to move the 'looping business' to a new issue and assign it to 1.0.5, pretty please ?

          Show
          Werner Guttmann added a comment - As I have just committed a patch fixing the issue with incorrent member naming for element references that point to global element defs in 'type' mode ( CASTOR-1645 ), I will be closing this as resolved. Edward, can I please ask you to move the 'looping business' to a new issue and assign it to 1.0.5, pretty please ?

            People

            • Assignee:
              Werner Guttmann
              Reporter:
              Ritesh Patel
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5 hours
                5h
                Remaining:
                Remaining Estimate - 5 hours
                5h
                Logged:
                Time Spent - Not Specified
                Not Specified