[ImageJ-devel] SCIFIO and imageJ1
Curtis Rueden
ctrueden at wisc.edu
Thu Jan 15 15:57:55 CST 2015
Hi Pietro,
> java.lang.IllegalArgumentException: No compatible service:
> io.scif.SCIFIOService
You have been bitten by the annotation combining problem: many of the JAR
files you are trying to combine have a file at
META-INF/json/org.scijava.plugin.Plugin, which lists the plugins included
in that JAR file. All of these files need to be appended to one another and
stored within your uber-JAR, or else plugins will not be discoverable. The
scheme you are using to build your uberjar is likely not merging these
files as needed.
We provide some code in scijava-common to facilitate combining this
metadata in the correct way. If you are using Maven to build, you can use
it via the following configuration in your pom.xml:
https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L577-L594
See also:
https://github.com/scijava/scijava-common/issues/37
Regards,
Curtis
On Thu, Jan 15, 2015 at 7:02 AM, Pietro Incardona <incardon at mpi-cbg.de>
wrote:
> Hi Curtis
>
> I already strongly suggest to use Fiji/ImageJ2, but I would like (if
> reasonably possible) to maintain an imageJ version
>
> I packed this in the jar file
>
> /imglib2-2.0.0-beta-26.jar
> /imglib2-2.0.0-SNAPSHOT.jar
> /imglib2-algorithms-2.0.0-beta-26.jar
> /imglib2-algorithms-gpl-2.0.0-beta-26.jar
> /imglib2-algorithms-legacy-2.0.0-beta-26.jar
> /imglib2-ij-2.0.0-beta-26.jar
> /imglib2-meta-2.0.0-beta-26.jar
> /imglib2-ops-2.0.0-beta-26.jar
> /imglib2-realtransform-2.0.0-beta-26.jar
> /imglib2-ui-2.0.0-SNAPSHOT.jar
> /scifio-0.16.5.jar
> /scifio-bf-compat-1.8.4.jar
> /scifio-cli-0.1.0.jar
> /scifio-jai-imageio-1.1.0.jar
> /scifio-lifesci-0.5.2.jar
> /scifio-ome-xml-0.9.2.jar
> /scifio-tools-0.14.0.jar
> /scijava-common-2.33.0.jar
> /scijava-plugins-commands-0.1.7.jar
> /scijava-plugins-platforms-0.1.2.jar
> /scijava-plugins-text-markdown-0.1.1.jar
> /scijava-plugins-text-plain-0.1.1.jar
> /scijava-ui-awt-0.1.2.jar
> /scijava-ui-swing-0.3.0.jar
>
>
> Apparently it crashes on the instruction
>
> // create the ImgOpener
> ImgOpener imgOpener = new ImgOpener();
>
> ImageJ 1.48v; Java 1.6.0_24 [64-bit]; Linux 3.16.3-200.fc20.x86_64; 10MB
> of 455MB (2%)
>
> java.lang.IllegalArgumentException: No compatible service:
> io.scif.SCIFIOService
> at
> org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:242)
> at
> org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:193)
> at
> org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:169)
> at org.scijava.Context.<init>(Context.java:234)
> at org.scijava.Context.<init>(Context.java:195)
> at org.scijava.Context.<init>(Context.java:138)
> at org.scijava.Context.<init>(Context.java:126)
> at
> io.scif.img.AbstractImgIOComponent.<init>(AbstractImgIOComponent.java:57)
> at io.scif.img.ImgOpener.<init>(ImgOpener.java:94)
> at mosaic.core.utils.MosaicTest.processResult(MosaicTest.java:178)
> at mosaic.core.utils.MosaicTest.testPlugin(MosaicTest.java:335)
> at mosaic.plugins.test.Jtest.naturalization(Jtest.java:32)
> at mosaic.plugins.Jtest.setup(Jtest.java:39)
> at
> ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:47)
> at ij.IJ.runUserPlugIn(IJ.java:201)
> at ij.IJ.runPlugIn(IJ.java:163)
> at ij.Executer.runCommand(Executer.java:131)
> at ij.Executer.run(Executer.java:64)
> at java.lang.Thread.run(Thread.java:662)
>
>
> Cheers
> Pietro
>
>
> On 01/14/2015 05:07 PM, Curtis Rueden wrote:
>
> Hi Pietro,
>
> > Is there any way to pack a jar with SCIFIO included that work also in
> > imageJ1
>
> Certainly. But it would help to be more specific about what you are
> trying to do.
>
> By "pack a jar with SCIFIO" do you mean "create an uber-JAR with
> dependencies embedded"? Or something else?
>
> By "ImageJ1" do you mean the vanilla ImageJ1 distribution from
> imagej.nih.gov? If so, you can do it, but I would recommend saving
> yourself a lot of work and just recommending people use ImageJ2, which
> comes with SCIFIO already bundled. But if you really want to go that route,
> look at the maven-shade-plugin or maven-assembly-plugin [1].
>
> Regards,
> Curtis
>
> [1] Here is a starting point for how we create an ImageJ2 uber-JAR with
> dependencies:
> https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L421-L648.
> Your use case would likely be simpler.
>
> On Wed, Jan 14, 2015 at 7:18 AM, Pietro Incardona <incardon at mpi-cbg.de>
> wrote:
>
>> Hi All
>>
>> Is there any way to pack a jar with SCIFIO included that work also in
>> imageJ1
>>
>> Cheers
>> Pietro
>>
>>
>> _______________________________________________
>> ImageJ-devel mailing list
>> ImageJ-devel at imagej.net
>> http://imagej.net/mailman/listinfo/imagej-devel
>>
>
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150115/75f443b3/attachment.html>
More information about the ImageJ-devel
mailing list