Hi,
I have a question regarding "use of third party jar" in AEM 6.0 SP2. I am listing down steps which i performed, hoping to get some solution :
I can see that jar/class is available through "depfinder" but its not getting picked up by my custom workflow class. Any suggestion to debug would be really helpful.
~TD
Solved! Go to Solution.
Views
Replies
Total Likes
See this community article that uses two OSGi bundles. One that defines a sling servlet - the main OSGi. The other uses a bundle fragment that wraps simple JSON JAR into an OSGi fragment.
https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
Now in this example - we need to include simple JSON package in our POM file:
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
Make sure that you are including dependencies in your POM file to lists the packages in the OSGi fragments.
This is maybe where your issue came from. If you build a custom JAR and loaded them into AEM via OSGi fragment/felix - that is all good.
However - in your Maven POM file - you still need to include them as dependencies so your main OSGi bundle can use the classes. However - the custom JAR files are not located in a public Maven repo -- like the simple JSON JAR is.
In your case - you need to setup Maven to use a local repo. See:
http://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-in-maven-project
Views
Replies
Total Likes
The issue seems to be with the OSGi bundle that contains your custom workflow class.
Looks like your successfully deployed the OCGi fragments and that contain the custom classes.
Does this OSGi bundle contain a Manifest file that includes packages defined in the custom JARs?
For example:
Manifest-Version: 1.0
Bnd-LastModified: 1414596063210
Build-Jdk: 1.7.0_67
Built-By: scottm
Bundle-Description: Maven Multimodule project for restful-training.
Bundle-ManifestVersion: 2
Bundle-Name: restful-training Bundle
Bundle-SymbolicName: com.adobe.restservice.restful-bundle
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: com.adobe.restservice;uses:="org.apache.http.impl.client
,org.apache.http.conn,org.apache.http.client.methods,org.apache.http,or
g.osgi.framework,org.osgi.service.component,org.slf4j";version="1.0.0.S
NAPSHOT"
Import-Package: org.apache.http,org.apache.http.client.methods,org.apach
e.http.conn,org.apache.http.impl.client,org.osgi.framework;version="[1.
5,2)",org.osgi.service.component;version="[1.1,2)",org.slf4j;version="[
1.5,2)"
Service-Component: OSGI-INF/serviceComponents.xml
Tool: Bnd-1.50.0
Views
Replies
Total Likes
If you do not have the import section in the MF file (that pulls in the packages defined in the custom JARS and deployed as fragments)- then you will encounter errors.
Views
Replies
Total Likes
See this community article that uses two OSGi bundles. One that defines a sling servlet - the main OSGi. The other uses a bundle fragment that wraps simple JSON JAR into an OSGi fragment.
https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
Now in this example - we need to include simple JSON package in our POM file:
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
Make sure that you are including dependencies in your POM file to lists the packages in the OSGi fragments.
This is maybe where your issue came from. If you build a custom JAR and loaded them into AEM via OSGi fragment/felix - that is all good.
However - in your Maven POM file - you still need to include them as dependencies so your main OSGi bundle can use the classes. However - the custom JAR files are not located in a public Maven repo -- like the simple JSON JAR is.
In your case - you need to setup Maven to use a local repo. See:
http://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-in-maven-project
Views
Replies
Total Likes
Views
Likes
Replies