Hey, sorry to revive this old and long forgotten issue.
But I forgot to mention that recently, and using a rather rudimentary
method, I had been able to isolate the schema part that was causing
that IllegalArgumentException.
In the 2.1 version (which WASN'T causing any error) the problematic
complexType looked like that:
complexType name=ItemIconType final=#all
complexContent
extension base=kml:ObjectType
sequence
element name=state type=kml:itemIconStateType
minOccurs=0 maxOccurs=unbounded/
element name=href type=anyURI/
/sequence
/extension
/complexContent
/complexType
But in the 2.2 version of the schema this was changed so it looked like this:
complexType name=ItemIconType final=#all
complexContent
extension base=kml:AbstractObjectType
sequence
element ref=kml:state minOccurs=0/
element ref=kml:href minOccurs=0/
element ref=kml:ItemIconSimpleExtensionGroup minOccurs=0
maxOccurs=unbounded/
element ref=kml:ItemIconObjectExtensionGroup minOccurs=0
maxOccurs=unbounded/
/sequence
/extension
/complexContent
/complexType
And then previously, the conflicting element was defined:
element name=state type=kml:itemIconStateType/
With a bunch of other elements.
Well then, this state element was causing the trouble. I don't know
why (I guess it has to do with the minOccurs/maxOccurs attribute?), or
if there was a better way to avoid that exception (like a
configuration parameter, or something) but after manually editing the
schema and reverting this concrete object, the code (and the bindings)
are created.
Maybe someone reading this can correct the bug in the codeGen, or
treat that exception nicely so the user can understand what's going on.
I will welcome any further explanation on the matter, too.
Kind Regards.
Adrià Ribatallada i Torelló.
Quoting adria.ribatall...@est.fib.upc.edu:
Hi All,
I was trying to generate bindings for kml2.2 using the standard schemas
provided by ogc (http://schemas.opengis.net/kml/2.2.0/), but I'm stuck
at the first step since the codeGen tool throws this
IllegalArgumentException exception.
Using google's previous schema codeGen was working good, and all seemed
to work well (https://developers.google.com/kml/schema/kml21.xsd) but
it's vital for me to use this new version of the kml schema, and I
don't know what to do.
As you can imagine I don't have control over the schema since it's
given as is, and I'm completely at a loss.
Anyone have a clue why there is a problem? I'm doing something wrong?
is there something I can do to solve this?
I'v searched and found some cases of this exception in the mailing
list, but it were related to empty enumeration values, and I don't
think this is the concrete case here. Also most of that old messages
apparently were solved in newer versions of jibx, so.
What should I do?
Also, there are a LOT of Warning: No type defined for element
'something' at (line 1615, col 59, in ogckml22.xsd) but I don't think
it's related to the IllegalArgumentException.
I write here because I don't know who else can help me solve this
problem, any kind of advice will de helpful.
Thanks all in advance.
Greetings,
Adrià Ribatallada Torelló.
P.D. this is the exact output if it's of any help:
Exception in thread main java.lang.IllegalArgumentException
at
org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:191)
at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1303)
at
org.jibx.schema.codegen.ClassBuilder.createNormalMethodCall(ClassBuilder.java:588)
at
org.jibx.schema.codegen.StructureClassHolder.addRepeatedProperty(StructureClassHolder.java:1055)
at
org.jibx.schema.codegen.StructureClassHolder.addToClass(StructureClassHolder.java:1485)
at
org.jibx.schema.codegen.StructureClassHolder.addToClass(StructureClassHolder.java:1478)
at
org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHolder.java:2146)
at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:210)
at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:227)
at org.jibx.schema.codegen.CodeGen.buildDataModel(CodeGen.java:1572)
at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1781)
at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:2206)
--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users