[ome-devel] JAI

Douglas Russell root at dpwrussell.com
Fri Jun 19 18:58:56 BST 2015


Hi,

Sorry for slow reply to this.

Basically this was a misdetection of the format cause by my code. Once it
was fixed, it stopped wanting JAI.

Cheers,

Douglas

On 16 June 2015 at 18:40, Melissa Linkert <melissa at glencoesoftware.com>
wrote:

> Hi Douglas and Curtis,
>
> > > I'm just trying to use the BFS3 Handler and I'm running into a problem
> > > with Java Advanced Imaging.
> > >
> > > 11:04:14.008 [main] INFO  loci.formats.FormatHandler - Checking for JAI
> > > Exception in thread "main" loci.formats.MissingLibraryException: Java
> > > Advanced Imaging (JAI) is required to read some TIFF files. Please
> install
> > > JAI from https://jai.dev.java.net/
> > > at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:111)
> > > at loci.formats.FormatReader.setId(FormatReader.java:1426)
> > > at loci.formats.DelegateReader.setId(DelegateReader.java:298)
> > > at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:505)
> > > at loci.plugins.in.ImportProcess.execute(ImportProcess.java:143)
> > > at loci.plugins.BF.openImagePlus(BF.java:92)
> > > at loci.plugins.BF.openImagePlus(BF.java:77)
> > > at edu.harvard.hms.bfs3.Main.main(Main.java:54)
> > > Caused by: loci.common.ReflectException: No such class:
> > > javax.media.jai.NullOpImage
> > > at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:161)
> > > at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:104)
> > > ... 7 more
> > > Caused by: java.lang.ClassNotFoundException:
> javax.media.jai.NullOpImage
> > > at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > > at java.lang.Class.forName0(Native Method)
> > > at java.lang.Class.forName(Class.java:348)
> > > at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:153)
> > > ... 8 more
>
> This error always implies that something went wrong with Bio-Formats'
> own TIFF reader - the vast majority of the time, it's something simple,
> and does not indicate that JAI is or should be required.
>
> Is there a stack trace prior to this in the log?  Can you upload the
> file?
>
> > IIRC, the reason JAI is not available from a Maven repo is due to
> licensing
> > issues: Java Advanced Imaging is not open source! [1] So redistributing
> it
> > from a Maven repo has legal problems.
> >
> > Actually though, it looks like there _is_ a fork in Maven Central now,
> > slightly stripped down to avoid said legal issues:
> > * https://github.com/jai-imageio/jai-imageio-core
> > *
> >
> http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.jai-imageio%22%20AND%20a%3A%22jai-imageio-core%22
> >
> > So maybe we could update Bio-Formats to use that! The package names are
> > different so it would require some code changes, though.
> >
> > Melissa: any ideas on how you'd prefer to address this issue in
> Bio-Formats
> > proper?
>
> We've considered jai-imageio-core in the past; we haven't used it so far
> because it's not actively maintained, and the value added is minimal
> compared to
> the time required to add/test/maintain support for it.  As far as I can
> see, it only
> buys us support for a couple of very uncommon TIFF codecs.
>
> If Douglas' file does indeed require support for one of those codecs,
> then we can certainly take a closer look at depending on
> jai-imageio-core, but I'd like to rule out an easier solution first.
>
> Regards,
> -Melissa
>
> On Tue, Jun 16, 2015 at 11:37:01AM -0500, Curtis Rueden wrote:
> > Hi Douglas,
> >
> > CCing ome-devel, as this may interest others.
> >
> > > I'm just trying to use the BFS3 Handler and I'm running into a problem
> > > with Java Advanced Imaging.
> >
> > Yeah, unfortunately, JAI is not just a library -- it's a Java platform
> > extension. This means it installs into the lib/ext folder of your JRE.
> > Usually this is done because native libraries are installed, too. (The
> > whole "Java platform extension" thing is so last decade, though... ;-)
> >
> > Anyway, the reason it works on OS X out of the box is that Apple Java 6
> > ships with Java 3D and JAI installed in /Library/Java/Extensions. They
> are
> > really old versions, but in this case I guess it did the job.
> >
> > IIRC, the reason JAI is not available from a Maven repo is due to
> licensing
> > issues: Java Advanced Imaging is not open source! [1] So redistributing
> it
> > from a Maven repo has legal problems.
> >
> > Actually though, it looks like there _is_ a fork in Maven Central now,
> > slightly stripped down to avoid said legal issues:
> > * https://github.com/jai-imageio/jai-imageio-core
> > *
> >
> http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.jai-imageio%22%20AND%20a%3A%22jai-imageio-core%22
> >
> > So maybe we could update Bio-Formats to use that! The package names are
> > different so it would require some code changes, though.
> >
> > Melissa: any ideas on how you'd prefer to address this issue in
> Bio-Formats
> > proper?
> >
> > Regards,
> > Curtis
> >
> > [1] https://en.wikipedia.org/wiki/Java_Advanced_Imaging
> >
> > On Tue, Jun 16, 2015 at 10:21 AM, Douglas Russell <root at dpwrussell.com>
> > wrote:
> >
> > > Hi Curtis,
> > >
> > > I'm just trying to use the BFS3 Handler and I'm running into a problem
> > > with Java Advanced Imaging.
> > >
> > > 11:04:14.008 [main] INFO  loci.formats.FormatHandler - Checking for JAI
> > > Exception in thread "main" loci.formats.MissingLibraryException: Java
> > > Advanced Imaging (JAI) is required to read some TIFF files. Please
> install
> > > JAI from https://jai.dev.java.net/
> > > at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:111)
> > > at loci.formats.FormatReader.setId(FormatReader.java:1426)
> > > at loci.formats.DelegateReader.setId(DelegateReader.java:298)
> > > at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:505)
> > > at loci.plugins.in.ImportProcess.execute(ImportProcess.java:143)
> > > at loci.plugins.BF.openImagePlus(BF.java:92)
> > > at loci.plugins.BF.openImagePlus(BF.java:77)
> > > at edu.harvard.hms.bfs3.Main.main(Main.java:54)
> > > Caused by: loci.common.ReflectException: No such class:
> > > javax.media.jai.NullOpImage
> > > at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:161)
> > > at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:104)
> > > ... 7 more
> > > Caused by: java.lang.ClassNotFoundException:
> javax.media.jai.NullOpImage
> > > at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > > at java.lang.Class.forName0(Native Method)
> > > at java.lang.Class.forName(Class.java:348)
> > > at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:153)
> > > ... 8 more
> > >
> > > I tried adding a maven dependency for JAI, but it looks like that is
> not
> > > in the imagej maven repository. Obviously it worked on your laptop in
> Paris
> > > so it must have been there somehow. What do you think the best
> resolution
> > > is? My knowledge of Maven is extremely limited as I stopped using Java
> > > around the time it was really taking off, but I would have thought that
> > > this could be fixed by adding another maven repository to the pom...
> but
> > > it's odd that it worked for you on your laptop without any of that.
> > >
> > > Cheers,
> > >
> > > Douglas
> > >
>
> > _______________________________________________
> > ome-devel mailing list
> > ome-devel at lists.openmicroscopy.org.uk
> > http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20150619/a78014b5/attachment.html>


More information about the ome-devel mailing list