Null Pointer Exception for ModifiableValueMap. | Community
Skip to main content
vasimakram
Level 4
July 4, 2017
Question

Null Pointer Exception for ModifiableValueMap.

  • July 4, 2017
  • 3 replies
  • 3080 views

Hi,

I have a resource. I am trying to set property for that resource using ModifiableValueMap. When I tried this I am getting null pointer exception even through that resource is available. What could be the reason and how to fix it. Thanks in advance.

Code Sample:

ModifiableValueMap map= resource.adaptTo(ModifiableValueMap.class);

map.put("property","property valuse");

Regards,

Vasim

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

mallikarjunp178
Level 2
July 5, 2017

ModifiableValueMap Not Found: Considerations in Using ModifiableValueMaps in an API | 6D Labs

Use your own resolver to get the resource then adopt that resource as modifiableValueMap.

Feike_Visser1
Adobe Employee
Adobe Employee
July 5, 2017

Do you have the right permissions? Can you share the stacktrace, so we can see where it is failing.

vasimakram
Level 4
July 5, 2017

I have created a system user and added him to administrators group. I am using his resource resolver to set property.