Tutorial-applestamp QueryCriteria problem

Hi and welcome!

In tutorial-applestamp example (using version 4.8.5 of Corda) I am getting an error in line 43 and line 46-48:

Cannot resolve method ‘queryBy(java.lang.Class<com.tutorial.states.AppleStamp>, net.corda.core.node.services.vault.QueryCriteria.LinearStateQueryCriteria)’

and

Required type:
QueryCriteria
Provided:
VaultQueryCriteria

From the code it seems that it has been assumed that LinearStateQueryCriteria and VaultQueryCriteria inherit from QueryCriteria but this is not the case- they are just inner classes.

Has anyone had a similar issue or am I missing something?

Thank you very much.
Lukasz

Hi Lukasz,

This is actually a false-alarmed error message triggered by IntelliJ. If you actually build your project via ./gradlew clean build, the project will build. We start seeing this type of issue from intelliJ 2021 versions +. If you want to avoid seeing this “error” message, you can use the 2020 versions of IntelliJ.
Sorry for the incovinence. :sweat_smile:

Peter Li | R3