<div dir="ltr">Hi Pietro,<div><br></div><div><div><div>> java.lang.IllegalArgumentException: No compatible service:</div><div>> io.scif.SCIFIOService</div></div><div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><div>    <a href="https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L577-L594">https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L577-L594</a><br></div><div><br></div><div>See also:</div><div><a href="https://github.com/scijava/scijava-common/issues/37">https://github.com/scijava/scijava-common/issues/37</a><br></div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 7:02 AM, Pietro Incardona <span dir="ltr"><<a href="mailto:incardon@mpi-cbg.de" target="_blank">incardon@mpi-cbg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Curtis<br>
    <br>
    I already strongly suggest to use Fiji/ImageJ2, but I would like (if
    reasonably possible) to maintain an imageJ version<br>
    <br>
    I packed this in the jar file<br>
    <br>
    /imglib2-2.0.0-beta-26.jar<br>
    /imglib2-2.0.0-SNAPSHOT.jar<br>
    /imglib2-algorithms-2.0.0-beta-26.jar<br>
    /imglib2-algorithms-gpl-2.0.0-beta-26.jar<br>
    /imglib2-algorithms-legacy-2.0.0-beta-26.jar<br>
    /imglib2-ij-2.0.0-beta-26.jar<br>
    /imglib2-meta-2.0.0-beta-26.jar<br>
    /imglib2-ops-2.0.0-beta-26.jar<br>
    /imglib2-realtransform-2.0.0-beta-26.jar<br>
    /imglib2-ui-2.0.0-SNAPSHOT.jar<br>
    /scifio-0.16.5.jar<br>
    /scifio-bf-compat-1.8.4.jar<br>
    /scifio-cli-0.1.0.jar<br>
    /scifio-jai-imageio-1.1.0.jar<br>
    /scifio-lifesci-0.5.2.jar<br>
    /scifio-ome-xml-0.9.2.jar<br>
    /scifio-tools-0.14.0.jar<br>
    /scijava-common-2.33.0.jar<br>
    /scijava-plugins-commands-0.1.7.jar<br>
    /scijava-plugins-platforms-0.1.2.jar<br>
    /scijava-plugins-text-markdown-0.1.1.jar<br>
    /scijava-plugins-text-plain-0.1.1.jar<br>
    /scijava-ui-awt-0.1.2.jar<br>
    /scijava-ui-swing-0.3.0.jar<br>
    <br>
    <br>
    Apparently it crashes on the instruction<br>
    <br>
            // create the ImgOpener<br>
            ImgOpener imgOpener = new ImgOpener();<br>
    <br>
    ImageJ 1.48v; Java 1.6.0_24 [64-bit]; Linux 3.16.3-200.fc20.x86_64;
    10MB of 455MB (2%)<br>
     <br>
    java.lang.IllegalArgumentException: No compatible service:
    io.scif.SCIFIOService<br>
        at
    org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:242)<br>
        at
    org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:193)<br>
        at
    org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:169)<br>
        at org.scijava.Context.<init>(Context.java:234)<br>
        at org.scijava.Context.<init>(Context.java:195)<br>
        at org.scijava.Context.<init>(Context.java:138)<br>
        at org.scijava.Context.<init>(Context.java:126)<br>
        at
io.scif.img.AbstractImgIOComponent.<init>(AbstractImgIOComponent.java:57)<br>
        at io.scif.img.ImgOpener.<init>(ImgOpener.java:94)<br>
        at
    mosaic.core.utils.MosaicTest.processResult(MosaicTest.java:178)<br>
        at mosaic.core.utils.MosaicTest.testPlugin(MosaicTest.java:335)<br>
        at mosaic.plugins.test.Jtest.naturalization(Jtest.java:32)<br>
        at mosaic.plugins.Jtest.setup(Jtest.java:39)<br>
        at
ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:47)<br>
        at ij.IJ.runUserPlugIn(IJ.java:201)<br>
        at ij.IJ.runPlugIn(IJ.java:163)<br>
        at ij.Executer.runCommand(Executer.java:131)<br>
        at ij.Executer.run(Executer.java:64)<br>
        at java.lang.Thread.run(Thread.java:662)<br>
    <br>
    <br>
    Cheers<span class="HOEnZb"><font color="#888888"><br>
    Pietro</font></span><div><div class="h5"><br>
    <br>
    <div>On 01/14/2015 05:07 PM, Curtis Rueden
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi Pietro,
        <div><br>
        </div>
        <div>
          <div>> Is there any way to pack a jar with SCIFIO included
            that work also in</div>
          <div>> imageJ1</div>
        </div>
        <div><br>
        </div>
        <div>Certainly. But it would help to be more specific about what
          you are trying to do.</div>
        <div><br>
        </div>
        <div>By "pack a jar with SCIFIO" do you mean "create an uber-JAR
          with dependencies embedded"? Or something else?</div>
        <div><br>
        </div>
        <div>By "ImageJ1" do you mean the vanilla ImageJ1 distribution
          from <a href="http://imagej.nih.gov" target="_blank">imagej.nih.gov</a>?
          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].</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Curtis</div>
        <div><br>
        </div>
        <div>[1] Here is a starting point for how we create an ImageJ2
          uber-JAR with dependencies: <a href="https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L421-L648" target="_blank">https://github.com/imagej/imagej/blob/imagej-2.0.0-rc-22/pom.xml#L421-L648</a>.
          Your use case would likely be simpler.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Jan 14, 2015 at 7:18 AM, Pietro
          Incardona <span dir="ltr"><<a href="mailto:incardon@mpi-cbg.de" target="_blank">incardon@mpi-cbg.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All<br>
            <br>
            Is there any way to pack a jar with SCIFIO included that
            work also in imageJ1<br>
            <br>
            Cheers<br>
            Pietro<br>
            <br>
            <br>
            _______________________________________________<br>
            ImageJ-devel mailing list<br>
            <a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
            <a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>