Forums Register Login

JAXB : Java complilation error after XJC Compilation

+Pie Number of slices to send: Send
I find a problem during JAVA compiling of classes generated by XJC compiler.

This is the xsd bloc causing the problem of java compilation. there is two elements with the same name (sousAdresse) but they have a different content.



**
XJC compiler generates the class SousAdresse.java wich contain :
- protected List<Contact> contacts;
- internal class : public static class Acces, in with we find the internal class -> public static class SousAdresse
**

the solution mustn't impact the containt of the schema file.is There any configuration in the Binding file that i can do to resolve the problem ?
I need your help.
+Pie Number of slices to send: Send
 

There any configuration in the Binding file that i can do to resolve the problem ?


But what you have described seems to be a description of the default behaviour of the compiling... However, you said "problem" and "resolving". Do you mean there are compilation errors (that I tend to think it should be compiled all right), or that you mean you only do not like the structure generated and want to customize it further to your liking?
+Pie Number of slices to send: Send
Yes, i mean compilation errors. the generated classes must be compilated all right.is there any way to customize it ?
thanks
+Pie Number of slices to send: Send
If there is compilation error, what is it?

In any case, a simple question: is the definition shown xs:element name="sousAdresse" appeared in the schema as a top-level element? If not what is its parent element looks like? I would say it can't appear as a top-level element for a reason and I hope it is not.
+Pie Number of slices to send: Send


This is the full schema, if the schema is compiled with jaxb compiler, the generated class SousAdresse will be declared twice. That's the error.

+Pie Number of slices to send: Send
That would compile just fine for jaxb ri 2.1+, if not lower as well. The issue of collision of names does not arise in this situation.
Let's go to the waterfront with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1367 times.
Similar Threads
XML schema fails to load
Axis2 POJO web service - wsdl generating xs:anyType
[JAXB] Not able to generate IMPL file using xjc
Automatically gen. code from WSDL results in XML with same tag for array and array elements
converting xsd to html
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:28:48.