yeshodhan / android-jaxb

Android doesn't support JAXB. Use this library to generate SimpleXML annotated classes from XML Schema. Works well with Android.
https://s3.amazonaws.com/yeshodhan/android-jaxb-1.0.1.jar
41 stars 17 forks source link

NullPointerException thrown while parsing IAB VAST 2.0.1 XSD #5

Open Unlimity opened 8 years ago

Unlimity commented 8 years ago

Hello there! I tried to use this library to convert IAB's VAST 2.0.1 XSD for my current project and issued this exception:

Exception in thread "main" java.lang.NullPointerException
    at com.mickoo.xml.xsd2simplexml.NameUtil.toWordList(NameUtil.java:208)
    at com.mickoo.xml.xsd2simplexml.NameConverter$Standard.toWordList(NameConverter.java:106)
    at com.mickoo.xml.xsd2simplexml.NameConverter$Standard.toClassName(NameConverter.java:108)
    at com.mickoo.xml.xsd2simplexml.CodeGenerator.createElement(CodeGenerator.java:43)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:323)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:208)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processGroup(SchemaParser.java:219)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:204)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processComplexType(SchemaParser.java:232)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:344)
    at com.mickoo.xml.xsd2simplexml.SchemaParser.parse(SchemaParser.java:67)
    at com.mickoo.xml.xsd2simplexml.Main.main(Main.java:80)

You can download this xsd at IAB I hope you can solve the issue or point me out where to search for answer. Thanks in advance!

yeshodhan commented 8 years ago

I've checked few interim fixes for making the VAST schema work. See vast.zip There are a lot of anonymous complex types, that were causing issues.

Could you please pull or use the attached file, and let me know if it works? If yes, I'll make a new release a new version with the fixes. android-jaxb-1.0.1-jar-with-dependencies.jar.zip

jrkoiter commented 8 years ago

I ran into the same NullPointerException, but with a different XSD. Using the version linked in the previous comment fixed the issue. That is: generation finishes without error. I still need to verify the generated classes though.

yshahak commented 7 years ago

I had the same problem. the android-jaxb-1.0.1-jar-with-dependencies.jar.zip managed to generate the files. But I needed to do a lot of changes as it didn't convert properly some of the elements.

mohdizham commented 7 years ago

its been a while since i post my problem. and no response from the developer. my workaround, i just use other alternatives

On Fri, Feb 10, 2017 at 2:51 PM, Yaakov Shahak notifications@github.com wrote:

I had the same problem. the android-jaxb-1.0.1-jar-with- dependencies.jar.zip managed to generate the files. But I needed to do a lot of changes as it didn't convert properly some of the elements.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yeshodhan/android-jaxb/issues/5#issuecomment-278871103, or mute the thread https://github.com/notifications/unsubscribe-auth/AR2Pc0GGchmxHvydEF3AArQVgxPPeUJhks5rbAjzgaJpZM4Gwxd1 .