We are using AEM 6.1.
We tried the solution based on https://helpx.adobe.com/experience-manager/using/multiple-digital-assets.html
We customized HandleFile.java a bit (just one line). It is attached here. HandleFile.java has a method writetoClintLib and it fails with NullPointerException at ResourceResolver resourceResolver = resolverFactory.getAdministrativeResourceResolver(null);
Seems like injection for ResourceResolverFactory is not working, but not sure why.
Solved! Go to Solution.
Views
Replies
Total Likes
Adding to what Scott has mentioned, it is not good practice to use getAdministrativeResourceResolver method. It has been depricated from ResourceResolverFactory.
Please have a look at the link, it will answer all your questions :-
Link:- http://www.accunitysoft.com/resourceresolver-object-in-aem6-16-0-sling-services/
//Use getServiceResourceResolver()
Here step by step everythig is mentioned, how to use it. And how to use it in AEM 6 and AEM 6.1.
Depricated Info :- https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolverFactory.html#g...
Forum Link:-http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
As shown at the start of the article - this article was tested on CQ 5.5, 5.6, and 6.
I will test on 6.1 on tues and see if it works. I suspect that on 6.1 - this line is not working properly:
//Inject a ResourceResolver
ResourceResolver resourceResolver = resolverFactory.getAdministrativeResourceResolver(null);
Best practice in 6.1 is to use an AEM system user and use code like:
Map<String, Object> param = new HashMap<String, Object>();
param.put(ResourceResolverFactory.SUBSERVICE, "jqom");
ResourceResolver resolver = null;
try {
//Invoke the getServiceResourceResolver method to create a Session instance
resolver = resolverFactory.getServiceResourceResolver(param);
To learn how to create a system user and use it to create a ResourceResolver - see this AEM community article:
Views
Replies
Total Likes
Adding to what Scott has mentioned, it is not good practice to use getAdministrativeResourceResolver method. It has been depricated from ResourceResolverFactory.
Please have a look at the link, it will answer all your questions :-
Link:- http://www.accunitysoft.com/resourceresolver-object-in-aem6-16-0-sling-services/
//Use getServiceResourceResolver()
Here step by step everythig is mentioned, how to use it. And how to use it in AEM 6 and AEM 6.1.
Depricated Info :- https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolverFactory.html#g...
Forum Link:-http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
I tried creating system user and tried using getServiceResourceResolver instead of getAdministrativeResourceResolver, still it fails at same place with NullPointerException. Attached is the updated code.
Views
Replies
Total Likes
Also attaching my version of client (simple java program) if you have trouble running swing client. It reads all the images in particular directory and try to upload them, as we have requirement to upload all the files in particular directory.
Views
Replies
Total Likes
Were you able to try it?
Views
Replies
Total Likes
I tested the binary code available on the documentation page with AEM 6.1 instance and it worked fine for me. This is what I did-
Used Services |
/bin/upmanydamfiles | No | Service 3609 |
curl -F "image=@/home/test.jpg" -F "@imageTitle=/content/dam/test.jpg" http://localhost:4502/bin/upmanydamfiles
Validated the JPEG file in DAM and there were no exceptions.
Views
Replies
Total Likes
Hi
As mentioned by Kunal, I too checked this package present in the documentation.
Its working fine with me too.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes