• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXB : Java complilation error after XJC Compilation

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic