background image

Using a Binding Declarations File

<< Looking at the Conflicts | Resolving the Conflicts >>
<< Looking at the Conflicts | Resolving the Conflicts >>
62
U
SING
JAXB
The error messages returned here are:
[xjc] [ERROR] A property with the same name "Zip" is
generated from more than one schema component.
[xjc] line 22 of example.xsd
[xjc] [ERROR] (Relevant to above error) another one is
generated from this schema component.
[xjc] line 20 of example.xsd
Output From Running the ant Task Without
Using a Binding Declarations File
Here is the output that is returned if you run the
ant
task in the
<INSTALL>/
examples/jaxb/fix-collides
directory without specifying the
binding
parameter to the
xjc
task in the
build.xml
file:
[echo] Compiling the schema w/o external binding file
(name collision errors expected)...
[xjc] Compiling file:/C:/javaeetutorial5/examples/jaxb/
fix-collides/example.xsd
[xjc] [ERROR] Attempt to create a property having the same
name as the reserved word "Class".
[xjc] line 14 of example.xsd
[xjc] [ERROR] A property with the same name "Zip" is
generated from more than one schema component.
[xjc] line 17 of example.xsd
[xjc] [ERROR] (Relevant to above error) another one is
generated from this schema component.
[xjc] line 15 of example.xsd
[xjc] [ERROR] A class/interface with the same name
"generated.FooBar" is already in use.
[xjc] line 9 of example.xsd
[xjc] [ERROR] (Relevant to above error) another one is
generated from here.
[xjc] line 18 of example.xsd
The binding.xjb Declarations File
The
<INSTALL>/examples/jaxb/fix-collides/binding.xjb
binding declara-
tions file resolves the conflicts in
examples.xsd
by means of several customiza-
tions.