Everytime the JAXB object model is generated from the schema... it generates the "package-info.java" class, sometimes it generates the annotation for the default namespace...but sometimes it doesn't (dependent on the schema)
Adding the following annotation just above the package declaration gives us the default namespace attribute in the XML.
We can generate namespace information using @XmlSchema annotation. It is a package level annotation which should be used in a special file called as "package-info.java". Shown below is how you can use it:
To generate the schema location information we can use the JAXB marshaller's JAXB_SCHEMA_LOCATION property as shown below:
For detailed information and working examples follow the link: