New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug naming the generated case class for large groups #188

Closed
workingDog opened this Issue Feb 11, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@workingDog

steps

  1. compile schema with a group whose sequence has >22 elements.
  <xs:group name="Group1">
    <xs:sequence>
      <xs:element name="string1" type="xs:string"/>
      <xs:element name="string2" type="xs:string"/>
      <xs:element name="string3" type="xs:string"/>
      <xs:element name="string4" type="xs:string"/>
      <xs:element name="string5" type="xs:string"/>
      <xs:element name="string6" type="xs:string"/>
      <xs:element name="string7" type="xs:string"/>
      <xs:element name="string8" type="xs:string"/>
      <xs:element name="string9" type="xs:string"/>
      <xs:element name="string10" type="xs:string"/>
      <xs:element name="string11" type="xs:string"/>
      <xs:element name="string12" type="xs:string"/>
      <xs:element name="string13" type="xs:string"/>
      <xs:element name="string14" type="xs:string"/>
      <xs:element name="string15" type="xs:string"/>
      <xs:element name="string16" type="xs:string"/>
      <xs:element name="string17" type="xs:string"/>
      <xs:element name="string18" type="xs:string"/>
      <xs:element name="string19" type="xs:string"/>
      <xs:element name="string20" type="xs:string"/>
      <xs:element name="string21" type="xs:string"/>
      <xs:element name="string22" type="xs:string"/>
      <xs:element name="string23" type="xs:string"/>
      <xs:element name="string24" type="xs:string"/>
      <xs:element name="string25" type="xs:string"/>
      <xs:element name="string26" type="xs:string"/>
      <xs:element name="string27" type="xs:string"/>
      <xs:element name="string28" type="xs:string"/>
      <xs:element name="string29" type="xs:string"/>
      <xs:element name="string30" type="xs:string"/>
    </xs:sequence>
  </xs:group>

problem

  1. the source gen fails.

expectation

split them up.

case class Group1Sequence(group1sequence2: general.Group1Sequence2,
  group1sequence3: general.Group1Sequence3,
  group1sequence4: general.Group1Sequence4)

original report

Error running scalaxb: key not found:

from https://github.com/workingDog/AIXM

mvn generate-sources

result in:

[ERROR] Failed to execute goal org.scalaxb:scalaxb-maven-plugin:1.0.0:generate (scalaxb) on project aixm: 
Error running scalaxb: key not found: NameKey(XsdTypeKind,Some(http://www.aixm.aero/schema/5.1),AerialRefuellingPropertyGroup) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.scalaxb:scalaxb-maven-plugin:1.0.0:generate (scalaxb) on project aixm: Error running scalaxb

Caused by: java.util.NoSuchElementException: key not found: 
NameKey(XsdTypeKind,Some(http://www.aixm.aero/schema/5.1),AerialRefuellingPropertyGroup) 
        at scala.collection.MapLike$class.default(MapLike.scala:224) 
        at scala.collection.mutable.ListMap.default(ListMap.scala:37) 
        at scala.collection.MapLike$class.apply(MapLike.scala:135) 
        at scala.collection.mutable.ListMap.apply(ListMap.scala:37) 
        at scalaxb.compiler.xsd.ContextProcessor$class.familyName$1(ContextProcessor.scala:392) 
        at scalaxb.compiler.xsd.ContextProcessor$class.formSequence$1(ContextProcessor.scala:383) 
        at scalaxb.compiler.xsd.ContextProcessor$$anonfun$makeGroupCompositorName$1$1.apply(ContextProcessor.scala:361) 
        at scalaxb.compiler.xsd.ContextProcessor$$anonfun$makeGroupCompositorName$1$1.apply(ContextProcessor.scala:361) 
        at scalaxb.compiler.xsd.ContextProcessor$class.splitLong(ContextProcessor.scala:308) 
        at scalaxb.compiler.xsd.Driver$$anon$3.splitLong(Driver.scala:41) 
        at scalaxb.compiler.xsd.ContextProcessor$class.makeGroupCompositorName$1(ContextProcessor.scala:361) 
        at scalaxb.compiler.xsd.ContextProcessor$$anonfun$makeCompositorNames$4.apply(ContextProcessor.scala:339) 
        at scalaxb.compiler.xsd.ContextProcessor$$anonfun$makeCompositorNames$4.apply(ContextProcessor.scala:331) 
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) 
        at scala.collection.immutable.List.foreach(List.scala:45) 
        at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30) 
        at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42) 
        at scalaxb.compiler.xsd.ContextProcessor$class.makeCompositorNames(ContextProcessor.scala:331) 
        at scalaxb.compiler.xsd.Driver$$anon$3.makeCompositorNames(Driver.scala:41) 
        at scalaxb.compiler.xsd.ContextProcessor$class.processContext(ContextProcessor.scala:203) 
        at scalaxb.compiler.xsd.Driver$$anon$3.processContext(Driver.scala:41) 
        at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:43) 
        at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:31) 
        at scalaxb.compiler.Module$class.processReaders(Module.scala:323) 
        at scalaxb.compiler.xsd.Driver.processReaders(Driver.scala:31) 
        at scalaxb.compiler.Module$class.processFiles(Module.scala:154) 
        at scalaxb.compiler.xsd.Driver.processFiles(Driver.scala:31) 
        at org.scalaxb.maven.ScalaxbMojo.generateSources(ScalaxbMojo.java:186) 
        at org.scalaxb.maven.ScalaxbMojo.invokeCompiler(ScalaxbMojo.java:152)  

The AerialRefuellingPropertyGroup is in AIXM_Features.xsd

Possible scalaxb bug naming the generated case class for the group.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Feb 21, 2013

Owner

I've fixed this problem right away, but AIXM exposed more issues in scalaxb. I'll let you know once it can generate legal code.

Owner

eed3si9n commented Feb 21, 2013

I've fixed this problem right away, but AIXM exposed more issues in scalaxb. I'll let you know once it can generate legal code.

@eed3si9n eed3si9n closed this in 57194a3 Feb 21, 2013

@workingDog

This comment has been minimized.

Show comment
Hide comment
@workingDog

workingDog Feb 21, 2013

Thanks. I'm grateful someone is looking into this.

From: eugene yokota notifications@github.com
Reply-To: eed3si9n/scalaxb
<reply+i-10883458-91b9e4a4e05c5ccfe23dc3b2c7ee94edb25303a3-3400460@reply.git
hub.com>
Date: Thursday, 21 February 2013 5:19 PM
To: eed3si9n/scalaxb scalaxb@noreply.github.com
Cc: ringo wathelet kodefarmer@gmail.com
Subject: Re: [scalaxb] bug naming the generated case class for large groups
(#188)

I've fixed this problem right away, but AIXM exposed more issues in scalaxb.
I'll let you know once it can generate legal code.


Reply to this email directly or view it on GitHub
#188 (comment) .

Thanks. I'm grateful someone is looking into this.

From: eugene yokota notifications@github.com
Reply-To: eed3si9n/scalaxb
<reply+i-10883458-91b9e4a4e05c5ccfe23dc3b2c7ee94edb25303a3-3400460@reply.git
hub.com>
Date: Thursday, 21 February 2013 5:19 PM
To: eed3si9n/scalaxb scalaxb@noreply.github.com
Cc: ringo wathelet kodefarmer@gmail.com
Subject: Re: [scalaxb] bug naming the generated case class for large groups
(#188)

I've fixed this problem right away, but AIXM exposed more issues in scalaxb.
I'll let you know once it can generate legal code.


Reply to this email directly or view it on GitHub
#188 (comment) .

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Mar 9, 2013

Owner

I published 1.0.2-SNAPSHOT with a bunch of bug fixes I ran into with AIXM schema:
https://oss.sonatype.org/content/repositories/snapshots//org/scalaxb/scalaxb-maven-plugin/1.0.2-SNAPSHOT/

Using sbt, the compiler eventually failed with OutOfMemoryError, but you might have better luck.

Owner

eed3si9n commented Mar 9, 2013

I published 1.0.2-SNAPSHOT with a bunch of bug fixes I ran into with AIXM schema:
https://oss.sonatype.org/content/repositories/snapshots//org/scalaxb/scalaxb-maven-plugin/1.0.2-SNAPSHOT/

Using sbt, the compiler eventually failed with OutOfMemoryError, but you might have better luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment