You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
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;
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.
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
[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]
The text was updated successfully, but these errors were encountered: