2

My issue is a lot like this one but with a few small differences that make me completely at a loss.

I'm trying to compile some java classes using xjc with an xsd with an xjb customization to bind jaxb:Date to java date. It worked fine when I ran it from command line but I'm trying to incorporate it into an ant script now and I"m getting an error:

[ERROR] The "jaxb:globalBindings" customization is not associated with any schema element.

here is my xjb:

<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"    xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings>
      <jaxb:javaType   name="java.util.Date"
    xmlType="xs:dateTime"
    parseMethod="sel.date.XsdDateTimeConverter.unmarshal"
    printMethod="sel.date.XsdDateTimeConverter.marshalDateTime"        
      /><jaxb:javaType 
    name="java.util.Date"
    xmlType="xs:date"
    parseMethod="sel.date.XsdDateTimeConverter.unmarshal"
    printMethod="sel.date.XsdDateTimeConverter.marshalDate"
    />
</jaxb:globalBindings>
</jaxb:bindings>

I'm not using maven so I can't really use the answer listed above. Also it seems like that one needs to know of the schema that's going to incorporate it but I don't really want to do that because I'm trying to make this a general script I can use for different xsd's.

anyone have any ideas on what I'm missing here?

Community
  • 1
  • 1
user940769
  • 53
  • 2
  • 9

2 Answers2

0

Try to change jaxb:version="2.0" to jaxb:version="2.1".

Of course it depends on your jaxb generator.

CouchDeveloper
  • 18,174
  • 3
  • 45
  • 67
Stanislav
  • 9
  • 2
0

This may be due to a older version of jaxb and xjc. I encountered this error when running the maven-jaxb-plugin 1.1, upping the version of the plugin resolved the issue.

Grant
  • 258
  • 2
  • 8