Skip to content
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

jaxb:typesafeEnumClass doesn't play nice with episode based projects #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samhendley
Copy link

I have been struggling to get episode based compilation to work on an existing codebase. Using these samples I have been able to get most of the way then ran into this show stopper with enum values. I was able to replicate this in your sample projects. Basically it looks like there is some sort of issue with including the typesafeEnumClass in some cases. In particular I ran into this issue with an integer enum class but it appears to be occur if you use both typesafeEnumClass and typesafeEnumMember on a string enum.

I think the "default bindings" may somehow related but I am out of my depth on how I would go about fixing this. If there is a simple solution it wouldn't be a bad idea to add to sample project.

Thanks for your hard work on this plugin, having samples and tests made it infinitely easier for me to boil down by use case to this minimal reproduction case. Happy New Year!

Errors are:

[ERROR] Error while parsing schema(s).Location [ https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/samples/episode/a/src/main/resources/a.xsd{66,30}].
com.sun.istack.SAXParseException2; systemId: https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/samples/episode/a/src/main/resources/a.xsd; lineNumber: 66; columnNumber: 30; compiler was unable to honor this enum customization. It is attached to a wrong place, or its inconsistent with other bindings.
    at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:86)
    at com.sun.tools.xjc.reader.xmlschema.ErrorReporter.error(ErrorReporter.java:84)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check(UnusedCustomizationChecker.java:149)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check(UnusedCustomizationChecker.java:127)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.simpleType(UnusedCustomizationChecker.java:240)
    at com.sun.xml.xsom.impl.SimpleTypeImpl.visit(SimpleTypeImpl.java:164)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.run(UnusedCustomizationChecker.java:113)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.run(UnusedCustomizationChecker.java:107)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:181)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:119)
    at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:425)
    at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
    at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:50)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:40)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:505)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:328)
    at ...
[ERROR] Error while parsing schema(s).Location [ https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/samples/episode/a/src/main/resources/a.xsd{62,36}].
com.sun.istack.SAXParseException2; systemId: https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/samples/episode/a/src/main/resources/a.xsd; lineNumber: 62; columnNumber: 36; (the above customization is attached to the following location in the schema)
    at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:86)
    at com.sun.tools.xjc.reader.xmlschema.ErrorReporter.error(ErrorReporter.java:84)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check(UnusedCustomizationChecker.java:154)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check(UnusedCustomizationChecker.java:127)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.simpleType(UnusedCustomizationChecker.java:240)
    at com.sun.xml.xsom.impl.SimpleTypeImpl.visit(SimpleTypeImpl.java:164)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.run(UnusedCustomizationChecker.java:113)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.run(UnusedCustomizationChecker.java:107)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:181)
    at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:119)
    at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:425)
    at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
    at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:50)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:40)
    at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:505)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:328)
    at ...

@m120miller
Copy link

It would be really helpful if this was fixed.

@samhendley
Copy link
Author

Should I rework this as a https://github.com/highsource/maven-jaxb2-plugin-support issue?

@highsource
Copy link
Owner

Hi,

no, not necessary. I've just a bit to much stress at work, don't come to OS things.

Best wishes,
Alexey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants