Dave, In addition to the points that Aldrin brought up, are your CacheService interface and StandardCacheService classes in the same NAR?
If they are not in the same NAR, does your NAR for StandardCacheService have a Maven dependency on the NAR that houses CacheService? Thanks -Mark ---------------------------------------- > From: aldrinp...@gmail.com > Date: Mon, 27 Jul 2015 23:26:58 -0400 > Subject: Re: Help required with my custom controller service > To: dev@nifi.apache.org; davidrsm...@btinternet.com > > Dave, > > Some quick notes as I work through your setup. > > Did you create an entry in your > NAR's org.apache.nifi.controller.ControllerService file? This would be in > src/main/resources/META-INF/services directory of your project. It seems > like this isn't likely the case, but a point that can sometimes get > overlooked. > > Your accessing of the service property in your processor looks good. > > Did you accidentally override AbstractControllerService#getIdentifier()? > It seems like this could lead to the error you are seeing, but it is hard > to be sure. > > If you are able to share more code with us, we can provide some more > pointed assistance. Have you managed to get your processor and controller > service running within the test framework [1]? If not, I would suggest > doing so to cut down on iterations in debugging your problems as well as > providing a means for you to easily step through the code. > > [1] http://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#testing > > On Sun, Jul 26, 2015 at 4:45 PM, DAVID SMITH <davidrsm...@btinternet.com> > wrote: > >> Hi >> I have been trying to write a simple Cache Controller Service that uses a >> Map to hold <String, String> key/value pairs. I am using >> nifi-0.1.0-incubating. I have created an Interface called CacheService >> which extends ControllerService.public interface CacheService extends >> ControllerService { >> >> I have created an implementation called StandardCacheService which is as >> follows: >> public class StandardCacheService extends AbstractControllerService >> implements CacheService { >> I have compiled the StandardCacheService and created a nar which I have >> then put into my NiFi lib directory, my StandardCacheService Controller >> Service appears in the Controller services tab of the NiFi Flow Settings >> panel, I can edit it and enable it. Also there are no abnormal log messages. >> However, when I try to configure the CacheService in my test Processor, >> again I get no errors but when I cannot see my StandardCacheService. My >> processor has the following snippets to implement the Cache >> Service/Controller: >> public static final PropertyDescriptor CACHE_SERVICE = new >> PropertyDescriptor.Builder() >> .name("Cache Service") >> .description("The Controller Service to use in order to obtain a >> Cache Service") >> .required(false) >> .identifiesControllerService(CacheService.class) >> .build(); >> >> final CacheService cache = >> context.getProperty(CACHE_SERVICE).asControllerService(CacheService.class); >> >> >> >> >> When configuring the processor, the 'Cache Service' drop down doesn't show >> a populated list showing my StandardCacheService, but it does allow me to >> create a new service, the resulting panel allows me to then select >> StandardCacheService. When I select 'create' I get a UUID value in the >> Value property of the Configure Processor panel. When I then apply this >> the processor shows a yellow triangle, when I hover over it I get the >> following message: >> 'Cache Service validated against <UUID> is invalid because Invalid >> Controller service <UUID> is not a valid Controller service Identifier or >> does not reference the correct type of Controller service.' >> Can you help please >> Many thanksDave >> >>