ConfD User Community

Confd[112]: devel-c bad get_next_object() return value: /xx:yy/../target{v3user}: Too many values



List<ConfValue[]> getIteratorObjectList(DpTrans trans, ConfObject[] kp, Object obj, Iterator<? extends Object> iterator)

is called we get the above error in the title.
In our case we don’t really use POJOs for the YANG tree list since we try to be transparent.

What can cause such an error ?

I guess getIterator and getIteratorObjectList interworking ? What can we check in order to fix it ?




Perhaps the issue is related to for example nested lists where you need to return new ConfNoExists(). See @josephm’s reply here: How to add the support of the get_next_object() callback to the 5-c_stats example?




No this is the strange thing. I have inner containers

list outer {
    key "a";
    leaf a { type int32; }
    container transport {
       leaf ip { type String }
       leaf port (type uint8}
    leaf b { type string; }
    container authentication {
       leaf userName{ type String }
       leaf passwd {type uint8}


What about this case ? I cannot find something to JAVA doc for this. How do we handle this case ?


Please see description in the C language binding confd_types manpage,
section “ XML STRUCTURES ”, subsection “ Value Array


Perhaps something like this:

new ConfValue[] { new ConfUInt32(a), 
                  new ConfXMLTagH(myprefix.myprefix_transport_),
                  new ConfIPv4(ip),
                  new ConfUInt8(port),
                  new ConfBuf(b),
                  new ConfXMLTagH(myprefix.myprefix_authentication_),
                  new ConfBuf(userName),
                  new ConfUInt8(passwd) };



Ok I think we are close to the solution. We have never used ConfXMLTagH so I am not sure what it is exactly.
BUT since we are not using java generated code from the YANG model, i.e we don’t have JAVA POJOs for representing the YANG model (we wanted to be transparent for the model)
we don’t have

new ConfXMLTagH(myprefix.myprefix_transport_)



long value.

Is there a way to get it or to generated some how ? Or is there any other way to create ConfXMLTagH ?




See doc/api/java/com/tailf/conf/ConfXMLTagH.html
Java new ConfXMLTagH() = C-lang CONFD_SET_XMLTAG()
In this case it represents your container.

You can get it from the schema. Quick example:

Maapi maapi = new Maapi(new Socket(CONFD_ADDR, Conf.PORT));
MaapiSchemas sch = Maapi.getSchemas();
MaapiSchemas.CSNode transportnode = sch.findCSNode("", "/myprefix:outer/transport");
System.out.println("transport hash  = " + transportnode.getTagHash());