scalaxb feedback

60 views
Skip to first unread message

Caoilte O'Connor

unread,
Apr 3, 2013, 1:00:14 PM4/3/13
to sca...@googlegroups.com
Hi,
I successfully integrated Scalaxb into a project last week and, as posted previously, I'm really happy with the result.

Only two problems came up during the entire integration, and though I was ultimately able to resolve both of them - I thought Scalaxb could have provided better error messaging and that I should feedback with specific examples.

Apologies if it sounds like I'm nitpicking, I think everyone involved should be very proud that the following were the only problems I could find with Scalaxb.

1) Error messaging around nillables

I was getting an empty element returned by our SOAP server for an optional field. According to


this shouldn't happen (most other SOAP clients seem to swallow the problem)

I'm fine with Scalaxb exploding, however it took me a while to diagnose why from the following stack

[info]   scalaxb.ParserFailure: java.lang.NumberFormatException: Zero length BigInteger
[info]   at scalaxb.package$.fromXML(scalaxb.scala:15)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29$$anonfun$apply$30.apply(xmlprotocol.scala:818)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29$$anonfun$apply$30.apply(xmlprotocol.scala:818)
[info]   at scala.Option.map(Option.scala:145)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29.apply(xmlprotocol.scala:818)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29.apply(xmlprotocol.scala:818)
[info]   at scala.Option.map(Option.scala:145)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30.apply(xmlprotocol.scala:818)
[info]   at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30.apply(xmlprotocol.scala:815)
[info]   at scala.util.parsing.combinator.Parsers$Success.map(Parsers.scala:136)

An error which indicates which field had the problem would have saved me from trawling through hundreds of fields in my data and removing them by trial and error.

2) Error messaging around multiple schemas

Another problem that is very well documented on the website but equally confusing when encountered in the wild is,


It was cool the way Scalaxb attempted to resolve namespace conflicts by arbitrarily assigning unique type names to generated code. We didn't even realise that we had namespace conflicts until we ran our code on CI and discovered that it was arbitrarily assigning _different_ unique type names to generated code (because it read the XSDs in a different order).

The compilation failures as a result were difficult to figure out.

It would have been better if Scalaxb had either,
1) refused to generate code when it found namespace conflicts and suggested that we add packages
2) made sure that it read XSD files in the same order regardless of the operating system (we saw different XSD file read order on Max/Linux).



Two tiny niggling errors with a great product,

Thanks

Caoilte

eugene yokota

unread,
Apr 3, 2013, 1:24:50 PM4/3/13
to sca...@googlegroups.com
Hi,

Thanks for the feedback! I'm ways happy to hear stories about scalaxb usage.

Both of your suggestions seems valid at a glance.
If you find some situation that shoudn't happen according the spec or what I wrote on the site,
please feel free to open a github cases: http://scalaxb.org/issue-reporting-guideline

The github issues let's us tie specific issues to code, and you'd be notified if I pushed the fix in.

As per auto name conflict resolution, I'd probably go with 2) read the files consistently for now.
Do you where the order is introduced? Are you using sbt-scalaxb, mvn-scalaxb, or the commandline?

-eugene



--
You received this message because you are subscribed to the Google Groups "scalaxb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaxb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Caoilte O'Connor

unread,
Apr 3, 2013, 1:34:57 PM4/3/13
to sca...@googlegroups.com

Cool. I'll make sure to raise issues for both tomorrow.

We're using the SBT plugin - which reminds me, we weren't able to get build.Scala examples to work - only build.SBT. I'll post an example of that too.

eugene yokota

unread,
Apr 3, 2013, 1:47:20 PM4/3/13
to sca...@googlegroups.com
From the number of typos and grammatical mistakes I made, I sounded like I'm drunk or crazy.
I wish I could typecheck my email for subject-verb agreements.

-eugene

Caoilte O'Connor

unread,
Apr 6, 2013, 10:12:55 AM4/6/13
to sca...@googlegroups.com
Hi,
Sorry for the delay, I finally found time to create the two issues. They are,


I was eventually able to solve my other problem (configuring scalaxb in scala project file rather than sbt config file) by myself. It was more of an SBT issue generally than about Scalaxb specifically. Importing the Scalaxb plugin caused conflicts with how I had defined projectSettings and buildSettings. One day I'll learn SBT properly...

Thanks again,

c

Reply all
Reply to author
Forward
0 new messages