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