Questions tagged [maven-jaxb2-plugin]
This Maven 2 plugin wraps the JAXB 2.x XJC compiler and provides the capability to generate java sources from schemas.
333
questions
0
votes
1
answer
70
views
Text field missing with XJC jaxb2-maven-plugin while generating HL7 CDA2 mixed complex types
I'm facing a bad error when generating JAXB classes for parsing HL7 CDA2 documents (here is the complete xsd definition): the complex type ANY is generated without a String field annotaded as @...
0
votes
1
answer
32
views
Jaxb2 generate classes with @XMLRootElement tag
I am using Jaxb2 plugin to generate JAVA class files from XSD files
Here is my plugin config
<plugin>
<groupId>org.codehaus.mojo</groupId>
<...
-1
votes
0
answers
22
views
JAXB Class Generation Type Mismatching
I am creating a SOAP Service and I have a problem that I cannot find both the reason and the solution.
This is a Request in my .xsd file you see below. As you can see, some initials are deliberately ...
0
votes
1
answer
48
views
How can I add a suffix to my jaxb generated java beans using jaxb2-maven-plugin
From I third party I imported xsd's and a wsdl as contracts for their services. I am generating the beans with the maven-jaxb2-plugin . Because of naming collisions in my project I want to add ...
0
votes
1
answer
212
views
Using the JAXB2 Simplify Plugin together with Java 17 and jaxb2-maven-plugin of codehaus
Starting of with a project that has jaxb2-maven-plugin and the Highsource jaxb2-basics plugin for the Maven-plugin jaxb2-maven-plugin I was able to use the Highsource "JAXB2 Simplify Plugin"....
0
votes
1
answer
38
views
Unable to generate XML using JAXB marshaller for nested Objects from different packages
**XSD1**
<xs:complexType name="Root1">
<xs:sequence>
<xs:element name="Revision" type="xs:string" />
<xs:element ...
0
votes
2
answers
39
views
JaxB Marshalling of a Key, Value Pair, where Value can be another Key, Value pair
I have this Object, as a node of a complex Object:
public class Parameter implements Serializable
{
@XmlElement(name = "Key")
protected String key;
@XmlElement(name = "Value")
...
0
votes
1
answer
120
views
hisrc-basicjaxb (org.patrodyne.jvnet) vs jaxb-tools (org.jvnet.jaxb)
Some time ago the project maven-jaxb2-plugin was orphaned because Alexey Valikov sadly passed away. Thankfully, Rick O'Sullivan stepped into the breach a short time later and did a great job with ...
0
votes
0
answers
19
views
Let xjc NOT use inheritance for XSD inheritance
I have this XSD/WSDL:
<xs:complexType name="SupplierArticle">
<xs:complexContent>
<xs:extension base="Article">
<xs:attribute name=&...
-1
votes
2
answers
108
views
Maven and XSD [ERROR] Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate (default): Unable to parse input schema(s)
I am working on an application which had many maxOccurs="unbounded" in the XSD files like
<xs:element name="bar" maxOccurs="unbounded" />
and
<xsd:choice ...
0
votes
1
answer
40
views
Pbm marshaling XML with classes generated via JAXB2
today is one day I think I'll become crazy.
I would like to generate some code to be able to mashshall/unmarshall XML files.
I'm starting with an XSD that I pass to JAXB2 to generate Java classes via ...
0
votes
0
answers
61
views
JAXB2 - XJC - Problem with XmlElement.type on generated class
TLDR: I have to generate Java classes from an XSD, and one of the fields of the "Main" object is another generated class. The field has an annotation @XmlElement, which has a property "...
0
votes
1
answer
261
views
Not able to generate java stubs from .wsdl files using jaxb-runtime 4.0.3 and maven-jaxb2-plugin 0.15.3
I am using Java 17. It works fine if I use jaxb-runtime 2.3.3 and maven-jaxb2-plugin 0.14.0. I need to upgrade to jaxb-runtime 4.0.3. In .xjb I have replaced all javax.xml.bind.annotation....
0
votes
1
answer
35
views
Cannot generate VMAP classes from xsd
I started a project on github using maven-jaxb2-plugin to generate VMAP classes from the vmap xsd.
The problem I am running into appears to be an issue with the xsd itself.
[ERROR] Error while parsing ...
2
votes
3
answers
630
views
Is there a way to generate value constructors when creating Java code using jakarta dependencies in JAXB?
I'm migrating my JAXB code from the javax.* to the jakarta.* dependencies. Until now I used the following maven plugin to generate the Java code.
<plugin>
<groupId>org.jvnet.jaxb2.maven2&...
2
votes
1
answer
101
views
How to add custom String to List<String> jaxb xml adapter to an xsd generated class attribute
We have been using jaxb for a long time to unmarshal XML into POJOs that we can use within our system. However, only recently I found an issue with how jaxb is parsing the xml provided data and I ...
1
vote
0
answers
606
views
unable to marshal type <CLASSNAME> as an element because it is missing an @XmlRootElement annotation
NOT A DUPLICATE BECAUSE I have tried many solutions from the stackoverflow like adding the @XmlRootElement(name="Generic")
And also tried wrapping the request and response objects in javax....
1
vote
2
answers
619
views
maven-jaxb2-plugin plugin giving Error "javax-xml-bind-annotation does not exist" in Spring Boot -3
I am trying to create a spring boot 3 soap consumer middleware. I have used spring-boot-starter-web-services dependency and maven-jaxb2-plugin to generate STUB class from a WSDL file. But whenever I ...
0
votes
1
answer
5k
views
jaxb2 Maven Plugin Fails to generate Java Packages with correct Imports or throws errors
I'm currently using the Maven jaxb2 plugin to generate POJOs from my XSDs. I have a few issues so far.
I have 1 parent XSD that imports another XSD that in turn imports 2 other XSDs.
a.xsd -> b.xsd ...
1
vote
1
answer
51
views
maven-jaxb2-plugin namespace issue while generating pojos
"I am using the maven-jaxb2-plugin in a Java Maven project to generate POJOs from XSD files. Im using a xjb file for namespaces and stuff, but sometimes on of the namespaces is not resolved. Is ...
0
votes
1
answer
54
views
jaxb problem, error message when compiling
When I compile my code I have an error because of jaxb2.
the error message:
Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (xjc) on project commandecartes: can't parse argument ...
0
votes
1
answer
312
views
Can't extends base schema in maven-jaxb2-plugin in a secondary project
I'm not able to extends an xsd schema from another project.
I've a basemodel.xsd in a jar project (ModelBase:jar), which also contains generated classes via maven-jaxb2-plugin.
I'm trying to extends ...
0
votes
1
answer
165
views
Generate both beans and META-INF in the same folder jaxb2-maven-plugin 2.3
I'm using jaxb2-maven-plugin version 2.3 to generate jaxb java beans.
It works well and generate the beans as expected under src/main/java/x/y/z.
A META-INF/sun-jaxb.episode file is created under src/...
0
votes
0
answers
35
views
Unmarshalling Error: unexpected element (uri:"http://ws.info.ss/xml/SVV/Data/2021-02-15/Data.xsd", local:"data"). Expected elements are <{}data>
When making a soap call I get an Unmarshalling error. And I am not sure what is causing it. I am using a WSDL that is provided by the organization.
Unmarshalling Error: unexpected element (uri:"...
0
votes
1
answer
86
views
maven-jaxb2-plugin generates uncompilable code when using episode from org.jvnet.ogc/gml-v_3_2_1
I am trying to generate JAXB classes for the AIXM XSDs, which unfortunately are quite complicated and reference the even more complicated OGC GML 3.2.1, xlink and ISO 19139 schemas. I would like this ...
0
votes
1
answer
83
views
jaxb2 generated class from main xsd and common xsd has different namespaces
I have 2 xsd schemas from which Im generating a class Message using maven-jaxb2-plugin. The main xsd is message.xsd and it imports common.xsd which holds some common types. However both have different ...
10
votes
2
answers
9k
views
Java Code generation from XSD/WSDL for Jakarta 4.0.0 using Maven Plugin
I have wasted mutiple days trying to figure it out, how can something that seems pretty straightforward (generating code from a WSDL/XSD) be so extremly complicated. Are there any approaches? I feel I ...
0
votes
1
answer
450
views
JAXB how to get QName based on java object
We are using maven plugin to generate a large number of Java pojos and ObjectFactory, similar to:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ProtectedABC", propOrder = {
&...
1
vote
1
answer
97
views
How to force Jaxb to use restriction types
for the following mapping
<xs:complexType name="ParentNode">
<xs:sequence>
<xs:element name="child" type="ChildNode"/>
</...
0
votes
1
answer
303
views
xsd conflict when using jaxb2-maven-plugin
I'm trying to revive a legacy project for my client. The project is pretty old and it uses the jaxb2-maven-plugin to generate some java classes from an xsd schema file.
<plugin>
<...
2
votes
1
answer
2k
views
JAXB SAXParseException after migrating from Java8 to Java11
I'm upgrading a Spring Boot 2.7.0 project from Java 8 to Java 11.
The project is using maven-jaxb2-plugin to generate classes from wsdl files.
This is the configuration
<groupId>org....
2
votes
1
answer
153
views
isSet methods not generated using jaxb2-basics simplify plugin
I have a schema with two elements within a <xs:choice/> block, as per the following fragment:
<xs:complexType name="POCD_MT000040.Component2">
<xs:sequence>
<...
3
votes
0
answers
364
views
How to generate Java classes from RELAX NG schema
I was trying to implement automatic marshalling and unmarshalling for OPDS directories in Java. I've tried to use Trang to generate .xsd files and then generate Java classes using JAXB2 maven plugin, ...
1
vote
1
answer
1k
views
Dealing with duplicate classes with multiple maven-jaxb2-plugin executions using different schemas with the same base schema
I'm currently using maven-jaxb2-plugin v0.13.3.
The plugin config has multiple executions, each processing wsdl files. Several of them are completely independent, but several are simply different ...
25
votes
5
answers
35k
views
java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
I am trying to update my SpringBoot maven project to Java 17.
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
I had working ...
0
votes
0
answers
364
views
Missing @XMLElement(required = true) annotation in XML schema Java generated class
I do have the following XML schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
...
0
votes
1
answer
391
views
StaleFile element not allowed with jaxb2 version 2
I'm upgrading our jaxb2-maven-plugin from version 1.5 to 2.5. After changing the schemaDirectory and schemaFiles to use the source tags it builds and works as before.
However the staleFile tag is ...
0
votes
1
answer
730
views
How to advise maven-jaxb2-plugin to use same class in two places?
I'm using maven-jaxb2-plugin to generate JAXB classes. I have no control over the WSDL or XSD.
The XSD specifies either a single "MyObject", or a parent object containing a list of "...
0
votes
0
answers
1k
views
Generating code from yaml - more reliable than Swagger codegen?
(Sample) Problem:
When a yaml source contains conflicting definitions, e.g. myClass and MyClass both generating into a java class MyClass with one overwriting the other, no warning or error occurs.
...
0
votes
1
answer
861
views
JAXB: two xsd with two complextype with the same name
This is my first xsd (catalegs-schema.xsd):
<?xml version="1.0" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"&...
1
vote
0
answers
907
views
org.xml.sax.SAXParseException: 'GovernmentIDType' is already defined
I a trying to generate Java classes from XSDs provided by third party. However I am getting the error as
[ERROR]
file:/Users/sanket/eblock/code/eblock-graphql/eblock-integration/autotec-auction-...
0
votes
1
answer
491
views
Is there a way to pass Class as a Parameter to the JAXB XMLAdapter or access Getter method from another class
I am trying to create an XMLAdapter class for one of my objects. I need to access Getters from another class so that some of the objects can be populated from that class's Getters` but I am unable to ...
0
votes
1
answer
691
views
JAXB XMLAdapter: Is there a way to convert this method into JAXB XmlAdapter
I have a JSON file that I am trying to convert into XML using the JAXB annotation approach. Everything is working fine now and I able to convert the JSON to XML. Now I am trying to refactor the code a ...
0
votes
2
answers
897
views
Java JAXB Marshalling the elements to the objects in inner class
I trying to use the JAXB annotation to convert the JSON data to XML. I have the JSON somewhat like this:
{
"Employee": {
"name": "Tanmay",
"Email&...
0
votes
1
answer
134
views
jaxb2: Ignores annotation
This is my maven-jaxb2-plugin configuration:
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-...
2
votes
1
answer
692
views
SoapFaultClientException : Failed to find header
A SOAP Web-service, which accepts request in following format -
<?xml version = "1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
...
9
votes
1
answer
4k
views
Migration from maven-jaxb2-plugin 0.14.0 to jaxb2-maven-plugin 2.5.0
Sharing my experience about migrating from
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0&...
0
votes
1
answer
675
views
maven jaxb2 plugin is generating nothing
It's not clear to me if I'm able to use maven-jaxb2-plugin on a jdk11 maven project.
My pom.xml and mvn are using jdk11.
I know jaxb is not distributed with jdk 11.
I'm trying to generate code from ...
0
votes
0
answers
2k
views
What xml parsing library to use in Spring boot?
I am building a spring boot application which accepts xml as input and produces xml as output. I can't use the spring boot default xml converter for parsing the input. I use jaxb library to parse them....
3
votes
1
answer
3k
views
Auto name resolution for jaxb plugin
Is there anyway to do auto name resolution here. I don't want static classes hence using the bindings. but I am getting errors when generating pojo
[ERROR] file:/C:/Projects/custom-mapping/transformer/...