[ 
https://issues.apache.org/jira/browse/SLING-8556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883627#comment-16883627
 ] 

Bertrand Delacretaz commented on SLING-8556:
--------------------------------------------

I've progressed a bit in wiring Sling components statically so that 
{{native-image}} builds work, at 
https://github.com/apache/sling-whiteboard/tree/master/graalvm

I'm able to start a container and get a valid HTTP response from Sling code in 
in about 1.3 seconds, measured with 
[https://github.com/apache/sling-whiteboard/tree/master/graalvm/time-to-first-request]
 , which is promising.

However, at commit 
[https://github.com/apache/sling-whiteboard/commit/a4aa6a14ee9586a41f766799f2e620c34d7e0b26]
 the native-image build fails with a NullPointer exception. Reverting to the 
previous version of that SlingContext class, the {{native-image}} build works 
but the tests fail obviously as the disabled 
{{ResourceResolverFactoryActivator}} is required.

I don't have time right now to investigate deeper but this looks like a 
{{native-image}} bug (using GraalVM + native-image 19.1.0), I would expect a 
descriptive error message if something's wrong in my code.

For now I'll pursue a different way of getting a minimal Sling instance to 
start quickly (for my adaptTo() 2019 talk) and might come back to this later.

> Experiments with Sling and GraalVM native images
> ------------------------------------------------
>
>                 Key: SLING-8556
>                 URL: https://issues.apache.org/jira/browse/SLING-8556
>             Project: Sling
>          Issue Type: New Feature
>          Components: General
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>
> For my talk at adaptTo() 2019 I'm running a series of experiments with 
> [GraalVM|http://graalvm.org], [Quarkus.io|http://quarkus.io]  and Sling.
> The goal is to find out what's needed to create native images that run Sling 
> components - they don't have to run a complete Sling instance but running 
> things like request processing in Docker images that start quickly can be 
> interesting.
> I'll use this ticket to document my experiments, feedback is welcome.
> This is just meant as a journal of my experiments, it might not be very well 
> organized, I'll summarize it in the adaptTo() talk.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to