• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB : Java complilation error after XJC Compilation

 
Ismail Abrams
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ismail Abrams
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i mean compilation errors. the generated classes must be compilated all right.is there any way to customize it ?
thanks
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ismail Abrams
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.

 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic