Getting NonExistingResource exception while using resourceresolver resolve method + Adobe 5.4 | Community
Skip to main content
New Participant
October 16, 2015
Solved

Getting NonExistingResource exception while using resourceresolver resolve method + Adobe 5.4

  • October 16, 2015
  • 4 replies
  • 1004 views

All,

Its a very confusing problem which i am facing. I have following path in cq dam:/content/dam/example/test/language. Inside this path i have json and zip files. In my code i am using resourceresolver.resolve and passing above path along with json file name. When i print the output of above method i get "NonExistingResource", but when i copy the same path on browser i am getting correct json file. Also using DAM i can navigate to that path without any issues. Also, i have few json files in parent folder i.e. in "test" folder which i am able to retreive successfully using resourceResolver.resolve method.

Does anyone faced this issue before? What can be probable cause for this? How do i resolve it?

Adobe CQ version 5.4

Regards,

Mayank

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

Why are you trying to adopt json into asset?  It should be something like [1]

[1]   resourceResolver.resolve("/content/dam/geometrixx/documents/GeoCube_Datasheet.pdf").adaptTo(Asset.class)

4 replies

smacdonald2008
New Participant
October 16, 2015

Can you please post your code so we can see exactly what you are trying to do. 

New Participant
October 16, 2015

Sure,

Below is the code:

resourceResolver.resolve("/content/dam/example/test/language/en.json").adaptTo(Asset.class).

Another interesting thing which i noticed when i do

resourceResolver.resolve("/content/dam/example/test/language").adaptTo(Asset.class), i still get NonExistingResource 

Regards,

Mayank

Sham_HC
Sham_HCAccepted solution
New Participant
October 16, 2015

Why are you trying to adopt json into asset?  It should be something like [1]

[1]   resourceResolver.resolve("/content/dam/geometrixx/documents/GeoCube_Datasheet.pdf").adaptTo(Asset.class)

New Participant
October 16, 2015

Sham,

 

I need to update json with modified content hence i am adapting to Asset. Anyways i found out root cause, it was due to session getting close in one scenario which was causing this issue. Thanks Sham and macdonald for looking into my problem.

 

Regards,

Mayank