This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark ""Unsupported binding namespace "".  Jaxb with ANT and external binding schema" Watch ""Unsupported binding namespace "".  Jaxb with ANT and external binding schema" New topic
Author

"Unsupported binding namespace "". Jaxb with ANT and external binding schema

Bogdan Baraila
Ranch Hand

Joined: May 23, 2011
Posts: 43
Hello and thank you for reading this.

I'm trying to use an external binding schema but i keep getting this error: "Unsupported binding namespace "". Perhaps you meant "http://java.sun.com/xml/ns/jaxb/xjc"?" at line 2 of my schema:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element.....

My jaxb binding file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.1" jxb:extensionBindingPrefixes="xs">
<jxb:bindings schemaLocation="../src/ro/crispico/tethys/jaxb/schema/Mareva.xsd" node="/xs:schema">
<jxb:bindings node=".//xs:element[@name='time']">
<baseType>
<jxb:javaType name="java.lang.String"/>
</baseType>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>

I've also tried without the extensionbindingprefixes or with xjc namespace or any other namespaces configuration. Without the binding the generation works ok.

I've verified every similar error that i could find on google but i wasn't able to find the problem. I'm now using the 2.2.4 version of jaxb. In the past i was using jaxb 1 and the generation was working properly. I'm using xjc with ant. Thanks a lot!
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 500
    
    3
[1] I think the error is probably alluding to the baseType
<baseType>
<jxb:javaType name="java.lang.String"/>
</baseType>

jxb:bindings allows extension, but, the alient/extension element must be namespace qualified.

[1.1] You should take out xs as jxb:extensionBindingPrefixes value. Take the whole attribute out.
jxb:extensionBindingPrefixes="xs"

[2] Try this instead this.
Bogdan Baraila
Ranch Hand

Joined: May 23, 2011
Posts: 43
Thanks a lot. I don't know how i've missed the jxb in the baseType tag.
It also works like this:
<jxb:bindings node=".//xs:element[@name='time']">
<jxb:baseType>
<jxb:javaType name="java.lang.String"/>
</jxb:baseType>
</jxb:bindings>

Any advantage in using [2] ?
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 500
    
    3
>Any advantage in using [2] ?
As far as I'm concerned, it is a valid construction in compliance with the jaxb 2 binding schema.

The jxb:baseType should be a child of jxb:property. On the spec, it shouldn't be directly under jxb:bindings.
As to the content model of jxb:baseType, both kinds of rendering should be equally fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Unsupported binding namespace "". Jaxb with ANT and external binding schema
 
Similar Threads
Top-Down approach: WSDL, JAX-WS and JAXB
JAXB - how to support extension via import
how to convert XMLGregorianCalendar datatype to java.util.Calendar datatype in JAX-W
JAXB XJC compiling Issue
XJC generator