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 383 - fiji fails to start when isntalled from experimental repository
fiji fails to start when isntalled from experimental repository
Status: CLOSED FIXED
Product: Fiji
Classification: Unclassified
Component: Debian Packages
unspecified
PC Linux
: P2 normal
Assigned To: Mark Longair
Depends on:
Blocks:
 
Reported: 2011-11-25 09:35 CST by Alex Mestiashvili
Modified: 2011-11-30 18:33 CST
1 user (show)

See Also:

Description Alex Mestiashvili 2011-11-25 09:35:41 CST
On Ubuntu 10.04 Lucid AMD64 

after installation from http://pacific.mpi-cbg.de/downloads/apt-experimental/

fiji fails to start , java throws the following exceptions:

$fiji
Exception in thread "main" java.lang.NoClassDefFoundError: javassist/CannotCompileException
	at fiji.Main.premain(Main.java:67)
	at fiji.Main.main(Main.java:107)
Caused by: java.lang.ClassNotFoundException: javassist.CannotCompileException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	... 2 more
Comment 1 Mark Longair 2011-11-25 11:21:47 CST
Ouch - sorry, I should have spotted this.  I'm copying Johannes, who added the javassist patching of ImageJ, since I'm not familiar with how that works.  Would I be right in guessing this may be to do with ij.jar not being writable in the packaged version?
Comment 2 Alex Mestiashvili 2011-11-25 11:42:03 CST
(In reply to comment #1)
> Ouch - sorry, I should have spotted this.  I'm copying Johannes, who added the
> javassist patching of ImageJ, since I'm not familiar with how that works. 
> Would I be right in guessing this may be to do with ij.jar not being writable
> in the packaged version?
> 

Hello , 
I have no idea to be honest , could it be that it is a more general problem ? 
I  cloned the git repository and tried to build packages but build process failed with  fuji --update throwing 
Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jsch/UserInfo

libjsch-java is installed on the system 

dpkg -L libjsch-java 
<skip>
...
/usr/share/java/jsch-0.1.42.jar
/usr/share/maven-repo/com/jcraft/jsch/0.1.42/jsch-0.1.42.jar
/usr/share/maven-repo/com/jcraft/jsch/debian/jsch-debian.jar
/usr/share/java/jsch.jar

Alex 
Comment 3 Johannes Schindelin 2011-11-26 03:54:24 CST
The problem is that we now require javassist in the classpath. I changed fiji.c accordingly. With the next update, Fiji should work again!
Comment 4 Alex Mestiashvili 2011-11-29 09:50:35 CST
Thank you for fixing , 

I had to add jsch.jar to classpath to build packages from the git repository 

after built I could run fiji without problem .

so here is the patch :

diff --git a/fiji.c b/fiji.c
index 8906226..5237bc3 100644
--- a/fiji.c
+++ b/fiji.c
@@ -2458,6 +2458,8 @@ static void parse_command_line(void)
                        skip_build_classpath = 1;
                        string_append_path_list(class_path, fiji_path("plugins/Fiji_Updater.jar"));
                        string_append_path_list(class_path, fiji_path("jars/jsch-0.1.44.jar"));
+                       //Debian
+                       string_append_path_list(class_path, "/usr/share/java/jsch.jar");
                        main_class = "fiji.updater.Main";
                }
                else if (handle_one_option(&i, "--class-path", arg) ||


Thank you , 
Alex 
Comment 5 Mark Longair 2011-11-29 10:09:42 CST
The Debian packages from experimental work properly again as of today's build.  Thanks for reporting that.

The issue that you raise with building from the git repository is completely separate, and I can't reproduce it.  jsch.jar should either be built from the modules/jsch submodule (if that submodule is initialized and updated) or will be copied into place from the precompiled subdirectory.
Comment 6 Alex Mestiashvili 2011-11-29 10:21:36 CST
(In reply to comment #5)
> The Debian packages from experimental work properly again as of today's build. 
> Thanks for reporting that.
> 
> The issue that you raise with building from the git repository is completely
> separate, and I can't reproduce it.  jsch.jar should either be built from the
> modules/jsch submodule (if that submodule is initialized and updated) or will
> be copied into place from the precompiled subdirectory.
> 

confirm that it works. just had to run apt-get update one more time :) .
Thank you and have a nice day , 
Alex 

Comment 7 Johannes Schindelin 2011-11-29 18:11:48 CST
Thanks Alex for your patch. I actually had exactly the same diff in my worktree but then decided against committing it. Why? Because the diff in question only applies for the --update subcommand of Fiji and all the diff does is to support getting jsch.jar from the default location in Debian setups.

But in Debian setups, you're not supposed to be _able_ to update via the --update command. It should refuse to update due to missing privileges to write to the Fiji directory. Even if started with write permission to the Fiji directory, it would modify files that the Debian packages want to update. Worse, it could lead to a classpath conflict due to .jar files that might override files installed via apt-get.

So while I appreciate that you put in so much work, I hope you agree that this patch should not be applied?

Thanks!
Comment 8 Alex Mestiashvili 2011-11-30 18:05:25 CST
(In reply to comment #7)
> Thanks Alex for your patch. I actually had exactly the same diff in my worktree
> but then decided against committing it. Why? Because the diff in question only
> applies for the --update subcommand of Fiji and all the diff does is to support
> getting jsch.jar from the default location in Debian setups.
> 
> But in Debian setups, you're not supposed to be _able_ to update via the
> --update command. It should refuse to update due to missing privileges to write
> to the Fiji directory. Even if started with write permission to the Fiji
> directory, it would modify files that the Debian packages want to update.
> Worse, it could lead to a classpath conflict due to .jar files that might
> override files installed via apt-get.
> 
but "fiji  --update" is executed during the build process 

I just repeated it - cloned the repossitory , renamed it to fiji-20111129094958
and run debuild -us -uc 
and got the following result :

Building (fiji.build.ExecuteProgram) jars/imglib2.jar <- jars/Fiji...
Executing: './fiji' '--update' 'update' 'jars/imglib2.jar'
No GUI detected.  Falling back to headless mode.
Found that JAVA_HOME was: '/usr/lib/jvm/java-6-openjdk//jre'
Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jsch/UserInfo
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.UserInfo
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: fiji.updater.Main. Program will exit.
Program failed: './fiji --update update $TARGET'
Failed: 1
        in rule (fiji.build.ExecuteProgram) jars/imglib2.jar <- jars/Fiji...
        in rule (fiji.build.SubFake) jars/imglib2.jar <- modules/imglib/
        in rule (fiji.build.All) all <- fiji jars/ij.jar plugins/loci_too...
make: *** [build-arch-stamp] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1340:
dpkg-buildpackage -rfakeroot -D -us -uc failed


> So while I appreciate that you put in so much work, I hope you agree that this
> patch should not be applied?

I am totally ok with that :) 
> 
> Thanks!
> 

Thank you for the packages !

Alex 
Comment 9 Mark Longair 2011-11-30 18:33:28 CST
Alex,

The problem you're seeing there is because the Debian packages aren't built directly from the git repository - there are scripts that rewrite various build files to produce the Debian source package.

If you just want to build the Debian packages yourself, you can do:

    apt-get build-dep fiji
    apt-get source fiji

... then:

    cd fiji-[whatever]
    dpkg-buildpackage -rfakeroot -us -uc

If you're interested in how the Debian source files are generated from the standard Fiji source tree, you can look at:

    http://fiji.sc/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=debian/complete-build;hb=refs/heads/master

... but I honestly don't recommend that, it's pretty horrible.

regards,
mark