JAXB Unmarshall error
===

I'm using JAXB on my project, but from time to time, I face some problems that I can't solve. For example, I have setup my environment like this:

Armor Class

    package com.fortresswars.entity.component;

    @XmlType(name = "armor", namespace = "http://fortresswars.com")
    public class ArmorComponent extends AbstractComponent

package-info.java

    @XmlSchema(xmlns = @XmlNs(namespaceURI = "http://fortresswars.com", prefix = "fw"), elementFormDefault = XmlNsForm.UNQUALIFIED, namespace = "http://fortresswars.com")
    package com.fortresswars.entity.component;


The generated schema header is almost correct:

    <xs:schema elementFormDefault="unqualified" version="1.0" targetNamespace="http://fortresswars.com" xmlns:fw="http://fortresswars.com" xmlns:tns="http://fortresswars.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">

The only thing I didn't like is that TNS prefix that JAXB puts there and I can't remove. I'm using AntTask, and I remember reading somewhere that this was the problem.



Here's the relevant part about armor

    <xs:complexType name="armor">
        <xs:complexContent>
          <xs:extension base="tns:abstractComponent">
            <xs:sequence>
              <xs:element name="value" type="xs:short" minOccurs="0"/>
              <xs:element name="type" type="tns:armor-type" minOccurs="0"/>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>


And someone using the armor component:

      <xs:complexType name="character">
        <xs:complexContent>
          <xs:extension base="tns:thing">
            <xs:sequence>
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="armor" type="tns:armor"/>
                <xs:element name="model" type="tns:model"/>
                <xs:element name="status" type="tns:status"/>
                <xs:element name="costs" type="tns:costs"/>
              </xs:choice>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>

To test this, I created a XML Document

    <?xml version="1.0" encoding="UTF-8"?><tns:character xmlns:tns="http://fortresswars.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="/home/shirkit/jMonkeyProjects/Fortress Wars/Core/schema/full.xsd">
    
    <armor>
    <value>5</value>
    <type>NORMAL</type>
    </armor>
    
    </tns:character>

But when I'm unmarshalling this document, here's what I get:

    unexpected element (uri:"", local:"armor"). Expected elements are <{http://fortresswars.com}armor>,<{http://fortresswars.com}attacks>,<{http://fortresswars.com}costs>,<{http://fortresswars.com}model>,<{http://fortresswars.com}abilities>,<{http://fortresswars.com}status>,<{http://fortresswars.com}movement>

I have setup elementFormDefault to UNQUALIFIED, and even though this doesn't work. Why I'm getting this exception? And can I remove TNS prefix from the generated schema?