Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink: "Missing class for indicator field value" without inheritance
EclipseLink: "Missing class for indicator field value" without inheritance [message #1725450] Thu, 03 March 2016 15:09 Go to next message
Fabien Bonic is currently offline Fabien BonicFriend
Messages: 4
Registered: March 2016
Junior Member
I have a problem using Moxy to convert a JSON String to an XML Object. Here is the exception I get when I do this conversion:

Exception [EclipseLink-43] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [TENANT] of type [class java.lang.String].
Descriptor: XMLDescriptor(fr.niji.nates.webservices.macd.ws.COMPONENTTYPE --> [])
    at org.eclipse.persistence.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:940)
    at org.eclipse.persistence.internal.oxm.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:278)
[...]


Here is the class "COMPONENTTYPE" that I use:

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "COMPONENT_TYPE")
@XmlSeeAlso({
    COMPONENTDETAILTYPE.class,
    MACDRESULTTYPE.Created.class
})
public class COMPONENTTYPE {

    @XmlAttribute(name = "type", required = true)
    protected String type;
    @XmlAttribute(name = "dbid", required = true)
    protected int dbid;

    public String getType() {
        return type;
    }

    public void setType(String value) {
        this.type = value;
    }

    public int getDbid() {
        return dbid;
    }

    public void setDbid(int value) {
        this.dbid = value;
    }
}


The problem seems to be only on "type" attribute and not on "dbid".

Does anyone have an idea? Thanks,
Re: EclipseLink: "Missing class for indicator field value" without inheritance [message #1725789 is a reply to message #1725450] Mon, 07 March 2016 16:36 Go to previous messageGo to next message
Fabien Bonic is currently offline Fabien BonicFriend
Messages: 4
Registered: March 2016
Junior Member
Here is the full stack trace :

Exception [EclipseLink-43] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [TENANT] of type [class java.lang.String].
Descriptor: XMLDescriptor(fr.niji.nates.webservices.macd.ws.COMPONENTTYPE --> [])
	at org.eclipse.persistence.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:940)
	at org.eclipse.persistence.internal.oxm.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:278)
	at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.classFromRow(TreeObjectBuilder.java:182)
	at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.classFromRow(TreeObjectBuilder.java:1)
	at org.eclipse.persistence.internal.oxm.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:63)
	at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.startElement(XMLCompositeObjectMappingNodeValue.java:375)
	at org.eclipse.persistence.internal.oxm.record.UnmarshalRecordImpl.startElement(UnmarshalRecordImpl.java:860)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parsePair(JsonStructureReader.java:456)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parseValue(JsonStructureReader.java:268)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parsePair(JsonStructureReader.java:457)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parseValue(JsonStructureReader.java:268)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parsePair(JsonStructureReader.java:457)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parseRoot(JsonStructureReader.java:182)
	at org.eclipse.persistence.internal.oxm.record.json.JsonStructureReader.parse(JsonStructureReader.java:140)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:901)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:388)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:626)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:662)
	at org.eclipse.persistence.internal.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:581)
	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:323)


If I create a second attribute named "type2", this attribute does not have the problem. I don't understand why there is a problem with the attribute "type"...
Re: EclipseLink: "Missing class for indicator field value" without inheritance [message #1725962 is a reply to message #1725789] Tue, 08 March 2016 16:16 Go to previous messageGo to next message
Fabien Bonic is currently offline Fabien BonicFriend
Messages: 4
Registered: March 2016
Junior Member
In the class "QNameInheritancePolicy", the method "classFromRow" has the following code :
    public Class classFromRow(AbstractRecord rowFromDatabase, AbstractSession session) throws DescriptorException {
        ((XMLRecord) rowFromDatabase).setSession(session);
        if (hasClassExtractor() || shouldUseClassNameAsIndicator()) {
            return super.classFromRow(rowFromDatabase, session);
        }
        Object indicator = rowFromDatabase.get(getClassIndicatorField());        
        
        if (indicator == AbstractRecord.noEntry) {
            return null;
        }

        if (indicator == null) {
            return null;
        }
[...]


For the attribute "@type", the variable indicator is not null whether it should be null in my case... Is there a solution for that?
Re: EclipseLink: "Missing class for indicator field value" without inheritance [message #1726102 is a reply to message #1725962] Wed, 09 March 2016 15:29 Go to previous message
Fabien Bonic is currently offline Fabien BonicFriend
Messages: 4
Registered: March 2016
Junior Member

The solution I found is to add the annotation @XmlDiscriminatorNode to the class :

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "COMPONENT_TYPE")
@XmlSeeAlso({
    COMPONENTDETAILTYPE.class,
    fr.niji.nates.webservices.macd.ws.MACDRESULTTYPE.Created.class
})
@XmlDiscriminatorNode("@@type")
public class COMPONENTTYPE {
    [...]

Previous Topic:eclipselink history policy: history records with null id
Next Topic:Subqueries in FROM Clausule using ExpressionBuilder
Goto Forum:
  


Current Time: Thu Apr 25 23:55:37 GMT 2024

Powered by FUDForum. Page generated in 0.03339 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top