XMLBeans
  1. XMLBeans
  2. XMLBEANS-235

scomp fails with error "encoded string too long"

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: Version 2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      WIndows XP, J2SE Version 1.5.0 (build 1.5.0_06-b05)

      Description

      scomp fails with the following output:

      Time to build schema type system: 1.492 seconds
      Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: encoded string too long: 80643 bytes (schemaorg_apache_xmlbeans.system.sD8C47734011B153A3D6BBC3BCCA9AC04.allassetsmodelgroup) - code 9
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$StringPool.writeTo(SchemaTypeSystemImpl.java:1021)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeRealHeader(SchemaTypeSystemImpl.java:1602)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveModelGroup(SchemaTypeSystemImpl.java:1406)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveModelGroups(SchemaTypeSystemImpl.java:1347)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1296)
      at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1098)
      at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:368)

      The problem appears to be with the line "output.writeUTF(str);" in the method writeTo in class org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl (line 1016). java.io.DataOutputStream.writeUTF has an implicit 64K byte length limit (because it stores the length in a two-byte integer) and this limit is being exceeded.

      The schema I am compiling comes from a third party and it is unlikely that it can be modified to work around this problem.

      1. Common.xsd
        91 kB
        Jon Schroeder
      2. Document.xsd
        2 kB
        Jon Schroeder
      3. Enumerations.xsd
        361 kB
        Jon Schroeder
      4. JobSearchAgent.xsd
        6 kB
        Jon Schroeder
      5. JobSeeker.xsd
        58 kB
        Jon Schroeder

        Activity

        Hide
        Jon Schroeder added a comment - - edited

        I have the same problem with 2.6.0 version. I am attempting to compile a Monster Schema. I have attached the xsd's that are required. The xsd to compile to reproduce the error is JobSeeker.xsd

        I reproduced this error on Windows7 using jdk1.6.0_37 and Ubuntu using jdk1.6.0_27

        Here is the Ubuntu output

        scomp -out JobSeeker.jar JobSeeker.xsd
        Time to build schema type system: 1.833 seconds
        Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: encoded string too long: 91578 bytes (schemaorg_apache_xmlbeans.system.s79A4106C33DD5C3CB79E9FF9B64FCECF.monsteroccupationidtier3enum7fcftype) - code 9
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$StringPool.writeTo(SchemaTypeSystemImpl.java:1036)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeRealHeader(SchemaTypeSystemImpl.java:1617)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveType(SchemaTypeSystemImpl.java:1455)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1331)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1306)
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126)
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373)

        Show
        Jon Schroeder added a comment - - edited I have the same problem with 2.6.0 version. I am attempting to compile a Monster Schema. I have attached the xsd's that are required. The xsd to compile to reproduce the error is JobSeeker.xsd I reproduced this error on Windows7 using jdk1.6.0_37 and Ubuntu using jdk1.6.0_27 Here is the Ubuntu output scomp -out JobSeeker.jar JobSeeker.xsd Time to build schema type system: 1.833 seconds Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: encoded string too long: 91578 bytes (schemaorg_apache_xmlbeans.system.s79A4106C33DD5C3CB79E9FF9B64FCECF.monsteroccupationidtier3enum7fcftype) - code 9 at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$StringPool.writeTo(SchemaTypeSystemImpl.java:1036) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeRealHeader(SchemaTypeSystemImpl.java:1617) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveType(SchemaTypeSystemImpl.java:1455) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1331) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1306) at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126) at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373)
        Hide
        Jacob Danner added a comment -

        Can you attach or reference a schema to be used for reproducing this issue. I think I've seen similar from an xsd with 75K enum values and this hit a limitation in java.

        Show
        Jacob Danner added a comment - Can you attach or reference a schema to be used for reproducing this issue. I think I've seen similar from an xsd with 75K enum values and this hit a limitation in java.
        Hide
        Tim Chen added a comment -

        Any update on this issue?

        Having the same issue when even using the latest version 2.4.0.

        scomp -ms 9024m -mx 9024m -out pas.jar OMSCommonTypes.xsd

        Time to build schema type system: 1.546 seconds
        Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: encoded string too long: 70810 bytes (schemaorg_apache_xmlbeans.sy
        stem.s0214BECAD453D2E3A24A20CE22170F2A.index) - code 9
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$StringPool.writeTo(SchemaTypeSystemImpl.java:1036)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeRealHeader(SchemaTypeSystemImpl.java:1617)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveIndex(SchemaTypeSystemImpl.java:336)
        at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1319)
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126)
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373)

        Show
        Tim Chen added a comment - Any update on this issue? Having the same issue when even using the latest version 2.4.0. scomp -ms 9024m -mx 9024m -out pas.jar OMSCommonTypes.xsd Time to build schema type system: 1.546 seconds Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: encoded string too long: 70810 bytes (schemaorg_apache_xmlbeans.sy stem.s0214BECAD453D2E3A24A20CE22170F2A.index) - code 9 at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$StringPool.writeTo(SchemaTypeSystemImpl.java:1036) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeRealHeader(SchemaTypeSystemImpl.java:1617) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveIndex(SchemaTypeSystemImpl.java:336) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1319) at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126) at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373)

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Isbell
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development