# Quota Policy - Throws NullPointerException

**URL:** <https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361>\
**Category:** Apigee\
**Tags:** api-runtime\
**Created:** [August 21, 2015, 9:35am UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361 "2015-08-21T09:35:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adevegowda](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/adevegowda/32/93606_2.png) [@adevegowda](https://discuss.google.dev/u/adevegowda)\
**Post date:** [August 21, 2015, 9:35am UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361/1 "2015-08-21T09:35:05Z")

</div>

I have a simple quota policy in my proxy which throws the NullPointerException as shown below:

```auto
{ "fault": { "faultstring": "NullPointerException", "detail": { "errorcode": "Internal Server Error" } } } 

```

This error is thrown only when I have a KeyValueMapOperations policy before the Quota policy. If I remove the KVMAP then the problem goes away.

The KVMAP policy contents are as follows:

```auto
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="KeyValueMapOperations" mapIdentifier="mykvmap">
    <Scope>environment</Scope>
    <Get assignTo="ratelimit" index="1">
        <Key>
            <Parameter>ratelimit</Parameter>
        </Key>
    </Get>
    <Get assignTo="log_level" index="1">
        <Key>
            <Parameter>log_level</Parameter>
        </Key>
    </Get>
</KeyValueMapOperations>

```

Can you please let me know why this issue occurs only when I have this KVMAP ?

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [August 21, 2015, 9:45am UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361/2 "2015-08-21T09:45:40Z")

</div>

The KVM policy has a key named **“ratelimit”** which is also used internally by the rate limit code to retrieve rate limit policy details.

This results in a namespace conflict between the two and we see a NPE.

This is applicable to an AssignMessage policy as well.

ratelimit

Changing the key name would help.

---

<div class="post-metadata">

**Author:** ![adevegowda](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/adevegowda/32/93606_2.png) [@adevegowda](https://discuss.google.dev/u/adevegowda)\
**Post date:** [August 21, 2015, 9:57am UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361/3 "2015-08-21T09:57:50Z")

</div>

[@krupa](https://community.apigee.com/users/1180/krupa.html)

Thanks for your response.

I changed the “ratelimit” to “rate\_limit” and the problem disappeared.

---

<div class="post-metadata">

**Author:** ![jonesfloyd](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jonesfloyd](https://discuss.google.dev/u/jonesfloyd)\
**Post date:** [August 25, 2015, 11:40pm UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361/4 "2015-08-25T23:40:03Z")

</div>

Thanks for the post and the answer. I’ve updated the KVM policy and AssignMessage policy (AssignVariable name) docs to say that “ratelimit” is a reserved word.

---

<div class="post-metadata">

**Author:** ![adevegowda](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/adevegowda/32/93606_2.png) [@adevegowda](https://discuss.google.dev/u/adevegowda)\
**Post date:** [August 26, 2015, 1:50am UTC](https://discuss.google.dev/t/quota-policy-throws-nullpointerexception/11361/5 "2015-08-26T01:50:16Z")

</div>

[@Floyd Jones](https://community.apigee.com/users/202/fjonesapigeecom.html)

Many Thanks for updating the docs with this information.
