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

java.sql.Date NoClassDefFoundError #2156

Closed
drohne1673 opened this issue Aug 6, 2024 · 5 comments · Fixed by wildfly-extras/wildfly-graphql-feature-pack#179
Closed

java.sql.Date NoClassDefFoundError #2156

drohne1673 opened this issue Aug 6, 2024 · 5 comments · Fixed by wildfly-extras/wildfly-graphql-feature-pack#179

Comments

@drohne1673
Copy link

drohne1673 commented Aug 6, 2024

WF30 with smallrye featurepack 2.2.0.Final this includes SmallRye GraphQL 2.5.0. This works fine.

After upgrading to the latest Version WF32 with smallrye featurepack 2.4.0.Final this includes SmallRye GraphQL 2.9.1. the following problem occurs:

Caused by: java.lang.NoClassDefFoundError: java/sql/Date
2024-08-06T11:44:50.801279208Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.scalarValue(VertxTypesafeGraphQLClientProxy.java:347)
2024-08-06T11:44:50.801281846Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.value(VertxTypesafeGraphQLClientProxy.java:332)
2024-08-06T11:44:50.801284188Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.lambda$variables$20(VertxTypesafeGraphQLClientProxy.java:320)
2024-08-06T11:44:50.801286522Z 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
2024-08-06T11:44:50.801288645Z 	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
2024-08-06T11:44:50.801290830Z 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
2024-08-06T11:44:50.801292952Z 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
2024-08-06T11:44:50.801295032Z 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
2024-08-06T11:44:50.801297135Z 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2024-08-06T11:44:50.801299398Z 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2024-08-06T11:44:50.801305457Z 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2024-08-06T11:44:50.801307852Z 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
2024-08-06T11:44:50.801310111Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.variables(VertxTypesafeGraphQLClientProxy.java:320)
2024-08-06T11:44:50.801312862Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.request(VertxTypesafeGraphQLClientProxy.java:311)
2024-08-06T11:44:50.801315212Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientProxy.invoke(VertxTypesafeGraphQLClientProxy.java:146)
2024-08-06T11:44:50.801317554Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientBuilder.invoke(VertxTypesafeGraphQLClientBuilder.java:231)
2024-08-06T11:44:50.801319891Z 	at io.smallrye.graphql.client.vertx//io.smallrye.graphql.client.vertx.typesafe.VertxTypesafeGraphQLClientBuilder.lambda$build$0(VertxTypesafeGraphQLClientBuilder.java:191)
2024-08-06T11:44:50.801322220Z 

this line was added between 2.5.2 and 2.9*

        if (value instanceof java.sql.Date) {
            return Json.createValue(value.toString());
        }

we run openjdk-17-jre-headless on debian bookworm

@jmartisk
Copy link
Member

jmartisk commented Aug 6, 2024

I think we need to declare that the client module now depends on the javax.sql.api module.
As a workaround, could you try manually changing your wildfly's modules/system/layers/base/io/smallrye/graphql/client/vertx/main/module.xml and add

<module name="javax.sql.api"/>

into its <dependencies> section to see if that fixes it?

@drohne1673
Copy link
Author

Screenshot_20240806_150605

this indeed fixed the issue. thank you very much for the fast response 👍

@t1
Copy link
Collaborator

t1 commented Aug 6, 2024

Hmmm... maybe it would still be better to make the client not rely on the javax.sql.api module. I might want to build a lean WildFly with Glow without any SQL.

@drohne1673
Copy link
Author

any idea when a fix will be available? otherwise i might need to lookup how i can create an overlay so i can actually install this version

@jmartisk
Copy link
Member

jmartisk commented Sep 2, 2024

Sorry @drohne1673, I'd somehow dropped this from my radar.. I've submitted wildfly-extras/wildfly-graphql-feature-pack#179 with the quick fix of just adding the dependency. I'll put out a micro release after this. We may consider pruning the dependency, as @t1 suggested, in the future.

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

Successfully merging a pull request may close this issue.

3 participants