ClassNotFoundException in NetCDF ImageMosaic when upgrading to geoserver 2.28

I have a NetCDF ImageMosaic that’s working on geoserver 2.27.2. When upgrading to 2.28, doing a WCS GetCoverage on it returns this error:

Cannot invoke &amp;quot;org.eclipse.imagen.ImageLayout.getSampleModel(java.awt.image.RenderedImage)&amp;quot; because &amp;quot;this.layout&amp;quot; is null</ows:ExceptionText>

and writes this in the logs:

2025-11-03T10:13:47.728Z WARN   [gce.imagemosaic] - Unable to parse sample image for path /data/geoserver/coverages/emodnet_biology/cal_fin/cal_fin_19582016_L1sample_image.dat
java.lang.ClassNotFoundException: com.sun.media.jai.codecimpl.util.FloatDoubleColorModel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.geotools.gce.imagemosaic.RemappingFilteringObjectInputStream.load(RemappingFilteringObjectInputStream.java:94)
at org.geotools.gce.imagemosaic.RemappingFilteringObjectInputStream.resolveClass(RemappingFilteringObjectInputStream.java:140)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2034)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1898)
025-11-03T10:13:47.728Z WARN   [gce.imagemosaic] - Unable to find sample image for path file:/data/geoserver/coverages/emodnet_biology/cal_fin/datastore.properties

It seems the coverages have a few files *sample_image.dat, containing a serialized object. As 2.28 has changed the JAI implementation, these objects can’t deserialize anymore. I presume geoserver’s RemappingFilteringObjectInputStream tries to translate these to new classes, but this one is not translated (and I haven’t yet found its successor).

I have unfortunately no knowledge about how these files were created originally. I tried deleting them, but geoserver does not recreate them. There seems to be code in geoserver to rebuild it, but I don’t manage to trigger it without damaging other metadata.

Interesting,
Could you open a Jira ticket and attach the sample image you have?
Or, if you have a opportunity to make a pull request, the idea is to remap that class to the ImageN class bearing the same name (but a different package, of course)

Regards,

Andrea Aime

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

Il mer 5 nov 2025, 07:49 hyperman via OSGeo Discourse <noreply@discourse.osgeo.org> ha scritto:

hyperman
November 5

I have a NetCDF ImageMosaic that’s working on geoserver 2.27.2. When upgrading to 2.28, doing a WCS GetCoverage on it returns this error:

Cannot invoke &amp;quot;org.eclipse.imagen.ImageLayout.getSampleModel(java.awt.image.RenderedImage)&amp;quot; because &amp;quot;this.layout&amp;quot; is null</ows:ExceptionText>

and writes this in the logs:

2025-11-03T10:13:47.728Z WARN [gce.imagemosaic] - Unable to parse sample image for path /data/geoserver/coverages/emodnet_biology/cal_fin/cal_fin_19582016_L1sample_image.dat
java.lang.ClassNotFoundException: com.sun.media.jai.codecimpl.util.FloatDoubleColorModel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.geotools.gce.imagemosaic.RemappingFilteringObjectInputStream.load(RemappingFilteringObjectInputStream.java:94)
at org.geotools.gce.imagemosaic.RemappingFilteringObjectInputStream.resolveClass(RemappingFilteringObjectInputStream.java:140)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2034)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1898) 2025-11-03T10:13:47.728Z WARN [gce.imagemosaic] - Unable to find sample image for path file:/data/geoserver/coverages/emodnet_biology/cal_fin/datastore.properties

It seems the coverages have a few files *sample_image.dat, containing a serialized object. As 2.28 has changed the JAI implementation, these objects can’t deserialize anymore. I presume geoserver’s RemappingFilteringObjectInputStream tries to translate these to new classes, but this one is not translated (and I haven’t yet found its successor).

I have unfortunately no knowledge about how these files were created originally. I tried deleting them, but geoserver does not recreate them. There seems to be code in geoserver to rebuild it, but I don’t manage to trigger it without damaging other metadata.


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

Thanks. I think I know the correct remapping. I’ll try and recompile the source code later this week.

  • I have to modify geotools, not geoserver. Want me to stop discussing here and switch to the other forum?

  • Checking out a new geotools and running mvn install unfortunately gives me test failures even if I don’t modify everything. So sending you a patch will be non-trivial until I’ve found out why. I can do mvn -DskipTests clean install .

  • When I modify this location:

and add this line:

.remapPackage("com.sun.media.jai.codecimpl.util", "org.eclipse.imagen")

the problem seems fixed.

Excellent. Could you turn that into a pull request?

There is already a migration test, if you add your sample file in there and check it, that would be all that’s needed to merge the code change.

Cheers
Andrea

1 Like

PR and issue are ready. I’ve gone trough other similar layers, and no other ClassNotFoundExceptions appear.