Skip to content

[Bug] Function Java Instance cannot be started if no typeClassName provided #18110

Closed

Description

@freeznet

Search before asking

  • I searched in the issues and found nothing similar.

Version

2.8.3

Minimal reproduce step

Manually start pulsar function with java command directly without typeClassName provided in function_details, like

java -cp /pulsar/instances/java-instance.jar:/pulsar/instances/deps/* -Dpulsar.functions.extra.dependencies.dir=/pulsar/instances/deps -Dpulsar.functions.instance
.classpath=/pulsar/conf:::/pulsar/lib/*: -Dlog4j.configurationFile=/pulsar/conf/functions_log4j2.xml -Dpulsar.function.log.dir=logs//functions/public/default/example -Dpulsar.function.log.fil
e=example-0 -Dio.netty.tryReflectionSetAccessible=true -Xmx1073741824 org.apache.pulsar.functions.instance.JavaInstanceMain --jar /pulsar/download/pulsar_functions/public/default/example/0/ap
i-examples.jar --instance_id 0 --function_id 7fcdb3b3-79f7-4c1e-a100-96b3cc32c958 --function_version f879debb-6698-4ecb-9a04-c9fc1d2a0c6b --function_details '{"tenant":"public","namespace":"d
efault","name":"example","className":"org.apache.pulsar.functions.windowing.WindowFunctionExecutor","logTopic":"log_topic","userConfig":"{\"PublishTopic\":\"test_result\",\"__WINDOWCONFIGS__\
":{\"windowLengthCount\":10,\"slidingIntervalCount\":5,\"actualWindowFunctionClassName\":\"org.apache.pulsar.functions.api.examples.window.LoggingWindowFunction\"}}","parallelism":1,"source":
{"inputSpecs":{"test_src":{}},"cleanupSubscription":true},"sink":{"topic":"test_result","forwardSourceMessageProperty":true
},"resources":{"cpu":1.0,"ram":"1073741824","disk":"10737418240"},"componentType":"FUNCTION"}' --pulsar_serviceurl pulsar://localhost:6650 --max_buffered_tuples 1024 --port 42223 --metrics_po
rt 42623 --pending_async_requests 1000 --state_storage_serviceurl bk://127.0.0.1:4181 --expected_healthcheck_interval 30 --secrets_provider org.apache.pulsar.functions.secretsprovider.ClearTe
xtSecretsProvider --cluster_name standalone --nar_extraction_directory /tmp

What did you expect to see?

Function Run as normal

What did you see instead?

2022-10-19T09:27:58,276+0000 [public/default/example-0] ERROR org.apache.pulsar.functions.instance.JavaInstanceRunnable - Source open produced uncaught exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.StringLatin1.charAt(StringLatin1.java:47) ~[?:?]
	at java.lang.String.charAt(String.java:693) ~[?:?]
	at org.apache.pulsar.common.util.Reflections.loadClass(Reflections.java:306) ~[io.streamnative-pulsar-common-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.source.SingleConsumerPulsarSource.open(SingleConsumerPulsarSource.java:64) ~[io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setupInput(JavaInstanceRunnable.java:755) [io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setup(JavaInstanceRunnable.java:232) [io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:260) [io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-10-19T09:27:58,286+0000 [public/default/example-0] ERROR org.apache.pulsar.functions.instance.JavaInstanceRunnable - [public/default/example:0] Uncaught exception in Java Instance
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.StringLatin1.charAt(StringLatin1.java:47) ~[?:?]
	at java.lang.String.charAt(String.java:693) ~[?:?]
	at org.apache.pulsar.common.util.Reflections.loadClass(Reflections.java:306) ~[io.streamnative-pulsar-common-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.source.SingleConsumerPulsarSource.open(SingleConsumerPulsarSource.java:64) ~[io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setupInput(JavaInstanceRunnable.java:755) ~[io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setup(JavaInstanceRunnable.java:232) ~[io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:260) [io.streamnative-pulsar-functions-instance-2.9.2.23.jar:2.9.2.23]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Oct 19, 2022
  2. self-assigned this
    on Oct 19, 2022
  3. github-actions commented on Nov 19, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  4. freeznet commented on Jan 31, 2023

    @freeznet
    ContributorAuthor

    close by #18111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Staletype/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions