Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Bug when inheriting and not creating an XmlElement #105

Closed
glassfishrobot opened this issue Nov 16, 2005 · 5 comments
Closed

Bug when inheriting and not creating an XmlElement #105

glassfishrobot opened this issue Nov 16, 2005 · 5 comments

Comments

@glassfishrobot
Copy link
Contributor

I am defining a Java class that has annotations for
XmlAttributes for its two fields.

While I can create an XML document programmatically,
JAXB fails to read it into the Java-bound classes:

Here is the instance document:

file:/net/rockpile/export1/workspaces/users/arieh/x2-05/scrk/usr/proto/com/sun/scn/asset/maps/impl/daqimmap.xsd
Exception in thread "main" javax.xml.bind.UnmarshalException

  • with linked exception:
    [org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element 'argument' must
    have no character or element information item [children], because the type's
    content type is empty.]
    at
    javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)

Here is the 'argument' class:

@XmlType( name = "argument" )
public class ArgMapping {
private String imName;
private String daqName;

public ArgMapping()

{ super(); }

public ArgMapping(String theIMName, String theDAQName)
{
imName = theIMName;
daqName = theDAQName;
}

@XmlAttribute( name = "InfoModel", required = true )
public String getIMName()

{ return imName; }

public void setIMName( String theName )

{ imName = theName; }

@XmlAttribute( name = "DAQ" )
public String getDAQName()

{ return daqName; }

public void setDAQName( String theName )

{ daqName = theName; }

}

This appears to be a bug.

Environment

Operating System: All
Platform: Sun

Affected Versions

[2.0 EA1]

@glassfishrobot
Copy link
Contributor Author

Reported by amarkel

@glassfishrobot
Copy link
Contributor Author

Was assigned to jaxb-issues

@glassfishrobot
Copy link
Contributor Author

kohsuke said:
We need more info. The error is coming from a validator, not JAXB. Are you
setting a Schema object to the Unmarshaller? What schema?

The error message is also inconsistent with the document you pasted. Your XML
fragment doesn't have any text between and , yet the error
message suggests you do.

It would be great if you can attach a complete test case. Please reopen this bug
when you have more info.

@glassfishrobot
Copy link
Contributor Author

Marked as won't fix on Tuesday, March 7th 2006, 4:51:10 am

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA JAXB-105

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant