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

[BUG] ClassNotFoundException: io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic #864

Open
emmanuelGuiton opened this issue Mar 23, 2023 · 2 comments
Labels

Comments

@emmanuelGuiton
Copy link

Describe the bug
I am trying to configure Basic AMQP authentication using apachepulsar/pulsar
Docker image + AoP. I can successfully install the protocol handler. When I register the io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic provider in the standalone.conf authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderBasic,io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic I get a ClassNotFoundException :

2023-03-23T16:15:58,773+0000 [main] ERROR org.apache.pulsar.broker.PulsarService - Failed to start Pulsar service: Failed to load an authentication provider.
org.apache.pulsar.broker.PulsarServerException: Failed to load an authentication provider.
       at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:81) ~[org.apache.pulsar-pulsar-broker-common-2.11.0.jar:2.11.0]
       at org.apache.pulsar.broker.service.BrokerService.<init>(BrokerService.java:348) ~[org.apache.pulsar-pulsar-broker-2.11.0.jar:2.11.0]
       at org.apache.pulsar.broker.PulsarService.newBrokerService(PulsarService.java:1839) ~[org.apache.pulsar-pulsar-broker-2.11.0.jar:2.11.0]
       at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:756) ~[org.apache.pulsar-pulsar-broker-2.11.0.jar:2.11.0]
       at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:348) ~[org.apache.pulsar-pulsar-broker-2.11.0.jar:2.11.0]
       at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:141) ~[org.apache.pulsar-pulsar-broker-2.11.0.jar:2.11.0]
Caused by: java.lang.ClassNotFoundException: io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic
       at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
       at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[?:?]
       at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
       at java.lang.Class.forName0(Native Method) ~[?:?]
       at java.lang.Class.forName(Class.java:375) ~[?:?]
       at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:57) ~[org.apache.pulsar-pulsar-broker-common-2.11.0.jar:2.11.0]
       ... 5 more

What am I doing wrong ?

To Reproduce
Steps to reproduce the behavior:

  1. Write a Dockerfile to install the AoP NAR file in the apachepulsar/pulsar image
  2. Add io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic to the authenticationProviders parameter in the standalone.conf file.
  3. Run the image with the command bin/pulsar standalone
  4. Look for the error in the logs.

Expected behavior
The basic authentication provider for AMQP should register successfully.

Additional context
Using Pulsar 2.11.0 and AoP 2.11.0.3

@emmanuelGuiton
Copy link
Author

emmanuelGuiton commented Mar 27, 2023

Note that the result is the same when I use the streamnative/sn-pulsar:2.10.3.6 image instead of building a custom image with only the AoP plugin.

2023-03-27T15:22:35,177+0000 [main] ERROR org.apache.pulsar.broker.PulsarService - Failed to start Pulsar service: Failed to load an authentication provider.
org.apache.pulsar.broker.PulsarServerException: Failed to load an authentication provider.
        at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:80) ~[io.streamnative-pulsar-broker-common-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.service.BrokerService.<init>(BrokerService.java:344) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.newBrokerService(PulsarService.java:1757) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:699) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:301) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:143) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
Caused by: java.lang.ClassNotFoundException: io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic
        at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[?:?]
        at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:315) ~[?:?]
        at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:56) ~[io.streamnative-pulsar-broker-common-2.10.3.6.jar:2.10.3.6]
        ... 5 more
2023-03-27T15:22:35,182+0000 [main] ERROR org.apache.pulsar.PulsarStandaloneStarter - Failed to start pulsar service.
org.apache.pulsar.broker.PulsarServerException: org.apache.pulsar.broker.PulsarServerException: Failed to load an authentication provider.
        at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:840) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:301) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:143) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
Caused by: org.apache.pulsar.broker.PulsarServerException: Failed to load an authentication provider.
        at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:80) ~[io.streamnative-pulsar-broker-common-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.service.BrokerService.<init>(BrokerService.java:344) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.newBrokerService(PulsarService.java:1757) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:699) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        ... 2 more
Caused by: java.lang.ClassNotFoundException: io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic
        at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[?:?]
        at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:315) ~[?:?]
        at org.apache.pulsar.broker.authentication.AuthenticationService.<init>(AuthenticationService.java:56) ~[io.streamnative-pulsar-broker-common-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.service.BrokerService.<init>(BrokerService.java:344) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.newBrokerService(PulsarService.java:1757) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:699) ~[io.streamnative-pulsar-broker-2.10.3.6.jar:2.10.3.6]
        ... 2 more

@emmanuelGuiton
Copy link
Author

emmanuelGuiton commented Apr 6, 2023

Well, I finally noticed that the io.streamnative.pulsar.handlers.amqp.authentication.AuthenticationProviderBasic class does not exist in version 2.10.x . So my second comment is pointless.

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

No branches or pull requests

1 participant