Hi, I am trying to use vault upgrade hook with plain groovy (not groovy console) to work with latest AEM as a Cloud Service instance (local setup, I know that this will not work on AMS isntance at the moment due to issue with FileVault, for more see this link)
As I read to do so I need to install Apache Sling Scripting Groovy and all it's dependencies:
// https://mvnrepository.com/artifact/org.apache.sling/org.apache.sling.scripting.groovy/1.2.0
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.groovy</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-templates -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-templates</artifactId>
<version>3.0.1</version>
</dependency>
Unfortunately when I install json bundle I got the following error:
org.apache.felix.log.LogException: org.osgi.framework.BundleException: Unable to resolve groovy-json [551](R 551.0): missing requirement [groovy-json [551](R 551.0)] osgi.extender; (osgi.extender=osgi.serviceloader.registrar) Unresolved requirements: [[groovy-json [551](R 551.0)] osgi.extender; (osgi.extender=osgi.serviceloader.registrar)]
Do you have an idea what might be missing here ? Thanks for your help
Solved! Go to Solution.
Views
Replies
Total Likes
I found a blog post https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html that addresses the issue I had below. To fix that I added the following bundles to the instance:
<!-- Dependencies needed to run Vault upgrade hook with plain groovy -->
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.groovy</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-templates</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.1</version>
</dependency>
<!-- Dependencies below needed because of issue wth groovy-json bundle -->
<!-- https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html -->
<dependency>
<groupId>org.apache.aries.spifly</groupId>
<artifactId>org.apache.aries.spifly.dynamic.bundle</artifactId>
<version>1.3.3</version>
</dependency>
<!-- Dependencies below needs to be provided for org.apache.aries.spifly.dynamic.bundle-->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-analysis</artifactId>
<version>9.1</version>
</dependency>
Installing those bundles fixed the issue - now all required bundles are active and I groovy script is executed once package with upgrade hook is installed. I am not sure whether this is the right way to go though - adding so many dependencies to make this work seems wrong
I found a blog post https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html that addresses the issue I had below. To fix that I added the following bundles to the instance:
<!-- Dependencies needed to run Vault upgrade hook with plain groovy -->
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.groovy</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-templates</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.1</version>
</dependency>
<!-- Dependencies below needed because of issue wth groovy-json bundle -->
<!-- https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html -->
<dependency>
<groupId>org.apache.aries.spifly</groupId>
<artifactId>org.apache.aries.spifly.dynamic.bundle</artifactId>
<version>1.3.3</version>
</dependency>
<!-- Dependencies below needs to be provided for org.apache.aries.spifly.dynamic.bundle-->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-analysis</artifactId>
<version>9.1</version>
</dependency>
Installing those bundles fixed the issue - now all required bundles are active and I groovy script is executed once package with upgrade hook is installed. I am not sure whether this is the right way to go though - adding so many dependencies to make this work seems wrong
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies