Questions tagged [sling]

Apache Sling is a web framework that uses Java Content Repository to store and manage content. It also uses OSGi (Apache Felix) for dynamic loading.

Description

Apache Sling is a web framework that uses a Java Content Repository , such as Apache Jackrabbit , to store and manage content.

Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.

The embedded Apache Felix OSGi framework and console provide a dynamic runtime environment, where code and content bundles can be loaded, unloaded and reconfigured at runtime.

As the first web framework dedicated to JSR-170 Java Content Repositories, Sling makes it very simple to implement simple applications, while providing an enterprise-level framework for more complex applications.

Links

863 questions
3
votes
1 answer

Why OSGI event handler is not called always

I have simple OSGI event listener class @Component(immediate = true) @Service(value = { EventHandler.class, JobConsumer.class }) @Properties(value = { @Property(name = JobConsumer.PROPERTY_TOPICS, value = { TestEventHandler.JOB_TOPICS…
Pakira
  • 1,951
  • 3
  • 25
  • 54
3
votes
1 answer

How do perform proper backups in Apache Sling

I am planning the backup strategy for my sling application. In my application users are able to register themselves and create their own content. To be able to recover from a crash I tried to create a content package by using the composum package…
Tim
  • 287
  • 1
  • 13
3
votes
1 answer

Difference between @Inject and @ValueMapValue annotations

While reading AEM documentation about using models, I couldn't figure out what is the difference between @Inject and @ValueMapValue annotation above the field. I tried using both, and they both seems the same, so I must be missing something.
Tadija Malić
  • 445
  • 7
  • 26
3
votes
1 answer

Using Sling Scheduler with Eclipse Equinox or OSGI @Reference rules

I want to use Sling scheduler as a bundle in my Eclipse Equinox Environment and now trying to just run the examples, both whiteboard or via API without success. After lots of debugging I have now been able to make it work but I had to make a change…
Alain P
  • 1,293
  • 8
  • 16
3
votes
1 answer

Multiple selectors using Sling Servlets

Short version: How do I force the most matching on a servlet based on multiple selectors using Felix annotations for sling servlets? I have a few servlets defined in an OSGI bundle. I'm using the org.apache.felix.scr.annotations.sling.SlingServlet…
Marc
  • 415
  • 5
  • 16
3
votes
2 answers

Exception on service activation in mock OSGi context

In my Maven project, I've created a simple OSGi service that does nothing but accepts one reference: import org.apache.sling.api.resource.ResourceResolverFactory; import org.osgi.service.component.annotations.Component; import…
CptBartender
  • 1,235
  • 8
  • 22
3
votes
3 answers

How to fix AEM 6.3 - Maven Archetype 12 "No DS descriptor found" errors?

We have created an AEM 6.3 project using Maven Archetype 12. We have not yet written any code and are just trying to build the empty project imported into Eclipse. We are getting the error which is mentioned in the…
AR2
  • 73
  • 9
3
votes
3 answers

AEM 6.3: Error while calling POST Servlet

I have created a POST servlet like below: package com.aem.sites.servlets; import java.io.IOException; import javax.servlet.Servlet; import javax.servlet.ServletException; import org.apache.sling.api.SlingHttpServletRequest; import…
user972418
  • 817
  • 3
  • 25
  • 58
3
votes
1 answer

JS: Check if Sling resource exists without creating 404 error

I want to check if a Sling ressource already exists. Currently I use CQ.HTTP.get(url) to accomplish this. The problem is that if the ressource does not exist, JS logs a 404 error to the console which I think is ugly. Is there a better way to check…
Jdv
  • 962
  • 10
  • 34
3
votes
1 answer

Sling resource.getResourceResolver() Vs SlingHttpRequest.getResourceResolver

In my project I am seeing in Sling model classes, the resource resolver is fetched in 2 ways @Inject private Resource resource; ResourceResolver resolver = resource.getResourceResolver(); Vs @Inject @Self private SlingHttpServletRequest…
Saravana Prakash
  • 1,321
  • 13
  • 25
3
votes
2 answers

What version of Apache Sling does Adobe Experience Manager (AEM) 6.2/6.3 use?

I was wondering what version of Apache Sling does Adobe Experience Manager (AEM) 6.2/6.3 use? I've searched on various sites, including Adobe's own documentation, but haven't seem to be able to find a definitive answer to this. At the moment I'm…
risingTide
  • 1,754
  • 7
  • 31
  • 60
3
votes
2 answers

How to Copy AEM node one place to another location?

I need to copy an AEM JCR node source to destination. The following code is working but if that node already exists in the destination I'm getting an error: String sourcePath="/content/dam/assets/content"; String…
Asna Raheem
  • 55
  • 1
  • 7
3
votes
2 answers

AEM URL Rewriting

I can see broadly two approaches for URL rewriting in AEM: Sling mapping (sling:Mapping) under /etc/map/http(s) URL rewriting using link rewriter/TransformerFactory. I want to know which one is better among two - in sense of ease of…
Finn
  • 912
  • 1
  • 16
  • 53
3
votes
2 answers

order of precedence of Sling run modes

I have a doubt over this question Question: What is the correct order of precedence to setup runmodes in aem? (From left to right, left beign the highest)? A. System property, Sling properties file, jar file B. jar file, sling properties file,…
Manisha Bano
  • 1,853
  • 2
  • 22
  • 34
3
votes
1 answer

javax.jcr.InvalidItemStateException: Item cannot be saved

I am getting following exception in a single box cq5 author environment. javax.jcr.InvalidItemStateException: Item cannot be saved because node property has been modified externally more exception details: Caused by:…
Sri
  • 1,205
  • 2
  • 21
  • 52