Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1464

XSD Sequencer issue with Unsigned Longs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 3.0.0.Alpha4
    • 3.0.0.Final
    • JCR, Sequencers
    • None

    Description

      Unsigned Longs can be too long for Long, so the Session's javax.jcr.ValueFactory instance used by the sequencer should be able to convert these values into BigDecimal values (which is the only option given the JCR property types).

      The sequencer chokes on this part of the xsd:

      <xs:restriction base="xs:nonNegativeInteger">
        <xs:maxInclusive value="18446744073709551615"
              id="unsignedLong.maxInclusive"/>
      </xs:restriction>
      

      Here's the log:

      13:36:17,740 ERROR The 'org.modeshape.sequencer.xsd.XsdSequencer' sequencer of repository 'S-RAMP Repository' had an error while processing '/xsdfiles/XMLSchema.xsd/jcr:content/jcr:data' in workspace 'default' and generating output '/derived/xsd/XMLSchema.xsd'
      javax.jcr.ValueFormatException: org.modeshape.jcr.value.ValueFormatException: Error converting String to a Long: 18446744073709551615
      	at org.modeshape.jcr.JcrValueFactory.convertValueToType(JcrValueFactory.java:222)
      	at org.modeshape.jcr.JcrValueFactory.createValue(JcrValueFactory.java:77)
      	at org.modeshape.jcr.JcrValueFactory.createValue(JcrValueFactory.java:43)
      	at org.modeshape.sequencer.xsd.XsdReader.processFacet(XsdReader.java:743)
      	at org.modeshape.sequencer.xsd.XsdReader.processTypeFacets(XsdReader.java:286)
      	at org.modeshape.sequencer.xsd.XsdReader.processSimpleTypeDefinition(XsdReader.java:252)
      	at org.modeshape.sequencer.xsd.XsdReader.process(XsdReader.java:189)
      	at org.modeshape.sequencer.xsd.XsdReader.read(XsdReader.java:141)
      	at org.modeshape.sequencer.sramp.AbstractResolvingReader.read(AbstractResolvingReader.java:83)
      	at org.modeshape.sequencer.xsd.XsdSequencer.execute(XsdSequencer.java:61)
      	at org.modeshape.jcr.SequencingRunner.run(SequencingRunner.java:132)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: org.modeshape.jcr.value.ValueFormatException: Error converting String to a Long: 18446744073709551615
      	at org.modeshape.jcr.value.basic.LongValueFactory.create(LongValueFactory.java:63)
      	at org.modeshape.jcr.value.basic.LongValueFactory.create(LongValueFactory.java:49)
      	at org.modeshape.jcr.value.basic.AbstractValueFactory.create(AbstractValueFactory.java:103)
      	at org.modeshape.jcr.JcrValueFactory.convertValueToType(JcrValueFactory.java:220)
      	... 13 more
      Caused by: java.lang.NumberFormatException: For input string: "18446744073709551615"
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      	at java.lang.Long.parseLong(Long.java:422)
      	at java.lang.Long.valueOf(Long.java:525)
      	at org.modeshape.jcr.value.basic.LongValueFactory.create(LongValueFactory.java:61)
      	... 16 more
      

      Please find the xsd attached.

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            kstam@redhat.com Kurt Stam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: