4

I'm running the JAXB XJC code generator (v2.2.4-1) and it works just fine on a 32 bit linux with 32 bit java. But when I run it on a 64 bit linux I get something like:

Exception in thread "main" java.lang.IllegalArgumentException:
    Illegal class inheritance loop.
    Outer class ProductSectionProperty may not subclass from inner class: ProductSectionProperty

In both cases I'm using Oracle's JDK 1.6.0_u24.

To fix this I tried:

  • using 32bit java on the 64bit machine
  • specify -XX:+UseCompressedOops
  • specify -XX:-UseCompressedOops when I realised that the above is the default

but the result was the same.

Any ideas why is this happening or what to try next?

ivant
  • 3,909
  • 1
  • 25
  • 39
  • 3
    I would try Java 6 update 26 as it sounds like a bug. Either both should work or both should fail. You could also try Java 7 to see if this behaves the same (even if you don't intend to use it) – Peter Lawrey Aug 22 '11 at 08:26
  • Looks like time for support call with Oracle, Java clearly not being so portable. You could give a different JVM a try, IBM or JRockit would be primary choices. – Steve-o Aug 22 '11 at 09:31
  • Steve-o thanks! I tried IBM's JDK and it works on both systems. – ivant Aug 22 '11 at 10:32
  • possible duplicate: http://stackoverflow.com/questions/144118/jaxb-binding-customization – Denis Tulskiy Aug 22 '11 at 11:37
  • @ivant - Could you enter a bug for this issue: http://java.net/jira/browse/JAXB/ – bdoughan Aug 22 '11 at 14:58
  • @Blaise - I don't think this is JAXB bug, as it fails only on 64bit linux machines with oracle's jdk. I'm trying to create a simple scenario to reproduce this, as I cannot send the whole project (too big and proprietary) to oracle. – ivant Aug 23 '11 at 07:44

1 Answers1

0

Any ideas why is this happening or what to try next?

1) No

2) I'd try ignoring the 32 vs 64 issue for now, and see if you can fix the problem a different way. I Googled the message "Illegal class inheritance loop." and there are many hits. Try scanning them and seeing if the symptoms / root problem / solution applies to your case.

(I couldn't find a Java bug for this, but Java bug search doesn't work well in my experience ...)

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • I tried that path as well, but since the generated classes are part of a fairly large project I left "fixing" the schema/bindings as last resort. – ivant Aug 22 '11 at 09:48
  • In any case it bothers me, that the JVM can act so differently. The only thing I could come up with, was the longer address can somehow produce larger hashes than expected from the JAXB code. But it doesn't look likely, because the hashCode method still returns "int". And I glanced over the source code of the JAXB package and couldn't find any suspicious hashCode/equals methods. – ivant Aug 22 '11 at 09:56