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

allow users to skip register class for application/json #36

Merged
merged 14 commits into from
Dec 5, 2024

Conversation

chaokunyang
Copy link
Contributor

No description provided.

@chaokunyang chaokunyang requested a review from a team as a code owner November 21, 2024 09:13
@zhfeng
Copy link
Contributor

zhfeng commented Nov 21, 2024

Sorry @chaokunyang - I don't understand why these changes are related to application/json ?

@zhfeng
Copy link
Contributor

zhfeng commented Dec 3, 2024

Hi @chaokunyang ,

Any update about this PR? I want to do a new 0.2.0 release this week.

@chaokunyang
Copy link
Contributor Author

@zhfeng I got following error, but there is no any exception raised, do you know how to get server exception?

Expected status code <200> but was <415>.

        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:108)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
        at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:512)
        at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
        at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:696)
        at io.restassured.internal.ResponseSpecificationImpl.this$2$validateResponseIfRequired(ResponseSpecificationImpl.groovy)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:198)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:62)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
        at io.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:135)
        at io.restassured.specification.ResponseSpecification$statusCode$0.callCurrent(Unknown Source)
        at io.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:143)
        at io.restassured.internal.ValidatableResponseOptionsImpl.statusCode(ValidatableResponseOptionsImpl.java:89)
        at io.quarkiverse.fury.it.FuryTest.testFuryStruct(FuryTest.java:38)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:967)
        at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:817)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

@zhfeng
Copy link
Contributor

zhfeng commented Dec 3, 2024

415 Unsupported Media Type so did you rebase with the main branch? and is this error throwing from classic-rest or reactive-rest?

@chaokunyang
Copy link
Contributor Author

415 Unsupported Media Type so did you rebase with the main branch? and is this error throwing from classic-rest or reactive-rest?

I already merged with latest main branch. It's an error from ReactiveRestFuryTest>FuryTest.testFuryStruct

@chaokunyang
Copy link
Contributor Author

If the server deserialize failed, it should throw the deserializaiton exception instead.

@zhfeng
Copy link
Contributor

zhfeng commented Dec 3, 2024

Hmm, I will check it later today.

@zhfeng
Copy link
Contributor

zhfeng commented Dec 3, 2024

Hi @chaokunyang,

It should be fixed by my last commit to ignore the class register checking. Please take a look!

@zhfeng
Copy link
Contributor

zhfeng commented Dec 3, 2024

Now the JVM tests pass and the native tests fail with

2024-12-03 14:43:12,567 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /fury/struct failed, error id: 17315904-6bcc-491d-b5a4-b3a410a12731-1: java.lang.RuntimeException: Class class io.quarkiverse.fury.it.Struct is not registered
	at org.apache.fury.resolver.ClassResolver.getSerializerClassFromGraalvmRegistry(ClassResolver.java:2020)
	at org.apache.fury.resolver.ClassResolver.getSerializerClass(ClassResolver.java:824)
	at org.apache.fury.resolver.ClassResolver.getSerializerClass(ClassResolver.java:816)
	at org.apache.fury.resolver.ClassResolver.createSerializer(ClassResolver.java:1220)
	at org.apache.fury.resolver.ClassResolver.getClassInfo(ClassResolver.java:1114)
	at org.apache.fury.resolver.ClassResolver.readClassInfoFromBytes(ClassResolver.java:1743)
	at org.apache.fury.resolver.ClassResolver.readClassInfo(ClassResolver.java:1663)
	at org.apache.fury.Fury.readRef(Fury.java:861)
	at org.apache.fury.Fury.deserialize(Fury.java:793)
	at org.apache.fury.Fury.deserialize(Fury.java:816)
	at org.apache.fury.Fury.deserialize(Fury.java:809)
	at org.apache.fury.ThreadLocalFury.deserialize(ThreadLocalFury.java:167)
	at io.quarkiverse.fury.FurySerializer.readFrom(FurySerializer.java:48)
	at org.jboss.resteasy.reactive.server.handlers.RequestDeserializeHandler.readFrom(RequestDeserializeHandler.java:128)
	at org.jboss.resteasy.reactive.server.handlers.RequestDeserializeHandler.handle(RequestDeserializeHandler.java:84)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:135)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:637)
	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
	at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
	at [email protected]/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)

so maybe you can check it.

@chaokunyang
Copy link
Contributor Author

Thanks @zhfeng for your help, it works now

@zhfeng zhfeng merged commit 0ecb2bb into main Dec 5, 2024
1 check passed
@zhfeng zhfeng deleted the allow_no_register branch December 5, 2024 01:55
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 this pull request may close these issues.

2 participants