SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)
MIT License
365 stars 87 forks source link

NoClassDefFoundError: ru/serce/jnrfuse/FuseCallbacks$GetAttrCallback in multi-classloader setup #50

Closed jernst closed 6 years ago

jernst commented 6 years ago

I'm attempting to run jnr-fuse in a Linux container as part of a larger piece of code that uses many ClassLoaders (assume one ClassLoader per jar). I have managed to get my custom filesystem to mount, but any operation on the mounted filesystem produces an Input/output error (per console with debug on).

Poking around with the debugger, I find that the main thread is suspended at Foreign.invokeN5O1 and that another thread pops up briefly and throws NoClassDefFoundError: ru/serce/jnrfuse/FuseCallbacks$GetAttrCallback. (That exception is never logged anywhere as far as I can tell so I can only see it in the debugger)

There is only one element in the stack for this thread, which is NativeClosureProxy$$impl$$0.invoke. Unfortunately that does not tell me where to look.

I would guess that something invoked by native code is attempting to look up this named class, and ends up looking in the wrong ClassLoader. (Wild guess.) Any advice where I should go look? Thanks!

jernst commented 6 years ago

It appears the relevant functionality is actually not part of jnr-fuse, but of jnr-ffi, so I'm going to continue this thread over there and close this.