javaxmljaxbxjc

What's the current URL for JAXB Bindings XML Schema?


I'm trying to automate the generation of Java classes from XML DTD using xjc. The generated Java classes must be serializable. The articles that help with that add a pointer to a bindings file that uses the schema at http://java.sun.com/xml/ns/jaxb for the JAXB namespace, but that URL doesn't work anymore.

The URL http://java.sun.com/xml/ns/jaxb redirects to http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/jaxb/index.html which in turn says that http://java.sun.com/xml/ns/jaxb is the latest URL but links to http://www.oracle.com/xml/ns/jaxb/ that also redirects to http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/jaxb/index.html.

A bit confusing.

I've found tutorials at Oracle updated in 2014 that still use that URL, and I didn't find any other. Does anyone have a more up to date info?


Solution

  • This works for me:

    <?xml version="1.0" encoding="UTF-8"?>
    <jaxb:bindings xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:jaxb='http://java.sun.com/xml/ns/jaxb' version='2.1'
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/jaxb/bindingschema_2_0.xsd">
    
    </jaxb:bindings>