Skip to content

java.lang.ClassFormatError: class com.jsoniter.IterImpl cannot access its superclass com.jsoniter.IterImplForStreaming #225

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

Open
mferretti opened this issue Feb 21, 2019 · 3 comments

Comments

@mferretti
Copy link

mferretti commented Feb 21, 2019

Hi,
I am facing an odd issue running tests for my app with arquillian: whenever I try to parse a json (stream) with JSonIterator the test fails with the following exception :
`
...
Caused by: javassist.CannotCompileException: by java.lang.ClassFormatError: class com.jsoniter.IterImpl cannot access its superclass com.jsoniter.IterImplForStreaming
at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:274)
at javassist.ClassPool.toClass(ClassPool.java:1232)
at javassist.ClassPool.toClass(ClassPool.java:1090)
at javassist.ClassPool.toClass(ClassPool.java:1048)
at javassist.CtClass.toClass(CtClass.java:1290)
at com.jsoniter.DynamicCodegen.enableStreamingSupport(DynamicCodegen.java:32)
at com.jsoniter.JsonIterator.enableStreamingSupport(JsonIterator.java:546)
... 141 more
Caused by: java.lang.ClassFormatError: class com.jsoniter.IterImpl cannot access its superclass com.jsoniter.IterImplForStreaming
at javassist.util.proxy.DefineClassHelper$Java7.defineClass(DefineClassHelper.java:182)
at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:263)
... 147 more

`

Looking at the code (DynamicCodegen) I see
public static void enableStreamingSupport() throws Exception { CtClass ctClass = pool.makeClass("com.jsoniter.IterImpl"); ctClass.setSuperclass(pool.get(IterImplForStreaming.class.getName())); ctClass.toClass(); }

Following the stack trace it seems that the exception is thrown in
`
public Class toClass(CtClass ct, Class<?> neighbor, ClassLoader loader,
ProtectionDomain domain)

`

Where

`
ct =IterImplForStreaming

neighbor=null

loader = org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader

domain = null

`

Could you please shed some light into this ?

jsonIter : 0.9.23
javaassist : 3.24.1-GA
shrinkwrap: 1.2.6
arquillian: 1.4.1

Cheers

@ingomueller-net
Copy link

@mferretti Have you found a solution for your problem in the meantime?

@mferretti
Copy link
Author

mferretti commented Nov 16, 2020

@mferretti Have you found a solution for your problem in the meantime?

nope. Since there was no coming back on this, and due to the fact that arquillian was a mandatory requirement for the project, we simply moved to jackson.

@mferretti
Copy link
Author

Since the project looks dead I don't expect anything coming from this. I might fork this repo (provided I can schedule some time to look into it). For the time being I am closing this issue

/close

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

2 participants