Hi all, status update: I have submitted an issue https://github.com/eclipse-imagen/imagen/issues/127 and been looking for a workaround since then.
So far I was successful using gradle black magic to redirect all dependencies on org.eclipse.imagen:* to org.eclipse.imagen:imagen-all:0.9.1 (which can be modularized and has access to all necessary classes/resources, since it a single fat jar). I have found few problems with imagen-all though, which make sense to be fixed independently of the state of affairs with modularization: (1) org.eclipse.imagen:vectorize contains classes from org.jaitools.media.jai.vectorize and generally looks very different from another artifacts of this group. Not a problem per se, just a thing to be aware of. Maybe an another group name for the artifact would be fitting better. (2) org.eclipse.imagen:imagen-all misses the classes from org.eclipse.imagen:contour - it seems to me it was simply forgotten to be included ;) (3) imagen-all-0.9.1.jar!\META-INF\org.eclipse.imagen.registryFile.imagen contains a lot of duplicates, I get lot of warnings in console: Error in registry file at line number #378 A descriptor is already registered against the name "Constant" under registry mode "rendered" Error in registry file at line number #389 A descriptor is already registered against the name "FilteredSubsample" under registry mode "rendered" ... I don't know your affiliation with ImageN or who produces the releases/artifacts - should I report the issues (2) and (3) to ImageN or can you, Jody, just look at them / fix them? With best regards, Slava ________________________________ Von: Jody Garnett <[email protected]> Gesendet: Montag, 8. Dezember 2025 21:50 An: Viatcheslav Sysoltsev <[email protected]> Cc: [email protected] <[email protected]> Betreff: Re: [Geotools-gt2-users] A problem with ImageN in a modularized project Hi Viatcheslav! The quickstart has a modules example, but I have not tired it since the introduction of ImageN. We have talked about removing JAI18N (and internationalization) from ImageN codebase as it does not add much value vs how much work it is to maintain. Please report it to the ImageN issue tracker and we can discuss further. And yes it is these kind of things we want to sort out before ImageN 1.0 is made. Thank you very much for the feedback! - - Jody Garnett On Dec 8, 2025 at 7:56:50 AM, Viatcheslav Sysoltsev <[email protected]<mailto:[email protected]>> wrote: Hi everyone, does anybody use geotools in java9-modularized project (former project jigsaw)? I get a problem updating from geotools-33.0 to 34.1 in regard to ImageN migration. Short about my project: it is gradle based and uses java modules. I could patch JAI using https://github.com/gradlex-org/extra-java-module-info, but fail so far doing it for ImageN. The test case is rather minimal and does not even use Geotools (but uses java modules): public static void main(String[] args) { ImageN.getDefaultInstance(); ... } I get exception: Caused by: java.lang.ExceptionInInitializerError at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at java.base/java.lang.Class.forName(Class.java:458) at [email protected]/org.eclipse.imagen.RegistryFileParser.getInstance(RegistryFileParser.java:187) at [email protected]/org.eclipse.imagen.RegistryFileParser.registerDescriptor(RegistryFileParser.java:312) at [email protected]/org.eclipse.imagen.RegistryFileParser.parseFile(RegistryFileParser.java:251) at [email protected]/org.eclipse.imagen.RegistryFileParser.loadOperationRegistry(RegistryFileParser.java:55) at [email protected]/org.eclipse.imagen.OperationRegistry.registerServices(OperationRegistry.java:1543) at [email protected]/org.eclipse.imagen.ThreadSafeOperationRegistry.registerServices(ThreadSafeOperationRegistry.java:529) at [email protected]/org.eclipse.imagen.OperationRegistry.initializeRegistry(OperationRegistry.java:311) at [email protected]/org.eclipse.imagen.ImageN.<clinit>(ImageN.java:351) at SSV9GUIKomponents/de.oowv.application.SSVMainWindow.main(SSVMainWindow.java:51) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ... 6 more Caused by: java.lang.NullPointerException: Cannot invoke "java.util.ResourceBundle.getString(String)" because "b" is null at [email protected]/org.eclipse.imagen.media.util.PropertyUtil.getString(PropertyUtil.java:159) at org.eclipse.imagen.media.affine.JaiI18N.getString(JaiI18N.java:26) at org.eclipse.imagen.media.affine.AffineDescriptor.<clinit>(AffineDescriptor.java:254) ... 19 more The way JaiI18N reads the resources is not compatible with modules, it has to use classloader of the class for which the properties are being loaded. I submit an issue to ImageN tomorrow, but not sure how to proceed with planned Geotools version update so far. Any ideas for me / experience in regard to the issue? With best regards Viatcheslav Sysoltsev / Slava _______________________________________________ GeoTools-GT2-Users mailing list [email protected]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
_______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
