Building Sling - Errors

2016-06-14 Thread David Legg
Is there a secret method of building Sling from the repository? :-) Over the last year I've tried on and off to build Sling from time to time on an Ubuntu 14.10 system with Maven 3 and OpenJDK version 1.8.0_91. Initially I could only succeed by skipping the tests but now the Apache License ch

Re: Using the resource resolver

2016-06-14 Thread Roy Teeuwen
Hey, Thanks all for the responses. @Paul I would indeed ideally use the HTTP request, but there is no http request for the service that I am creating, but indeed that would be the best option. @Jason Yeah, I am still using the getAdminResourceResolver because it is for AEM 5.6.1. When the upg

Re: Using the resource resolver

2016-06-14 Thread Carsten Ziegeler
I think in general its considered bad practice to have a long running resource resolver. It might have stale content and you would constantly need to call refresh() on it whenever you use it. Keep also in mind that it is not thread safe, so if your doSomething is called concurrently this might fail

RE: Using the resource resolver

2016-06-14 Thread Jason Bailey
I agree with Paul, I would say that the rule of thumb is to stay open for just the length of time needed to access the resource via the resource resolver. A couple of notes, based on your sample 1. The use of getAdministrativeResourceResolver is considered harmful. Ideally you should have an a

Re: Using the resource resolver

2016-06-14 Thread Steven Walters
In the end, this primarily depends on the behavior of the underlying ResourceProviders that funnel into the ResourceResolver. For instance, if the ResourceProvider(s) support MVCC, then the data available when the ResourceResolver was opened will be "stuck" to the moment in time it was opened at,

Re: Using the resource resolver

2016-06-14 Thread Paul McMahon
I generally follow the practice of having the resource resolver passed in if possible. If the whatever is calling the service is triggered by some sort of HTTP request it's always best to just have the resource resolver passed in - in which case the resource resolver is only around for the life

Using the resource resolver

2016-06-14 Thread Roy Teeuwen
Hello all, I am wondering on the usage of the resource resolver and on how long it should stay open. Lets say I have the following implementation: @Component @Service(SomeService.class) public class SomeServiceImpl implements SomeService { @Reference private ResourceResolverFactory resourceRes

Re: Sling and link rewriter

2016-06-14 Thread Oliver Lietz
On Saturday 11 June 2016 18:39:08 Ben Fortuna wrote: > Just to follow up on this, I discovered the OBR version of sling rewriter > is old (1.0.4) so when I installed from maven central (1.1.2) I am not > seeing the same errors. Here is the link if anyone is interested: > > http://search.maven.org/