Hi!

I'm trying to run our Sling-application from a JAR that embeds a feature 
archive without it needing any network access / an existing maven repository. 
So my first try is to use the 
https://github.com/apache/sling-org-apache-sling-kickstart project for this, 
which already includes a feature archive with a version of Sling Starter 12. So 
I was expecting that

java -jar org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar start

could start without taking anything from maven or the net since there is a 
sling feature archive included. But actually it takes a lot from there, if not 
everything. If I start it with debugging (-v) it logs "Found artifact file" for 
399 files saying it takes them from my maven repository. If I try to run it in 
docker while blocking network access (e.g. with

docker run -ti --rm --network none  -v `pwd`/target:/app -w /app openjdk:12-jdk 
/bin/bash

and executing the java start command there) it fails with the following errors, 
though the URL for the FAR seems correct - at least I can open it from a 
jshell. Am I doing something wrong here? If that matters: I'm running it from 
MacOS, in the Docker image with OpenJDK 12. 

I also tried to switch the kickstarter to the newest 
org.apache.sling.feature.launcher.version , but that didn't help. When I try to 
use the original Sling feature launcher with the FAR created by kickstarter, 
that works to some extend:

java -jar org.apache.sling.feature.launcher-1.1.19-SNAPSHOT.jar -f 
org.apache.sling.kickstart-0.0.13-SNAPSHOT-oak_tar_far.far -u 
'jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT-oak_tar_far.far!'

This retrieves many artefacts from the FAR but fails when it tries to retrieve 
org.apache.felix.framework-7.0.0.jar . But it seems kickstarter doesn't give 
that option to the sling starter it calls, and there also doesn't seem to be an 
option to kickstarter to set the repositories it tries to retrieve artefacts 
from. (The problem with the felix framework version is possibly one it inherits 
from Sling Starter itself - when I grab a 
org.apache.sling.starter-12-SNAPSHOT-oak_tar_far.far from there, the same thing 
happens.)

Thank you very much!

Best regards,

Hans-Peter Störr


Attachment- the output from within docker is:

Before Launching Feature Launcher, arguments: [-f, 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far,
 -v]
 Starting Apache Sling in null-----------
 Start Command: 'start'
 Apache Sling Control Listener started//root/.m2/repository, 
https://repo.maven.apache.org/maven2, 
https://repository.apache.org/content/groups/snapshots]
 [INFO] Assembling final feature model...
 [INFO] Apache Sling Application 
Launcher:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far
 [INFO] 
---------------------------------ile:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far
 [INFO] Initializing...o be local file 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far
 [INFO] Artifact Repositories: [file:///root/.m2/repository, 
https://repo.maven.apache.org/maven2, 
https://repository.apache.org/content/groups/snapshots]
 [INFO] Assembling final feature 
model...rg.apache.sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/slingosgifeature/oak_tar
 [DEBUG] Reading feature archive 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.farSHOT-oak_tar.slingosgifeature
 [DEBUG] Trying to get artifact for 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far0.13-SNAPSHOT/org.apache.sling.kicks
 [DEBUG] Checking url to be local file 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.far
 [DEBUG] Checking remote url 
jar:file:/app/org.apache.sling.kickstart-0.0.13-SNAPSHOT.jar!/default/org.apache.sling.kickstart.farg.apache.sling.kickstart-0.0.13-SNAPSHOT-oa
 [DEBUG] Trying to get artifact for 
mvn:org.apache.sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/slingosgifeature/oak_tar
 [DEBUG] Querying repositories for 
org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sling.kickstart-0.0.13-SNAPSHOT-oak_tar.slingosgifeature
 [DEBUG] Checking DefaultArtifactHandler to get artifact from 
file:///root/.m2/repository/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sling.kicks
 [DEBUG] Checking url to be local file 
file:///root/.m2/repository/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sling.kickstart-0.0.13-SNAPSHOT-oa
 [DEBUG] Trying to get artifact for 
file:///root/.m2/repository/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/maven-metadata.xml
 [DEBUG] Checking url to be local file 
file:///root/.m2/repository/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/maven-metadata.xmle.sling.kickstart-0.0.13-SN
 [DEBUG] Checking DefaultArtifactHandler to get artifact from 
https://repo.maven.apache.org/maven2/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sl
 [DEBUG] Checking url to be local file 
https://repo.maven.apache.org/maven2/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sling.kickstart-0.0.13-SN
 [DEBUG] Checking remote url 
https://repo.maven.apache.org/maven2/org/apache/sling/org.apache.sling.kickstart/0.0.13-SNAPSHOT/org.apache.sling.kickstart-0.0.13-SNAPSHOT-oak
 [INFO] Artifact not found in one repository
 java.net.UnknownHostException: repo.maven.apache.org
         at 
java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
         at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
...

Reply via email to