I developed a basic project as an OSGI bundle.
I tested it by installing it using http://localhost:4502/system/console/bundles. The bundle shows as active.
Then I switch to http://localhost:4502/system/console/services and the services of the bundle show.
Later after doing some development, my bundle installs and shows as active. But its methods no longer appears in the services interface. And they cannot be accessed using sling.getService.
What can cause this and how does one go about testing to see what caused it to stop being a service.
Solved! Go to Solution.
Views
Replies
Total Likes
Your component is abstract - which means it doesn't actually get registered as a service. See http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html...
Views
Replies
Total Likes
AFAIK there is no method names displayed in tab http://localhost:4502/system/console/services
Views
Replies
Total Likes
Please forgive my terminology.
For example
I have
In the console/bundles
397 | 1.0.0 | Active |
In the console/services
2878 | [getspecials.nigeria.shoprite.HelloService] | getspecials.nigeria.shoprite.getwigroupspecials (397) |
Then I upload
398 | 1.0.0.SNAPSHOT | Active |
|
in the console/services
2882 | [com.shoprite.specialsandcoupons.HelloService] | com.shoprite.specialsandcoupons.specialsandcoupons-bundle (398) |
But I do not see the method inside my bundle
I left the default Interface HelloService and its implementation.
I also created a new interface
public interface SpecialsAndCoupons {}
and its implementation class
package com.shoprite.specialsandcoupons.impl;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.TreeSet;
import org.xml.sax.InputSource;
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.shoprite.specialsandcoupons.SpecialsAndCoupons;
import Objects.Items;
@Component(componentAbstract=true)
@Service
public class SpecialsAndCouponsImpl implements SpecialsAndCoupons {
But I do not see com.shoprite.specialsandcoupons.SpecialsAndCoupons on http://localhost:4502/system/console/services
Views
Replies
Total Likes
If i understood you question correctly, There are two services in same bundle and only one is listed but not both. Is that correct?
If everything defined correctly it should not be the case. Sort by bundles column in [1] and verify. Also when you redeploy bundle by adding new service please make sure to higher up the version number.
Views
Replies
Total Likes
Your component is abstract - which means it doesn't actually get registered as a service. See http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html...
Views
Replies
Total Likes