Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8675777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:01:46+00:00 2026-06-12T20:01:46+00:00

The following JAXB bindings file creates the Adapter classes as expected, but Eclipse and

  • 0

The following JAXB bindings file creates the Adapter classes as expected, but Eclipse and XMLSpy say it’s no valid:

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


        <jxb:globalBindings>
            <jxb:javaType name="java.util.Calendar" xmlType="xs:date" parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
                printMethod="javax.xml.bind.DatatypeConverter.printDate" />
            <jxb:javaType name="java.util.Calendar" xmlType="xs:dateTime" parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
                printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />
            <jxb:javaType name="java.util.Calendar" xmlType="xs:time" parseMethod="javax.xml.bind.DatatypeConverter.parseTime"
                printMethod="javax.xml.bind.DatatypeConverter.printTime" />
        </jxb:globalBindings>

</jxb:bindings>

The error is something like:

cvc-complex-type.2.4.b: The content of element 'jxb:globalBindings' is not complete. One of '{"http://java.sun.com/xml/ns/jaxb":javaType, "http://java.sun.com/xml/ns/jaxb":serializable, WC[##other:"http://java.sun.com/xml/ns/jaxb"]}' is expected.

Note that the JAXB bindings schema file references top-level elements using the prefix “jaxb”.

How can I create a valid JAXB bindings file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:01:47+00:00Added an answer on June 12, 2026 at 8:01 pm

    http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd is wrong, but no one can do anything about it 🙁

    The problem is in the definition of globalBindings global element. It looks like this:

      <xs:element name="globalBindings">
        <xs:annotation>
          <xs:documentation>Customization values defined in global scope.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence minOccurs="0">
            <xs:element ref="jaxb:javaType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element ref="jaxb:serializable" minOccurs="0" />
            <xs:any namespace="##other" processContents="lax">
              <xs:annotation>
                <xs:documentation>allows extension binding declarations to be specified.</xs:documentation>
              </xs:annotation>
            </xs:any>
          </xs:sequence>
          ...
        </xs:complexType>
    

    But it should look like this:

      <xs:element name="globalBindings">
        <xs:annotation>
          <xs:documentation>Customization values defined in global scope.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence minOccurs="0">
            <xs:element ref="jaxb:javaType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element ref="jaxb:serializable" minOccurs="0" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>allows extension binding declarations to be specified.</xs:documentation>
              </xs:annotation>
            </xs:any>
          </xs:sequence>
          ...
        </xs:complexType>
    

    Mind the minOccurs="0" maxOccurs="unbounded" on <xs:any /> element.

    So the official version forces you to use other (than JAXB’s) element insinde globalBindings. You can look at [http://jaxb.java.net/nonav/2.0/binding-customization/http.java.sun.com.xml.1306680588/index.html%5D(http://java.sun.com/xml/ns/jaxb/xjc namespace) which contains Sun’s extensions to JAXB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jaxb custom bindings file in eclipse (named binding.xjb) and while it
I have to generate the following xml in my program using JAXB. <?xml version=1.0
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
I need to learn fairly quickly the following Java related technologies: XML(JAXP, JAXB) Web
For any bad XML, by default the Jersey - JaxB throws the following: Method
I put a jaxb.properties file in the package where my classes are where I
I have defined my bindings in the following way <jaxb:bindings node=xs:complexType[@name='Parent']> ........... <jaxb:bindings node=xs:element[@name='children']>
Let's say I have the following two classes: package example.model; public class Model {
The goal is to produce the following XML with JAXB <foo> <bar>string data</bar> <bar>binary
How can I generate XML with the following schema using JAXB. <NS1:getRatesResponse xmlns:NS1="http://mynamespaceTypes"> <response>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.