Solved! Go to Solution.
Views
Replies
Total Likes
Are you using Maven and Adobe Archetype as part of using this tool? I have not heard of community using this tool. I am wondering if this is compatibility issues with this tool and OSGi libs.
I would recommend using Maven and Adobe Archetype - there are no issues with these OSGi libs. See:
Creating your first AEM Service using an Adobe Maven Archetype project
Views
Replies
Total Likes
I am facing issue similar to http://stackoverflow.com/questions/32294587/what-maven-dependency-do-i-need-to-load-an-osgi-framewor...
but the solution mentioned is not working for me using hudson.
Please provide inputs
Views
Replies
Total Likes
Are you using Maven and Adobe Archetype as part of using this tool? I have not heard of community using this tool. I am wondering if this is compatibility issues with this tool and OSGi libs.
I would recommend using Maven and Adobe Archetype - there are no issues with these OSGi libs. See:
Creating your first AEM Service using an Adobe Maven Archetype project
Views
Replies
Total Likes
I am using AEM5.6.1 and Maven with Adobe Archetype
I am using the below code see below issues coming up. It seems to be getting resolved in ecllispe but does not get resolved in Hudson build.I have added the required external jar in hudson still the issue is coming up
BundleContext bc= FrameworkUtil.getBundle(
A.class).getBundleContext();
I tried using google with same problem but did solve the issue in Hudson.
Views
Replies
Total Likes
instead of using BundleContext you can load the context using @Reference
Views
Replies
Total Likes
I tried using the below code.The code got complied but in the felix console i find that
the component is unstasified
Reference bundleContext ["Unsatisfied","Service Name: org.osgi.framework.BundleContext","Multiple: single","Optional: mandatory","Policy: static","No Services bound"]
The exact code i am using is. let me know if you have suggestions
public class A implements EventHandler, JobProcessor {
@Reference
private BundleContext bundleContext;
Logger log = LoggerFactory.getLogger(this.getClass());
@Override
public void handleEvent(Event event) {
if ((null != event && event.getTopic().equals(
ReplicationAction.EVENT_TOPIC))) {
// adopt the Sling's job model to guarantee execution
if (EventUtil.isLocal(event)) {
JobUtil.processJob(event, this);
}
}
}
@Override
public boolean process(Event event) {
//Bundle bundle=FrameworkUtil.getBundle(A.class);
//BundleContext bundleContext = bundle.getBundleContext();
String filter = "(process.label=testing)"; // the
@SuppressWarnings("rawtypes")
ServiceReference[] serviceReferences = null;
try {
serviceReferences = bundleContext.getServiceReferences(
com.day.cq.workflow.exec.WorkflowProcess.class.getName(),
filter);
} catch (Exception e) {
log.debug("Exception in getting the service references: "
+ e.getMessage());
}
Views
Replies
Total Likes
I tried using the below instead of FrameworkUtil it sloved the issue.Please let me know if the below code is correct ??
protected void activate(ComponentContext c) throws Exception {
bundleContext = c.getBundleContext();
}
protected void deactivate(ComponentContext context) {
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies