Not at my keyboard but does your NAR have the nifi-standard-services-api-nar as 
a parent? That should be where DBCPService is defined

Sent from my iPhone

> On Jun 22, 2020, at 6:30 PM, Russell Bateman <r...@windofkeltia.com> wrote:
> 
> I find myself obliged to pick back up a custom processor, written by someone 
> else a few years ago (in the NiFi 0.7.x era)  at my company, that makes use 
> of DBCPService. While I think I understand the nuances of interface versus 
> concrete controller class, etc. I probably need a push out the door onto the 
> road of understanding why NiFi is not starting (and it's my fault). My JUnit 
> test code works fine; I've created myself a loading problem maybe because I'm 
> not including the proper auxiliary NAR (in this new, reduced world)? Thanks!
> 
> 2020-06-22 16:11:37,139 ERROR [main] org.apache.nifi.NiFi Failure to launch 
> NiFi due to java.util.ServiceConfigurationError: 
> org.apache.nifi.processor.Processor: Provider 
> com.imatsolutions.processor.JdbcToAttributes could not be instantiated
> java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: 
> Provider com.imatsolutions.processor.JdbcToAttributes could not be 
> instantiated
>     at java.util.ServiceLoader.fail(ServiceLoader.java:232)
>     at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
>     at 
> java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
>     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
>     at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
>     at 
> org.apache.nifi.nar.StandardExtensionDiscoveringManager.loadExtensions(StandardExtensionDiscoveringManager.java:156)
>     at 
> org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:131)
>     at 
> org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:117)
>     at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:942)
>     at org.apache.nifi.NiFi.<init>(NiFi.java:158)
>     at org.apache.nifi.NiFi.<init>(NiFi.java:72)
>     at org.apache.nifi.NiFi.main(NiFi.java:301)
> *Caused by: java.lang.NoClassDefFoundError: org/apache/nifi/dbcp/DBCPService*
>     at com.imatsolutions.processor.JdbcCommon.<clinit>(JdbcCommon.java:31)
>     at 
> com.imatsolutions.processor.AbstractJdbcTo.<clinit>(AbstractJdbcTo.java:290)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>     at java.lang.Class.newInstance(Class.java:442)
>     at 
> java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
>     ... 9 common frames omitted
> Caused by: java.lang.ClassNotFoundException: org.apache.nifi.dbcp.DBCPService
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
>     ... 17 common frames omitted
> 
> I'm doing stuff like this inside my custom processor. (I hope this gives 
> enough to go on.)
> 
> public class JdbcToAttributes...
> {
>     public static final PropertyDescriptor DBCP_SERVICE = new 
> PropertyDescriptor.Builder()
>             .name( "Database Connection Pooling Service" )
>             .description( "The controller service that is used to obtain 
> connection to database" )
>             .required( true )
>             .identifiesControllerService( DBCPService.class )
>             .build();
>   ...
> 
> public void onTrigger( final ProcessContext context, final ProcessSession 
> session, ProcessSessionFactory factory )
>             throws ProcessException
>   {
>     ...
> 
>     final DBCPService dbcpService = context.getProperty( DBCP_SERVICE 
> ).asControllerService( DBCPService.class );
>     etc.
> 
> 
> 

Reply via email to