RuleVerifyUtils - contains uninstantiated identifier error

34 views
Skip to first unread message

shashank singh

unread,
Jun 12, 2017, 3:45:49 AM6/12/17
to indeedeng-proctor-users

I have a simple class city

@Getter

@Setter

@ToString

public class City {

public City(String cityName) {

this.cityName = cityName;

}

@Nonnull

private String cityName;

}


And this is my rule in allocations

"allocations": [

        {

          "rule": "${city.cityName=='NY'}",

          "ranges": [

          {

              "length": 0.1,

              "bucketValue": 2

            },

            {

              "length": 0.9,

              "bucketValue": 1

            }

          ]

        },......


When I am running the loader I'm getting this error

[com.indeed.proctor.common.RuleVerifyUtils.verifyRule] - Rule ${city.cityName=='bangalore'} contains uninstantiated identifier(s) in [city], ignore the failure

javax.el.PropertyNotFoundException: ELResolver did not handle type: null with property of 'null'


I might be missing very basic thing here but couldn't  figure out.

Yiqing Zhu

unread,
Jun 12, 2017, 6:42:28 AM6/12/17
to shashank singh, indeedeng-proctor-users
Hi Shashank,

Thanks for asking. 

This error should happen on verifying proctor matrix. 
Proctor client verifies the rule when loading a proctor matrix, without a given context. That's why you need to provide a context in providedcontext.json for rule verification. 
In your case, you should also put your variable city in the file, like:

{
    ....
    "city": "package.name.City"
    ...
}

Moreover,  Proctor client doesn't know how to inistantiate your class, so by default Proctor client uses the default constructor (the constructor without any parameters) to create a instance. Therefore, you should also provide a default constructor of your City class. Then proctor should be able to verify the rules. 

Please reach out to us if you need more help on this. 

Yiqing

--
You received this message because you are subscribed to the Google Groups "indeedeng-proctor-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to indeedeng-proctor-users+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages