◐ Shell
clean mode source ↗

unable to work with objects created using net.imglib2.loops.ClassCopyProvider

Hi!

while working on this BIOP/ijp-atlas#7 (comment), I got stuck when i tried to get a java.net.imglib2.display.RealARGBColorConverter object built with net.imglib2.display.RealARGBColorConverterFactory. The factory uses net.imglib2.loops.ClassCopyProvider, which internally instantiate the objects with net.imglib2.loops.ClassCopyLoader, a different classloader from the one used by scyjava.

In the end, jpype crashes with:

Traceback (most recent call last):
  File "org.jpype.manager.TypeManager.java", line 0, in org.jpype.manager.TypeManager.findClassForObject
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  [...]
java.lang.java.lang.IllegalAccessError: java.lang.IllegalAccessError:
    failed to access class net.imglib2.display.RealARGBColorConverterFactory from class net.imglib2.display.RealARGBColorConverterFactory$Imp
    (
        net.imglib2.display.RealARGBColorConverterFactory is in unnamed module of loader 'app';
        net.imglib2.display.RealARGBColorConverterFactory$Imp is in unnamed module of loader net.imglib2.loops.ClassCopier$ClassCopyLoader @25464154
    )

Can you please help me? Do you think there is an ~easy workaround (perhaps telling jpype to avoid trying to find the class for that object?)