xjc

java.lang.ClassNotFoundException: com.sun.codemodel.CodeWriter with JDK9

时间秒杀一切 提交于 2019-12-01 20:32:40
[WARNING] The POM for org.glassfish.jaxb:jaxb-runtime:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.glassfish.jaxb:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] Error injecting: org.jvnet.mjiip.v_2.XJC2Mojo java.lang.NoClassDefFoundError: com/sun/codemodel/CodeWriter at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3110)

JAXB - The schemaBindings customization is not associated with any schema element

只谈情不闲聊 提交于 2019-12-01 17:21:00
I'm trying to generated Java classes from a set of XSD files using the Maven XJC plugin with a custom binding. The customization is added to prefix JAXB generated classes . When the maven build runs, however, the XJC plugin doesn't seem to recognize the schemaBindings element and throws the exception as under. [ERROR] Error while parsing schema(s).Location [ file:/C:/blah/bindings.xjb{5,25}]. com.sun.istack.SAXParseException2: The "jaxb:schemaBindings" customization is no t associated with any schema element. at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Intern alizer.java

JAXB - The schemaBindings customization is not associated with any schema element

早过忘川 提交于 2019-12-01 16:27:17
问题 I'm trying to generated Java classes from a set of XSD files using the Maven XJC plugin with a custom binding. The customization is added to prefix JAXB generated classes. When the maven build runs, however, the XJC plugin doesn't seem to recognize the schemaBindings element and throws the exception as under. [ERROR] Error while parsing schema(s).Location [ file:/C:/blah/bindings.xjb{5,25}]. com.sun.istack.SAXParseException2: The "jaxb:schemaBindings" customization is no t associated with any

Suppress compiler warnings on JAXB generated classes

我的未来我决定 提交于 2019-12-01 15:59:39
This is possibly a duplicate of this question ( Avoiding Compiler warnings on code generated by xjc ) but since I am not very well versed in XJC/JAXB custom bindings idiosyncrasies, I'll presume I may have misunderstood the mentioned question. My question seems simple enough - how can I add @SuppressWarnings("all") annotation to generated JAXB class? We have 0 warning policy on our project and after JAXB generation step, we end up with 350+ warnings which are just terrible noise. I would expect either a simple flag on the XJC or at least an easy way to provide such info but I cannot find any.

Suppress compiler warnings on JAXB generated classes

可紊 提交于 2019-12-01 14:57:38
问题 This is possibly a duplicate of this question (Avoiding Compiler warnings on code generated by xjc) but since I am not very well versed in XJC/JAXB custom bindings idiosyncrasies, I'll presume I may have misunderstood the mentioned question. My question seems simple enough - how can I add @SuppressWarnings("all") annotation to generated JAXB class? We have 0 warning policy on our project and after JAXB generation step, we end up with 350+ warnings which are just terrible noise. I would expect

What might cause “JAXBElement Does not have a no-arg default constructor”?

≯℡__Kan透↙ 提交于 2019-12-01 06:30:55
问题 I'm generating a jar which is to be dropped into a commercial software product. That jar conforms to the commercial software's api and depends on a second jar, which contains (among other things) a set of POJOs generated from an XSD. However, it fails when trying to instantiate JAXBContext when I drop it in. I get: "1 counts of IllegalAnnotationExceptions" javax.xml.bind.JAXBElement does not have a no-arg default constructor. this problem is related to the following location: at javax.xml

JAXB marshalling for BigDecimal using fractionDigits

馋奶兔 提交于 2019-12-01 04:47:18
So here's my problem. I'm given an XSD to which my generated XML file should comply. Using the org.apache.cxf.cxf-xjc-plugin maven plugin and an external binding file I generate the source code. But when I'm trying marshall my object the generated XML doesn't meet my requirements. My XSD contains the following: <xsd:element maxOccurs="1" minOccurs="0" name="amount"> <xsd:simpleType> <xsd:restriction base="xsd:decimal"> <xsd:totalDigits value="13" /> <xsd:fractionDigits value="2" /> </xsd:restriction> </xsd:simpleType> </xsd:element> ... <xsd:element maxOccurs="1" minOccurs="0" name="rate">

how to make cxf-xjc-plugin generate sources in utf-8

大兔子大兔子 提交于 2019-12-01 04:03:27
I try to generate java classes from xsd in a maven project using cxf-xjc-plugin. It runs fine, but the generated source files get platform specific encoding (cp1251 on a windows pc) instead of utf-8. If any xsd types contain non-latin characters in schema annotations, then they become readable only in that specific encoding and the compiler later complains with [WARNING] /C:/.../SomeType.java:[17,4] unmappable character for encoding UTF-8 . Please help me force utf-8 for sources generation. The source encoding is set with <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> The

JAXB marshalling for BigDecimal using fractionDigits

荒凉一梦 提交于 2019-12-01 02:43:50
问题 So here's my problem. I'm given an XSD to which my generated XML file should comply. Using the org.apache.cxf.cxf-xjc-plugin maven plugin and an external binding file I generate the source code. But when I'm trying marshall my object the generated XML doesn't meet my requirements. My XSD contains the following: <xsd:element maxOccurs="1" minOccurs="0" name="amount"> <xsd:simpleType> <xsd:restriction base="xsd:decimal"> <xsd:totalDigits value="13" /> <xsd:fractionDigits value="2" /> </xsd

maven-jaxb2-plugin reusing commons XSD within same project

﹥>﹥吖頭↗ 提交于 2019-11-30 15:25:40
I have a project which has a schema A and B, both within the same namespace. Both import schema C which also uses the same namespace. How can I generate JAXB classes for A and B to separate packages, while reusing the JAXB classes from C generated to a commons package? I already know I should probably be using episodes and use the episode generated for schema C as bindings file for the separate executions of schema's A and B. Problem is I don't know how to refer to this generated episode file. Here's an example: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin<