Sorry I just read the full stack after I answered. Looks like indeed AEM 6.1 doesn’t include nashorn the same way. A solution for that version of sling I can think of is making the engine usage optional (with no dynamic expression (no $(…)) but I wonder what is the best compared to including the fragment.
> On 6 Nov 2017, at 10:07, Nicolas Peltier <[email protected]> wrote: > > Hi Björn (including dev list), > > Nashorn is used to evaluate expressions in most pipe configurations so yes, > it is mandatory. > Can you track a bug in sling (ideally with a pax-exam failing IT patch)? > > >> On 6 Nov 2017, at 09:51, Bjoern Csott <[email protected]> wrote: >> >> Hi Nicolas, >> >> I’ve debugged the sling pipes code. The issue is >> ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn"); >> in PipeBindings.java. >> >> The point I do not get is: Why does it work with sling pipes >> PlumberServlet.java but not with mine. I got exactly the same lines to get >> the pipe. >> >> Did you face these nashorn issues in the past? In dl-dev I found this: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fsling%2Ftree%2Ftrunk%2Fcontrib%2Fscripting%2Fframework-extension-nashorn&data=02%7C01%7C%7C3c6f12959c944d29886308d524f5ea6a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636455560971559584&sdata=RzS7mnEJAvX1Kx1C8TSJpmkcVopXwjwJLHg4WmU6Vsw%3D&reserved=0 >> >> Is this a mandatory requirement? >> >> Thanks >> Björn >> >> ... >> >> Von: Nicolas Peltier <[email protected]> >> Datum: Donnerstag, 2. November 2017 um 17:58 >> An: Bjoern Csott <[email protected]> >> Betreff: Re: Sling Pipes >> >> Hi! Can you try to use directly the plumber in the see let to see if it >> helps? >> What version are you using? >> Can you share the code? >> >> Envoyé de mon iPhone >> >> Le 2 nov. 2017 à 15:32, Bjoern Csott <[email protected]> a écrit : >> >> Hi Nicolas, >> >> I have implemented some migration pipes in my current project. Since we want >> to allow business to do the mandatory changes, we got a service which >> executes the pipes. >> >> Now I have a really strange behavior: >> If I trigger the migration via JMX everything works fine: >> plumber.getPipe(pipeResource) returns my container pipe >> If I inject the service into a Servlet and run the same method, I get a >> Exeption from Plumber (Unable to properly instantiate the pipe configure >> in....) and the follwing in system.out: >> ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: >> Provider >> >> In both cases I am getting the Resource resolver from the Resolverfactory >> for a service account. >> >> Executing the pipe via curl works fine. >> >> Thanks for any hints! >> Björn >> >
