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】java.lang.ArrayIndexOutOfBoundsException: 195 when deserializing Protobuf Model in COMPATIBLE mode #1834

Open
1 of 2 tasks
hifishzlj opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hifishzlj
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Java 1.8
fury 0.7.0

Component(s)

Java

Minimal reproduce step

public static void main(String[] args) {
             //any protocol model
	Protobuf.RequestHeader requestHeader = Protobuf.RequestHeader
			.newBuilder().setSid(1).setSseqNo(2).setReqTime(3).setCid(4)
			.setCseqNo(5).setSms("6").setSignkey("7").build();
	ThreadSafeFury threadSafeFury = Fury.builder()
			.withLanguage(Language.JAVA).withRefTracking(true)
			.requireClassRegistration(false)
			.withCompatibleMode(CompatibleMode.COMPATIBLE)
			.buildThreadSafeFury();
	byte[] serialize = threadSafeFury.serializeJavaObject(requestHeader);
	Protobuf.RequestHeader deserialize = threadSafeFury
			.deserializeJavaObject(serialize, Protobuf.RequestHeader.class);
}

What did you expect to see?

//

What did you see instead?

Exception in thread "main" org.apache.fury.exception.DeserializationException: Deserialize failed, read objects are: [null, null]
at org.apache.fury.util.ExceptionUtils.handleReadFailed(ExceptionUtils.java:63)
at org.apache.fury.Fury.deserializeJavaObject(Fury.java:1117)
at org.apache.fury.Fury.deserializeJavaObject(Fury.java:1094)
at org.apache.fury.ThreadLocalFury.deserializeJavaObject(ThreadLocalFury.java:195)
at test.Test.main(Test.java:26)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 195
at org.apache.fury.resolver.MetaStringBytes.decode(MetaStringBytes.java:69)
at org.apache.fury.resolver.ClassResolver.populateBytesToClassInfo(ClassResolver.java:1708)
at org.apache.fury.resolver.ClassResolver.loadBytesToClassInfo(ClassResolver.java:1699)
at org.apache.fury.resolver.ClassResolver.readClassInternal(ClassResolver.java:1588)
at org.apache.fury.serializer.ReplaceResolveSerializer.readObject(ReplaceResolveSerializer.java:310)
at org.apache.fury.serializer.ReplaceResolveSerializer.read(ReplaceResolveSerializer.java:305)
at org.apache.fury.Fury.readData(Fury.java:923)
at org.apache.fury.serializer.ReplaceResolveSerializer.read(ReplaceResolveSerializer.java:284)
at org.apache.fury.Fury.readDataInternal(Fury.java:955)
at org.apache.fury.Fury.deserializeJavaObject(Fury.java:1111)
... 3 more

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@hifishzlj hifishzlj added the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant