Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij generate java code with JAXB returns xsd file

I'm new to java and i'm facing a problem

I'm trying to generate java code based on xsd files (this worked fine with my xsd files and WSCF.blue in my .net project). In Intellij I'm using "Generate java code from xml schema using jaxb"

Here are the settings that I use:

enter image description here

When I look in my QueryEngine.Contracts folder, it has just copied the xsd file:

enter image description here

Does anyone have any suggestions as to why this is ?

like image 829
Christian A Avatar asked Jun 28 '18 07:06

Christian A


People also ask

How do I generate Java classes from XSD using JAXB maven?

Just build the maven project using mvn clean install and you will see java classes generated in target/generated-sources/jaxb directory.

How do I open an XSD file in Intellij?

Press Ctrl+Alt+S to open the IDE settings and select Languages & Frameworks | Schemas and DTDs | Default XML Schemas. Under XML Schema version, choose the XSD (XML Schema Definition) Schema to validate XML files.

What is XSD file in Java?

xsd is the XML schema you will use as input to the JAXB binding compiler, and from which schema-derived JAXB Java classes will be generated. For the Customize Inline and Datatype Converter examples, this file contains inline binding customizations.


1 Answers

I found out why. In one of my xsd files, there are some errors, that the commandprompt says the following about: "Cannot resolve the name 'tns:LandsejerlavNavn' to a(n) 'element declaration' compontent.

I have three of those errors. If i remove the three lines that gives this error, it works

I wonder why I get that error, when WSCF.blue in my .net project can create .cs files just fine.

like image 126
Christian A Avatar answered Oct 01 '22 16:10

Christian A