XMLBeans - how to control generated class files? windows vs linux issues

孤街浪徒 提交于 2019-12-11 11:00:07

问题


I'm a newbie at this stuff, but I'm trying to port a Windows app over to Linux and encountered issues with the xmlbeans. We have a handful of xsd files generating class files. On Windows, I'll get Driver.class(2k) and Driver2.class(10k). On Linux, the same build through Maven I'll get Driver.class(10k) and Driver2.class(2k). So there appears to be an ordering issue which causes the Linux build application using these classes to not compile. The java code using Driver/Driver errors out with incompatible types:

found : xx.xmlbinding.Driver2 required: xx.xmlbinding.Driver

Different xsd files have the same complexType in the file:

<xsd:complexType name="Driver">

Any insight on how I can resolve this? Thanks!


回答1:


Why do you have two Driver types with the same namespace and name?

If the 'Driver' type is the same type and is duplicated in the two schemas, move Driver to a separate schema and use <import>. If the two schemas and Driver types are indeed different, move one to a different namespace or give it a different name. If that isn't possible compile the two schemas in separate steps -- you'll then need to load them in separate classloaders to avoid collisions at runtime.



来源:https://stackoverflow.com/questions/10908604/xmlbeans-how-to-control-generated-class-files-windows-vs-linux-issues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!