Re: [jibx-users] CodeGen gives IllegalArgumentException

2013-02-08 Thread adria . ribatallada
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


Re: [jibx-users] CodeGen gives IllegalArgumentException

2012-10-03 Thread Yosvany
 adria.ribatallada at est.fib.upc.edu writes:

 
 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.
 

Hi all 

I'm getting this error working while trying to generate the code
using the travelport uAPI WSDLschema:  
http://support.travelport.com/webhelp/uapi/Content/
Resources/uAPI_WSDLschema_Release-
3.1.0.88.zip and jibx_1.2.4  (will try a previous version)

I'm using the codegen's build.xml from the examples directory 
just pointing to the other schema.


codegen:
 [echo] Running code generation from schema
 [java] Loaded and validated 1 specified schema(s) and 2 referenced 
schema(s)
 [java] Exception in thread main java.lang.IllegalArgumentException
 [java] at 
org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:191)
 [java] at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1303)
 . blabla (the same trace from the original post)

Any help with this guys?, i'm really new with all this stuff 
Thank you



--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users