yuruguo commented on a change in pull request #12315:
URL: https://github.com/apache/pulsar/pull/12315#discussion_r726728444
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java
##########
@@ -285,11 +292,12 @@ boolean run(String[] args, Function<PulsarAdminBuilder, ?
extends PulsarAdmin> a
public static void main(String[] args) throws Exception {
lastExitCode = 0;
- String configFile = null;
- if (args.length > 0) {
- configFile = args[0];
- args = Arrays.copyOfRange(args, 1, args.length);
+ if (args.length == 0) {
Review comment:
**About `NPE`**
The `conf/client.conf` is not configured with `webServiceUrl` and
`brokerServiceUrl` , as below:
```
# URL for Pulsar REST API (for admin operations)
# For TLS:
# webServiceUrl=https://localhost:8443/
# URL for Pulsar Binary Protocol (for produce and consume operations)
# For TLS:
# brokerServiceUrl=pulsar+ssl://localhost:6651/
```
and the `bin/pulsar-admin` does not specify `--admin-url`, as below:
```
./pulsar-admin topics list-partitioned-topics test/app1
```
then NPE will occur.
The root cause of this problem is that NPE appeared due to
`serviceUrl==null` when PulsarAdminImpl was created, source
code(PulsarAdminImpl.java#L191):
https://github.com/apache/pulsar/blob/8505422b784e1d89db68a0196a93229609c10903/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminImpl.java#L166-L168
https://github.com/apache/pulsar/blob/8505422b784e1d89db68a0196a93229609c10903/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminImpl.java#L191
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]