Skip to content

Jersey library conflict in Pulsar Functions #8089

Closed

Description

@YArane

Describe the bug
Making a call to the Pulsar Admin API from a Pulsar Function throws a java.lang.IllegalStateException: InjectionManagerFactory not found exception.

To Reproduce

  1. Run pulsar standalone 2.6.1
  2. Deploy a Function which creates a PulsarAdmin object and make any call using the api
    Example:
public class CursorManagementFunction implements Function<String, Void> {

    PulsarAdmin admin = PulsarAdmin.builder()
      .connectionTimeout(120, TimeUnit.SECONDS)
      .readTimeout(120, TimeUnit.SECONDS)
      .serviceHttpUrl("http://127.0.0.1:8080")
      .build()

    MessageId prevMessageId;

    @Override
    public void process(String input, Context context) {
       String topic = context.getCurrentRecord().getTopicName()
       String subName = context.getFunctionName
       admin.topics().resetCursor(topic, subName, prevMessageId);
    }
}

Expected behavior
Call to PulsarAdmin is successful

Error thrown

java.lang.IllegalStateException: InjectionManagerFactory not found.
	at org.apache.pulsar.shade.org.glassfish.jersey.internal.inject.Injections.lambda$lookupInjectionManagerFactory$0(Injections.java:98) ~[?:?]
	at java.util.Optional.orElseThrow(Optional.java:290) ~[?:1.8.0_242]
	at org.apache.pulsar.shade.org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:98) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:68) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:432) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:341) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:826) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:143) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:112) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:108) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:99) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.method(JerseyInvocation.java:706) ~[?:?]
	at org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.get(JerseyInvocation.java:566) ~[?:?]
	at org.apache.pulsar.client.admin.internal.BaseResource.asyncGetRequest(BaseResource.java:168) ~[org.apache.pulsar-pulsar-client-admin-original-2.6.1.jar:2.6.1]

Desktop (please complete the following information):

  • OS: MacOS
  • Pulsar Standalone 2.6.1

Activity

  1. added
    type/bug
    on Sep 18, 2020
  2. added a commit that references this issue on Feb 2, 2021
    0469dfe
  3. added a commit that references this issue on Apr 6, 2021
    91cb1d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/functiontype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions