NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 646 - Fiji fails launching after both ./Build.sh and update
Fiji fails launching after both ./Build.sh and update
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
PC Linux
: P5 blocker
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2013-08-01 04:56 CDT by Stephan Saalfeld
Modified: 2013-08-03 06:24 CDT
1 user (show)

See Also:


Attachments
Fiji message after mvn build (11.41 KB, image/png)
2013-08-02 04:15 CDT, Stephan Saalfeld

Description Stephan Saalfeld 2013-08-01 04:56:54 CDT
I pulled the current fiji master and called

./Build.sh

Not much happened but the generated launchers cannot start Fiji, exception message later.  If I call mvn, it generates a Fiji that is running.  Updating this Fiji with its updater again breaks it to not running.  Excetion printed to the terminal:

saalfeld@saalfeld-thinkpad:~/workspace/fiji-clean (master)$ ./ImageJ-linux64 
Exception in thread "main" java.lang.ExceptionInInitializerError
	at fiji.IJ1Patcher.run(IJ1Patcher.java:43)
	at imagej.ClassLauncher.patchIJ1(ClassLauncher.java:170)
	at imagej.ClassLauncher.run(ClassLauncher.java:129)
	at imagej.ClassLauncher.main(ClassLauncher.java:72)
Caused by: java.lang.IllegalArgumentException: Cannot modify method: void init(java.lang.String path)
	at imagej.legacy.CodeHacker.insertAtTopOfMethod(CodeHacker.java:209)
	at imagej.legacy.LegacyExtensions.addExtraPlugins(LegacyExtensions.java:632)
	at imagej.legacy.LegacyExtensions.injectHooks(LegacyExtensions.java:415)
	at imagej.legacy.LegacyInjector.injectHooks(LegacyInjector.java:153)
	at imagej.legacy.LegacyInjector.injectHooks(LegacyInjector.java:57)
	at imagej.legacy.DefaultLegacyService.<clinit>(DefaultLegacyService.java:111)
	... 4 more
Caused by: javassist.CannotCompileException: [source error] addJAR(java.io.File) not found in ij.io.PluginClassLoader
	at javassist.CtBehavior.insertBefore(CtBehavior.java:741)
	at javassist.CtBehavior.insertBefore(CtBehavior.java:701)
	at imagej.legacy.CodeHacker.insertAtTopOfMethod(CodeHacker.java:205)
	... 9 more
Caused by: compile error: addJAR(java.io.File) not found in ij.io.PluginClassLoader
	at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:723)
	at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:688)
	at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atForStmnt(CodeGen.java:480)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:359)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.Javac.compileStmnt(Javac.java:569)
	at javassist.CtBehavior.insertBefore(CtBehavior.java:721)
	... 11 more
Comment 1 Stephan Saalfeld 2013-08-02 04:06:04 CDT
I have just tested from a fresh clone from github and the result is the same.  The platform is a different PC, though with the same operating system, Ubuntu 12.04  The Fiji-Logo is briefly shown and then it exits with the Exception shown in the original report.

Any help highly appreciated.
Comment 2 Stephan Saalfeld 2013-08-02 04:15:40 CDT
Created attachment 114
Fiji message after mvn build

After building with mvn, the executable works but the attached message shows up.  If I manually delete the redundant files, an anew mvn build recreates them and the message shows again.  I assume that ./Build.sh would somehow prevent this but, well, it doesn't work.

Again, thanks for any help.
Comment 3 Stephan Saalfeld 2013-08-02 04:20:27 CDT
Running the updater first identifies several obsolete versions of particular jars.  I decided to delete them all.  After that, the updater stops working with the following Exception:

[INFO] Trying to install and execute the new updater
Exception in thread "Thread-6" net.java.sezpoz.IndexError: java.util.zip.ZipException: error in opening zip file
	at net.java.sezpoz.Index$LazyIndexIterator.peek(Index.java:180)
	at net.java.sezpoz.Index$LazyIndexIterator.hasNext(Index.java:185)
	at org.scijava.plugin.DefaultPluginFinder.findPlugins(DefaultPluginFinder.java:83)
	at org.scijava.plugin.DefaultPluginFinder.findPlugins(DefaultPluginFinder.java:53)
	at org.scijava.plugin.PluginIndex.discover(PluginIndex.java:103)
	at org.scijava.Context.<init>(Context.java:158)
	at org.scijava.Context.<init>(Context.java:120)
	at org.scijava.Context.<init>(Context.java:108)
	at imagej.updater.gui.UpdaterFrame.getUploaderService(UpdaterFrame.java:538)
	at imagej.updater.gui.ImageJUpdater.run(ImageJUpdater.java:208)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:127)
	at java.util.jar.JarFile.<init>(JarFile.java:135)
	at java.util.jar.JarFile.<init>(JarFile.java:72)
	at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
	at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
	at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:55)
	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
	at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:132)
	at java.net.URL.openStream(URL.java:1010)
	at net.java.sezpoz.Index$LazyIndexIterator.peek(Index.java:151)
	... 10 more
Comment 4 Johannes Schindelin 2013-08-02 11:47:16 CDT
The issue is that the pom.xml information in fiji.git has slightly contradicting transitive information: it wants to link to ImageJ 2 beta 7.1 which wants to link to ImageJ 1.47v, but fiji.git also wants to link to ImageJ 1.48a which introduced the breakage you described.

So it is better to think of the information in the Maven projects as compile-time information, but of course you should run the updater to work around this issue (I thought this self-evident, so I took care of more pressing issues for less clueful persons).
Comment 5 Stephan Saalfeld 2013-08-02 13:01:13 CDT
Thanks for the comment Johannes.  The problem is that I cannot run the updater because it breaks Fiji built by mvn as I described.  Fiji fails to start after update showing the posted exception.  I also cannot build Fiji using Build.sh because that, from the beginning, generates a Fiji that fails to start with that exact exception.  I admit that I am completely clueless what to do with it.

What I am experiencing is that I cannot use the updater of a Fiji that I built myself.  Sorry if I wasn't clear about that.
Comment 6 Johannes Schindelin 2013-08-02 15:05:23 CDT
Sorry, I assumed that you are familiar with the inner workings of Maven (in fact, our switch to Maven was based in large parts on your complaints about reproducible builds, the bloat of the precompiled/ directory, the fact that we used a non-standard build system you were unable to help me fix bugs with, etc).

The issues should have been resolved with the recent bump of the pom-scijava version used in fiji.git, as we now have a release coupling with the freshly-released ImageJ 2.0.0 beta 7.2 which I nicknamed "for Stephan, with love from Johannes".
Comment 7 Stephan Saalfeld 2013-08-03 06:24:24 CDT
Thanks for fixing this blocker and also for the love.

Beyond, I keep failing to see how I could have been helpful in resolving this issue economically except by reporting it.  It is a far way to conclude pom.xml inconcistencies when both mvn and ./Build.sh report success, and the result is an updater that breaks a running Fiji or a not running Fiji to begin with.  Apparently, I do not know about the inner workings of [mini]maven and the release cycles of ImageJ2 and scijava are notoriously external to my range of influence.

Thinking economically, I assume that it took me longer to write this bug report than it took you, the supposed designer of the bug, to find and fix it.  So I understand that we've both done our work well on this issue.  Thanks again for the fix and your great work in general.

Best,
Stephan