[ImageJ-devel] [LOCI ImageJ] IJ2 Plugin Service

Curtis Rueden ctrueden at wisc.edu
Wed May 7 03:28:15 CDT 2014


Hi Jay,

> Any idea why the file is not created on processing?

Can you please push your changes to a branch of JEX? Otherwise there is not
enough information to understand what you tried to do.

Thanks,
Curtis


On Tue, May 6, 2014 at 5:13 PM, Jay Warrick <warrick at wisc.edu> wrote:

> Hi Johannes,
>
> Thanks for the reply.
>
> If I try to force Eclipse to process annotations. I get this error...
>
> java.io.IOException:
> org.eclipse.core.internal.resources.ResourceException: Resource
> '/JEX/bin/META-INF/json/org.scijava.plugin.Plugin' does not exist.
>         at
> org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeInputFileObject.openInputStream(IdeInputFileObject.java:88)
>         at
> org.scijava.annotations.AnnotationProcessor$Writer.openInput(AnnotationProcessor.java:224)
>         at
> org.scijava.annotations.AbstractIndexWriter.merge(AbstractIndexWriter.java:118)
>         at
> org.scijava.annotations.AbstractIndexWriter.write(AbstractIndexWriter.java:91)
>         at
> org.scijava.annotations.AnnotationProcessor.process(AnnotationProcessor.java:91)
>         at
> org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
>         at
> org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
>         at
> org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
>         at
> org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
>         at
> org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
>         at
> org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
>         at
> org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:366)
>         at
> org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
>         at
> org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:303)
>         at
> org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
>         at
> org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
>         at
> org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
>         at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
>         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>         at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
>         at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
>         at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
>         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>         at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
>         at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
>         at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:401)
>         at
> org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
>         at
> org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
>         at
> org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
>         at
> org.eclipse.core.internal.resources.Project.build(Project.java:114)
>         at
> org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
> Caused by: org.eclipse.core.internal.resources.ResourceException: Resource
> '/JEX/bin/META-INF/json/org.scijava.plugin.Plugin' does not exist.
>         at
> org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:341)
>         at
> org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:215)
>         at
> org.eclipse.core.internal.resources.File.getContents(File.java:287)
>         at
> org.eclipse.core.internal.resources.File.getContents(File.java:278)
>         at
> org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeInputFileObject.openInputStream(IdeInputFileObject.java:86)
>         ... 31 more
>
> Any idea why the file is not created on processing?
>
> Thanks,
>
> Jay
>
>
>
> On May 6, 2014, at 12:43 PM, Johannes Schindelin <
> Johannes.Schindelin at gmx.de> wrote:
>
> > Hi Jay,
> >
> > On Tue, 6 May 2014, Jay Warrick wrote:
> >
> >> You run the application once, it fixes the jar file but the changes to
> >> the jar file on disk are not reflected in the jar file that is loaded
> >> already in memory for running the application (at least as indicated by
> >> the getResources() method).
> >
> > That is not the intended workflow -- as both Curtis & I pointed out.
> >
> > The annotation indexes are supposed to be generated at compile time. The
> > way we do that is fully compliant with the Java standard.
> >
> > By using an environment that does not abide by that standard -- Eclipse
> --
> > you make it your responsibility to ensure that the annotation indexes are
> > generated correctly.
> >
> > You could do that by making unit tests an integral part of your build
> > process *before* bundling into a .jar (which you should do anyway, if you
> > want to follow best Java practices), or by running the EclipseHelper in
> > another manner.
> >
> > You could do that by making it a Maven project and importing it into
> > Eclipse.
> >
> > You could do that by forcing Eclipse into running the annotation
> > processors (as mandated by the Java standard).
> >
> > You could figure out another way to make the annotation indexing run
> > before packaging the sources into .jar files.
> >
> > What will not work is to continue to try to generate the annotation
> > indexes at a stage that is way later than compile time.
> >
> > Ciao,
> > Johannes
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140507/49a0a36f/attachment-0001.html>


More information about the ImageJ-devel mailing list