[SOLVED]Eclipse IDE problems: Type mismatch - cannot convert from AsyncResult<Value> to Value

Have followed instructions for Eclipse IDE installation via www.openhab.org, now running on MacOS.

Have cloned an existing marketplace binding which I need to customize due to binding no longer working after a FW update for the system bridge, and it does not seem as the author has responded to issue. I.e. hope to be able to generate a jar file to implement via PaperUI (although newbie to programming).

Have managed to work the code, although have 2 remaining problems after setup task and clean. Any ideas?

Problem stated: “Type mismatch: cannot convert from AsyncResult to Value”.

 Value response = m_RpcManager.call(Jid.of("mrha@busch-jaeger.de/rpc"), "RemoteInterface.setDatapoint",
                    para0, para1);
            logger.debug("Response from RPC RemoteInterface.setDatapoint: " + response.getAsString());
            boolean resp = response.getAsBoolean();

Proposed solution in Eclipse: Change type of response to AsyncResult. However, doing so will create a new problem: The method getAsString() is undefined for the type AsyncResult.

You usually need to wait for an async value. There should be a “then” function or a “waitForValue” method or similar.

I fixed the problem, although not sure exactly what made the trick. I used the Value.of() directly as arguments, not defining value as input parameters.

Put the updated code here for future reference:

Value response = m_RpcManager.call(Jid.of("mrha@busch-jaeger.de/rpc"), "RemoteInterface.setDatapoint",
                    Value.of(adress), Value.of(value)).getResult();
            boolean resp = response.getAsBoolean();