dev@jaxb.java.net

bug in JAXB 2.0.5 when XJC ant task tries to apply bindings from external file.

From: Chad Lyon <clyon_at_gestalt-llc.com>
Date: Mon, 17 Sep 2007 08:59:39 -0400

If you have spaces in the path to your schema file when specifying an
external binding file for the XJC ant task the internalizer gets
confused when looking up a key that has %20 replaced for the spaces.

 

On winXP and JAXB 2.0.5 put a schema file and a binding file on your
desktop and then use an ant target like this:

 

<xjc schema="${basedir}/test.xsd" removeOldOutput="yes"
destdir="${basedir}/test" package="test"
binding="${basedir}/bindings.xml"/>

 

Make the schemaLocation in the binding file just "test.xsd"

 

You will get something similar to this:

 

[xjc] [ERROR] "file:/C:/Documents and Settings/clyon/Desktop/test.xsd"
is not a part of this compilation. Is this a mistake for
"file:/C:/Documents%20and%20Settings/clyon/Desktop/test.xsd"?

[xjc] line 5 of
file:/C:/Documents%20and%20Settings/clyon/Desktop/bindings.xml

 

I searched for this bug in the bug tracker and couldn't find it. This
problem does not exist in 2.1

 

I am attaching a patch that fixes the problem, If this is the wrong way
to submit a patch I am sorry, will someone point me to where I can read
the proper protocol?

 

Chad Lyon

Software Development Consultant

Gestalt LLC