Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest changes to .bnd file breaks bundle build with error "Cannot convert Class[] to Class" #3

Open
GoogleCodeExporter opened this issue Apr 9, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Revert the version back to r14

What is the expected output? What do you see instead?
Undoing the changes allows the build to work.

What version of the product are you using? On what operating system?
CentOS 6 x64, Java1.6, CRX 2.2.0

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Dec 2012 at 12:51

@GoogleCodeExporter
Copy link
Author

Facing the same problem. Any fixes?

Original comment by [email protected] on 11 Mar 2013 at 12:52

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 11 Mar 2013 at 3:12

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 20 Dec 2013 at 5:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant