diff --git a/pulsar-sql/presto-distribution/pom.xml b/pulsar-sql/presto-distribution/pom.xml index bc0acfe4358eb..fcfac6701a960 100644 --- a/pulsar-sql/presto-distribution/pom.xml +++ b/pulsar-sql/presto-distribution/pom.xml @@ -36,7 +36,6 @@ 2.31 332 - 2.31 0.170 2.6 0.0.12 @@ -85,30 +84,6 @@ ${jersey.version} - - org.glassfish.jersey.core - jersey-server - ${jersey.version} - - - - org.glassfish.jersey.inject - jersey-hk2 - ${jersey.version} - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - ${jersey.version} - - - - org.glassfish.jersey.containers - jersey-container-servlet - ${jersey.version} - - io.prestosql presto-main diff --git a/pulsar-sql/presto-pulsar/pom.xml b/pulsar-sql/presto-pulsar/pom.xml index f99ce7f756171..d6f87f938e0b4 100644 --- a/pulsar-sql/presto-pulsar/pom.xml +++ b/pulsar-sql/presto-pulsar/pom.xml @@ -107,12 +107,6 @@ ${presto.version} - - ${project.groupId} - pulsar-client-original - ${project.version} - - io.prestosql presto-main diff --git a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSqlSchemaInfoProvider.java b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSqlSchemaInfoProvider.java index fe9b6198ea086..3a9233c3d872b 100644 --- a/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSqlSchemaInfoProvider.java +++ b/pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSqlSchemaInfoProvider.java @@ -38,6 +38,7 @@ import org.apache.pulsar.common.protocol.schema.BytesSchemaVersion; import org.apache.pulsar.common.schema.SchemaInfo; import org.apache.pulsar.common.util.FutureUtil; +import org.glassfish.jersey.internal.inject.InjectionManagerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -98,8 +99,14 @@ public String getTopicName() { } private SchemaInfo loadSchema(BytesSchemaVersion bytesSchemaVersion) throws PulsarAdminException { - return pulsarAdmin.schemas() - .getSchemaInfo(topicName.toString(), ByteBuffer.wrap(bytesSchemaVersion.get()).getLong()); + ClassLoader originalContextLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(InjectionManagerFactory.class.getClassLoader()); + return pulsarAdmin.schemas() + .getSchemaInfo(topicName.toString(), ByteBuffer.wrap(bytesSchemaVersion.get()).getLong()); + } finally { + Thread.currentThread().setContextClassLoader(originalContextLoader); + } }