You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Russell Bateman <ru...@windofkeltia.com> on 2020/07/13 21:24:35 UTC
Derby as DBCP service, error from Kerberos?
I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
For the first test, I start off vetting my ability to inject Derby as
the DBCP controller I want to use. But, right off, I get this Kerberos
error. I wasn't trying to use Kerberos, but maybe I'm missing
configuration to tell that to DBCPConnectionPool?
public void test() throws Exception
{
final DBCPConnectionPool service = new DBCPConnectionPool();
*java.lang.NoClassDefFoundError:
org/apache/nifi/kerberos/KerberosCredentialsService at
org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
at com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
< 26 internal calls> Caused by: java.lang.ClassNotFoundException:
org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls >
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
runner.addControllerService( "Derby service", service );
runner.setProperty( service, DBCPConnectionPool.DATABASE_URL, "jdbc:derby:memory:sampledb;create=true" );
runner.setProperty( service, DBCPConnectionPool.DB_USER, "sa" );
runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD, "sa" );
runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME, "org.apache.derby.jdbc.EmbeddedDriver" );
runner.enableControllerService( service );
runner.assertValid( service );
final DBCPService derbyService = ( DBCPService ) runner.getProcessContext()
.getControllerServiceLookup()
.getControllerService( "Derby service" );
// get and verify connections to Derby...
for( int count = 0; count < 10; count++ )
{
final Connection connection = service.getConnection();
if( VERBOSE )
System.out.println( connection );
assertNotNull( connection );
assertValidConnectionDerby( connection, count );
}
final Map< String, String > properties = new HashMap<>();
runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
runner.setIncomingConnection( false );
runner.setIncomingConnection( false );
runner.run();
}
Re: Derby as DBCP service, error from Kerberos?
Posted by Russell Bateman <ru...@windofkeltia.com>.
Oopsie! Okay, too early for my eyes to pick up on that difference.
Indeed, it works now. Thanks a million, Bryan!
On 7/14/20 8:25 AM, Bryan Bende wrote:
> The one I referenced is actually "nifi-kerberos-credentials-service-api"
> and you have "nifi-kerberos-credentials-service".
>
> On Tue, Jul 14, 2020 at 10:24 AM Russell Bateman <ru...@windofkeltia.com>
> wrote:
>
>> Thanks for the responses. I did have this dependency already before
>> mailing to the forum:
>>
>> <!-- Here's the version of NiFi we're targeting! -->
>> <nifi.version>1.11.0</nifi.version>
>> ...
>> <dependency>
>> <groupId>org.apache.nifi</groupId>
>> <artifactId>nifi-kerberos-credentials-service</artifactId>
>> <version>${nifi.version}</version>
>> </dependency>
>>
>> Other thoughts? I tried debugging through this as both test scope and no
>> specified scope. The result is the same.
>>
>>
>> On 7/14/20 8:12 AM, Matt Burgess wrote:
>>> Don't forget to include that service with "test" scope so it doesn't
>>> get included in the "real" bundle.
>>>
>>> On Tue, Jul 14, 2020 at 9:49 AM Bryan Bende <bb...@gmail.com> wrote:
>>>> It looks like you are missing a dependency in your project...
>>>>
>>>>
>> https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml#L50-L55
>>>> On Mon, Jul 13, 2020 at 5:24 PM Russell Bateman <ru...@windofkeltia.com>
>>>> wrote:
>>>>
>>>>> I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
>>>>> For the first test, I start off vetting my ability to inject Derby as
>>>>> the DBCP controller I want to use. But, right off, I get this Kerberos
>>>>> error. I wasn't trying to use Kerberos, but maybe I'm missing
>>>>> configuration to tell that to DBCPConnectionPool?
>>>>>
>>>>> public void test() throws Exception
>>>>> {
>>>>> final DBCPConnectionPool service = new DBCPConnectionPool();
>>>>>
>>>>> *java.lang.NoClassDefFoundError:
>>>>> org/apache/nifi/kerberos/KerberosCredentialsService at
>>>>>
>> org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
>>>>> at
>> com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
>>>>> < 26 internal calls> Caused by: java.lang.ClassNotFoundException:
>>>>> org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls
>>>>> at
>>>>>
>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
>>>>> at
>>>>>
>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>>>>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
>>>>>
>>>>> runner.addControllerService( "Derby service", service );
>>>>> runner.setProperty( service, DBCPConnectionPool.DATABASE_URL,
>>>>> "jdbc:derby:memory:sampledb;create=true" );
>>>>> runner.setProperty( service, DBCPConnectionPool.DB_USER,
>> "sa" );
>>>>> runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD,
>> "sa" );
>>>>> runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME,
>>>>> "org.apache.derby.jdbc.EmbeddedDriver" );
>>>>> runner.enableControllerService( service );
>>>>> runner.assertValid( service );
>>>>>
>>>>> final DBCPService derbyService = ( DBCPService )
>>>>> runner.getProcessContext()
>>>>>
>>>>> .getControllerServiceLookup()
>>>>>
>>>>> .getControllerService( "Derby service" );
>>>>>
>>>>> // get and verify connections to Derby...
>>>>> for( int count = 0; count < 10; count++ )
>>>>> {
>>>>> final Connection connection = service.getConnection();
>>>>> if( VERBOSE )
>>>>> System.out.println( connection );
>>>>> assertNotNull( connection );
>>>>> assertValidConnectionDerby( connection, count );
>>>>> }
>>>>>
>>>>> final Map< String, String > properties = new HashMap<>();
>>>>> runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
>>>>> runner.setIncomingConnection( false );
>>>>> runner.setIncomingConnection( false );
>>>>> runner.run();
>>>>> }
>>>>>
>>>>>
>>>>>
>>
Re: Derby as DBCP service, error from Kerberos?
Posted by Bryan Bende <bb...@gmail.com>.
The one I referenced is actually "nifi-kerberos-credentials-service-api"
and you have "nifi-kerberos-credentials-service".
On Tue, Jul 14, 2020 at 10:24 AM Russell Bateman <ru...@windofkeltia.com>
wrote:
> Thanks for the responses. I did have this dependency already before
> mailing to the forum:
>
> <!-- Here's the version of NiFi we're targeting! -->
> <nifi.version>1.11.0</nifi.version>
> ...
> <dependency>
> <groupId>org.apache.nifi</groupId>
> <artifactId>*nifi-kerberos-credentials-service*</artifactId>
> <version>${nifi.version}</version>
> </dependency>
>
> Other thoughts? I tried debugging through this as both test scope and no
> specified scope. The result is the same.
>
>
> On 7/14/20 8:12 AM, Matt Burgess wrote:
> > Don't forget to include that service with "test" scope so it doesn't
> > get included in the "real" bundle.
> >
> > On Tue, Jul 14, 2020 at 9:49 AM Bryan Bende <bb...@gmail.com> wrote:
> >> It looks like you are missing a dependency in your project...
> >>
> >>
> https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml#L50-L55
> >>
> >> On Mon, Jul 13, 2020 at 5:24 PM Russell Bateman <ru...@windofkeltia.com>
> >> wrote:
> >>
> >>> I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
> >>> For the first test, I start off vetting my ability to inject Derby as
> >>> the DBCP controller I want to use. But, right off, I get this Kerberos
> >>> error. I wasn't trying to use Kerberos, but maybe I'm missing
> >>> configuration to tell that to DBCPConnectionPool?
> >>>
> >>> public void test() throws Exception
> >>> {
> >>> final DBCPConnectionPool service = new DBCPConnectionPool();
> >>>
> >>> *java.lang.NoClassDefFoundError:
> >>> org/apache/nifi/kerberos/KerberosCredentialsService at
> >>>
> org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
> >>>
> >>> at
> com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
> >>> < 26 internal calls> Caused by: java.lang.ClassNotFoundException:
> >>> org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls
> >
> >>> at
> >>>
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
> >>>
> >>> at
> >>>
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> >>>
> >>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
> >>>
> >>> runner.addControllerService( "Derby service", service );
> >>> runner.setProperty( service, DBCPConnectionPool.DATABASE_URL,
> >>> "jdbc:derby:memory:sampledb;create=true" );
> >>> runner.setProperty( service, DBCPConnectionPool.DB_USER,
> "sa" );
> >>> runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD,
> "sa" );
> >>> runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME,
> >>> "org.apache.derby.jdbc.EmbeddedDriver" );
> >>> runner.enableControllerService( service );
> >>> runner.assertValid( service );
> >>>
> >>> final DBCPService derbyService = ( DBCPService )
> >>> runner.getProcessContext()
> >>>
> >>> .getControllerServiceLookup()
> >>>
> >>> .getControllerService( "Derby service" );
> >>>
> >>> // get and verify connections to Derby...
> >>> for( int count = 0; count < 10; count++ )
> >>> {
> >>> final Connection connection = service.getConnection();
> >>> if( VERBOSE )
> >>> System.out.println( connection );
> >>> assertNotNull( connection );
> >>> assertValidConnectionDerby( connection, count );
> >>> }
> >>>
> >>> final Map< String, String > properties = new HashMap<>();
> >>> runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
> >>> runner.setIncomingConnection( false );
> >>> runner.setIncomingConnection( false );
> >>> runner.run();
> >>> }
> >>>
> >>>
> >>>
>
>
Re: Derby as DBCP service, error from Kerberos?
Posted by Russell Bateman <ru...@windofkeltia.com>.
Thanks for the responses. I did have this dependency already before
mailing to the forum:
<!-- Here's the version of NiFi we're targeting! -->
<nifi.version>1.11.0</nifi.version>
...
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>*nifi-kerberos-credentials-service*</artifactId>
<version>${nifi.version}</version>
</dependency>
Other thoughts? I tried debugging through this as both test scope and no
specified scope. The result is the same.
On 7/14/20 8:12 AM, Matt Burgess wrote:
> Don't forget to include that service with "test" scope so it doesn't
> get included in the "real" bundle.
>
> On Tue, Jul 14, 2020 at 9:49 AM Bryan Bende <bb...@gmail.com> wrote:
>> It looks like you are missing a dependency in your project...
>>
>> https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml#L50-L55
>>
>> On Mon, Jul 13, 2020 at 5:24 PM Russell Bateman <ru...@windofkeltia.com>
>> wrote:
>>
>>> I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
>>> For the first test, I start off vetting my ability to inject Derby as
>>> the DBCP controller I want to use. But, right off, I get this Kerberos
>>> error. I wasn't trying to use Kerberos, but maybe I'm missing
>>> configuration to tell that to DBCPConnectionPool?
>>>
>>> public void test() throws Exception
>>> {
>>> final DBCPConnectionPool service = new DBCPConnectionPool();
>>>
>>> *java.lang.NoClassDefFoundError:
>>> org/apache/nifi/kerberos/KerberosCredentialsService at
>>> org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
>>>
>>> at com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
>>> < 26 internal calls> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls >
>>> at
>>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
>>>
>>> at
>>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>>>
>>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
>>>
>>> runner.addControllerService( "Derby service", service );
>>> runner.setProperty( service, DBCPConnectionPool.DATABASE_URL,
>>> "jdbc:derby:memory:sampledb;create=true" );
>>> runner.setProperty( service, DBCPConnectionPool.DB_USER, "sa" );
>>> runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD, "sa" );
>>> runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME,
>>> "org.apache.derby.jdbc.EmbeddedDriver" );
>>> runner.enableControllerService( service );
>>> runner.assertValid( service );
>>>
>>> final DBCPService derbyService = ( DBCPService )
>>> runner.getProcessContext()
>>>
>>> .getControllerServiceLookup()
>>>
>>> .getControllerService( "Derby service" );
>>>
>>> // get and verify connections to Derby...
>>> for( int count = 0; count < 10; count++ )
>>> {
>>> final Connection connection = service.getConnection();
>>> if( VERBOSE )
>>> System.out.println( connection );
>>> assertNotNull( connection );
>>> assertValidConnectionDerby( connection, count );
>>> }
>>>
>>> final Map< String, String > properties = new HashMap<>();
>>> runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
>>> runner.setIncomingConnection( false );
>>> runner.setIncomingConnection( false );
>>> runner.run();
>>> }
>>>
>>>
>>>
Re: Derby as DBCP service, error from Kerberos?
Posted by Matt Burgess <ma...@apache.org>.
Don't forget to include that service with "test" scope so it doesn't
get included in the "real" bundle.
On Tue, Jul 14, 2020 at 9:49 AM Bryan Bende <bb...@gmail.com> wrote:
>
> It looks like you are missing a dependency in your project...
>
> https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml#L50-L55
>
> On Mon, Jul 13, 2020 at 5:24 PM Russell Bateman <ru...@windofkeltia.com>
> wrote:
>
> > I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
> > For the first test, I start off vetting my ability to inject Derby as
> > the DBCP controller I want to use. But, right off, I get this Kerberos
> > error. I wasn't trying to use Kerberos, but maybe I'm missing
> > configuration to tell that to DBCPConnectionPool?
> >
> > public void test() throws Exception
> > {
> > final DBCPConnectionPool service = new DBCPConnectionPool();
> >
> > *java.lang.NoClassDefFoundError:
> > org/apache/nifi/kerberos/KerberosCredentialsService at
> > org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
> >
> > at com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
> > < 26 internal calls> Caused by: java.lang.ClassNotFoundException:
> > org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls >
> > at
> > java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
> >
> > at
> > java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> >
> > at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
> >
> > runner.addControllerService( "Derby service", service );
> > runner.setProperty( service, DBCPConnectionPool.DATABASE_URL,
> > "jdbc:derby:memory:sampledb;create=true" );
> > runner.setProperty( service, DBCPConnectionPool.DB_USER, "sa" );
> > runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD, "sa" );
> > runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME,
> > "org.apache.derby.jdbc.EmbeddedDriver" );
> > runner.enableControllerService( service );
> > runner.assertValid( service );
> >
> > final DBCPService derbyService = ( DBCPService )
> > runner.getProcessContext()
> >
> > .getControllerServiceLookup()
> >
> > .getControllerService( "Derby service" );
> >
> > // get and verify connections to Derby...
> > for( int count = 0; count < 10; count++ )
> > {
> > final Connection connection = service.getConnection();
> > if( VERBOSE )
> > System.out.println( connection );
> > assertNotNull( connection );
> > assertValidConnectionDerby( connection, count );
> > }
> >
> > final Map< String, String > properties = new HashMap<>();
> > runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
> > runner.setIncomingConnection( false );
> > runner.setIncomingConnection( false );
> > runner.run();
> > }
> >
> >
> >
Re: Derby as DBCP service, error from Kerberos?
Posted by Bryan Bende <bb...@gmail.com>.
It looks like you are missing a dependency in your project...
https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml#L50-L55
On Mon, Jul 13, 2020 at 5:24 PM Russell Bateman <ru...@windofkeltia.com>
wrote:
> I'm trying to use Apache Derby as the DBCP controller in JUnit tests.
> For the first test, I start off vetting my ability to inject Derby as
> the DBCP controller I want to use. But, right off, I get this Kerberos
> error. I wasn't trying to use Kerberos, but maybe I'm missing
> configuration to tell that to DBCPConnectionPool?
>
> public void test() throws Exception
> {
> final DBCPConnectionPool service = new DBCPConnectionPool();
>
> *java.lang.NoClassDefFoundError:
> org/apache/nifi/kerberos/KerberosCredentialsService at
> org.apache.nifi.dbcp.DBCPConnectionPool.<clinit>(DBCPConnectionPool.java:243)
>
> at com.windofkeltia.processor.TestWithDerby.test(TestWithDerby.java:111)
> < 26 internal calls> Caused by: java.lang.ClassNotFoundException:
> org.apache.nifi.kerberos.KerberosCredentialsService < 2 internal calls >
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
>
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ...*
>
> runner.addControllerService( "Derby service", service );
> runner.setProperty( service, DBCPConnectionPool.DATABASE_URL,
> "jdbc:derby:memory:sampledb;create=true" );
> runner.setProperty( service, DBCPConnectionPool.DB_USER, "sa" );
> runner.setProperty( service, DBCPConnectionPool.DB_PASSWORD, "sa" );
> runner.setProperty( service, DBCPConnectionPool.DB_DRIVERNAME,
> "org.apache.derby.jdbc.EmbeddedDriver" );
> runner.enableControllerService( service );
> runner.assertValid( service );
>
> final DBCPService derbyService = ( DBCPService )
> runner.getProcessContext()
>
> .getControllerServiceLookup()
>
> .getControllerService( "Derby service" );
>
> // get and verify connections to Derby...
> for( int count = 0; count < 10; count++ )
> {
> final Connection connection = service.getConnection();
> if( VERBOSE )
> System.out.println( connection );
> assertNotNull( connection );
> assertValidConnectionDerby( connection, count );
> }
>
> final Map< String, String > properties = new HashMap<>();
> runner.setProperty( TestWithDerby.DBCP_SERVICE, "Derby service" );
> runner.setIncomingConnection( false );
> runner.setIncomingConnection( false );
> runner.run();
> }
>
>
>