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

Trino getting-started: NoClassDefFoundError due to trino spi version mismatch #74

Open
adrdc opened this issue Mar 25, 2022 · 1 comment

Comments

@adrdc
Copy link
Contributor

adrdc commented Mar 25, 2022

Current latest trino pravega-connector code uses v359 of trino libraries
The getting started guide builds a docker image using trino:latest as the base image (I believe trino:latest is now v374).
As such the SPI has changed so the connector fails to load

2022-03-25T13:46:34.435Z	ERROR	main	io.trino.server.Server	io/trino/spi/connector/ConnectorTableLayoutHandle
java.lang.NoClassDefFoundError: io/trino/spi/connector/ConnectorTableLayoutHandle
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
	at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
	at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:292)
	at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:117)
	at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:716)
	at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:54)
	at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:36)
	at com.google.inject.internal.UntargettedBindingImpl.acceptTargetVisitor(UntargettedBindingImpl.java:52)
	at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:35)
	at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:27)
	at com.google.inject.internal.BindingImpl.acceptVisitor(BindingImpl.java:99)
	at com.google.inject.internal.AbstractProcessor.lambda$process$0(AbstractProcessor.java:53)
	at java.base/java.util.ArrayList.removeIf(ArrayList.java:1712)
	at java.base/java.util.ArrayList.removeIf(ArrayList.java:1690)
	at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:50)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:216)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at io.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:270)
	at io.trino.plugin.pravega.PravegaConnectorFactory.create(PravegaConnectorFactory.java:91)
	at io.trino.connector.ConnectorManager.createConnector(ConnectorManager.java:403)
	at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:252)
	at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:241)
	at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:227)
	at io.trino.metadata.StaticCatalogStore.loadCatalog(StaticCatalogStore.java:88)
	at io.trino.metadata.StaticCatalogStore.loadCatalogs(StaticCatalogStore.java:68)
	at io.trino.server.Server.doStart(Server.java:128)
	at io.trino.server.Server.lambda$start$0(Server.java:80)
	at io.trino.$gen.Trino_374____20220325_134610_1.run(Unknown Source)
	at io.trino.server.Server.start(Server.java:80)
	at io.trino.server.TrinoServer.main(TrinoServer.java:38)
Caused by: java.lang.ClassNotFoundException: io.trino.spi.connector.ConnectorTableLayoutHandle
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at io.trino.server.PluginClassLoader.loadClass(PluginClassLoader.java:109)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 32 more
@adrdc
Copy link
Contributor Author

adrdc commented Mar 25, 2022

When using trino:359

diff --git a/getting-started/Dockerfile-trino b/getting-started/Dockerfile-trino
index f70b467..8ae4712 100644
--- a/getting-started/Dockerfile-trino
+++ b/getting-started/Dockerfile-trino
@@ -1,4 +1,4 @@
-FROM trinodb/trino:latest
+FROM trinodb/trino:359
 
 RUN mkdir /usr/lib/trino/plugin/pravega/
 COPY pravega-plugin/* /usr/lib/trino/plugin/pravega/

Connector will load

2022-03-25T13:54:16.776Z	INFO	main	io.trino.metadata.StaticCatalogStore	-- Loading catalog etc/catalog/pravega.properties --
2022-03-25T13:54:21.242Z	INFO	main	Bootstrap	PROPERTY                       DEFAULT      RUNTIME                   DESCRIPTION
2022-03-25T13:54:21.246Z	INFO	main	Bootstrap	pravega.controller             ----         tcp://192.168.49.1:9090
2022-03-25T13:54:21.247Z	INFO	main	Bootstrap	pravega.hide-internal-columns  true         true
2022-03-25T13:54:21.247Z	INFO	main	Bootstrap	pravega.schema-registry        ----         http://192.168.49.1:9092
2022-03-25T13:54:21.247Z	INFO	main	Bootstrap	pravega.table-description-dir  etc/pravega  etc/pravega
2022-03-25T13:54:23.660Z	INFO	main	io.trino.metadata.StaticCatalogStore	-- Added catalog pravega using connector pravega --
2022-03-25T13:54:23.669Z	INFO	main	io.trino.security.AccessControlManager	Using system access control default
2022-03-25T13:54:23.825Z	INFO	main	io.trino.server.Server	======== SERVER STARTED ========

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

No branches or pull requests

1 participant