Open GoogleCodeExporter opened 8 years ago
Facing the same problem. Any fixes?
Original comment by asaj...@gmail.com
on 11 Mar 2013 at 12:52
Go to "Source" tab in this project and view changes for revision r15. Expand
the file to see that the "/*" comments were deleted and the "@" comments were
added. Just reverse this change in your local version of the file and it should
work fine.
Original comment by clwal...@gmail.com
on 11 Mar 2013 at 3:12
Commenting out this service annotation is not correct. It looks like the code
has not been updated for CRX 2.2. Also needed to add a couple of @Reference
annotations.
Here are the changes that I made to RankingServiceImpl.java file to get this to
work:
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
/**
* Default implementation of the ranking service.
* The ranking is updated through observation (based on OSGi events).
* The service can be used by clients to get the highest ranked products.
*/
@Component(immediate = true)
// The @Service annotation was changed in Fec 2013 to:
// FELIX-2753 : Support array of classes for @Service annotation
// The original code below attempts to initialise this array but the version
// of Felix in CRX 2.2 does not support this.
// This error is documented in
// http://code.google.com/p/crxzon/issues/detail?id=3#makechanges
// @Service(value = {RankingService.class, EventHandler.class})
// Changing to simply @Service registers all implmented interfaces
// as services but it looks like only RankingService is used.
// @Service
@Service(value = RankingService.class)
@Property(name = org.osgi.service.event.EventConstants.EVENT_TOPIC, value =
SlingConstants.TOPIC_RESOURCE_ADDED)
public class RankingServiceImpl
implements RankingService, EventHandler, Runnable {
private Logger logger = LoggerFactory.getLogger(this.getClass());
// private Logger logger = LoggerFactory.getLogger("RankingServiceImpl");
private static final String PROPERTY_PREV_RANKING = "lowerRankingRef";
private static final String PROPERTY_NEXT_RANKING = "higherRankingRef";
private static final int SHOW_HIGHEST_RANKING = 3;
/** Flag for stopping the background service. */
private volatile boolean running = false;
/** A local queue for handling new orders. */
protected final BlockingQueue<String> orders = new LinkedBlockingQueue<String>();
/** @scr.reference */
@Reference
private SlingRepository repository;
/** @scr.reference */
@Reference
private ResourceResolverFactory resourceResolverFactory;
/** Cache for the highest ranking paths. */
Original comment by dmc7...@gmail.com
on 20 Dec 2013 at 5:24
Original issue reported on code.google.com by
clwal...@gmail.com
on 19 Dec 2012 at 12:51