users@jaxb.java.net

Inheritance seems broken

From: Brian Pontarelli <brian_at_pontarelli.com>
Date: Fri, 15 Apr 2005 19:29:30 -0500

I just pulled down the latest JAXB 2.0 EA release and started converting
my classes to use it. Classes that were previously working are not
longer working for some reason.

I have two classes:

public class Response {
  private Status status;
}

@XmlType(name = "", propOrder = {"status", "data"})
public class AuthenticationResponse extends Response {
  private Data data;
}

My XSD is something like this (I coded these classes by hand, so the XSD
isn't really used, but still important):

  <xsd:element name="authenticateResponse">
    <xsd:complexType mixed="false">
      <xsd:sequence>
        <xsd:element name="status" type="status"/>
        <xsd:element name="data" type="data" minOccurs="0"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

I'm getting this error when running a marshalling operation:

Property status appears in @XmlType.propOrder, but no such property
exists this problem is related to the following location:
   at AuthenticateResponse
   at public AuthenticateResponse ObjectFactory.createAuthenticateResponse()
   at ObjectFactory

It appears that JAXB no longer allows me to refactor my elements into
base classes for some reason. It cannot find the status member even
though it exists on the Response base class. This used to work with the
previous JAXB 2.0 release. Am I missing something?

- brian