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 620 - SPIM_Registration fails to compile
SPIM_Registration fails to compile
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
PC Linux
: P5 blocker
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2013-06-11 04:38 CDT by Stephan Saalfeld
Modified: 2013-06-11 11:10 CDT
3 users (show)

See Also:

Description Stephan Saalfeld 2013-06-11 04:38:34 CDT
Just pulled Fiji and called mvn which stops with:

[INFO] ------------------------------------------------------------------------
[INFO] Building plugins/SPIM_Registration.jar
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [buildnumber:create {execution: default}]
[INFO] [imagej:set-rootdir {execution: set-rootdir}]
[debug] execute contextualize
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 24 source files to /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/bead/BeadRegistration.java:[192,73] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: mpicbg.spim.registration.bead.BeadIdentification
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<mpicbg.spim.registration.bead.BeadIdentification,T>
[ERROR] /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/bead/BeadRegistration.java:[361,73] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: mpicbg.spim.registration.bead.BeadIdentification
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<mpicbg.spim.registration.bead.BeadIdentification,T>
[ERROR] /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[35,56] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>
[ERROR] /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[174,22] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>
[ERROR] /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[192,35] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>
[INFO] 5 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/bead/BeadRegistration.java:[192,73] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: mpicbg.spim.registration.bead.BeadIdentification
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<mpicbg.spim.registration.bead.BeadIdentification,T>
/home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/bead/BeadRegistration.java:[361,73] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: mpicbg.spim.registration.bead.BeadIdentification
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<mpicbg.spim.registration.bead.BeadIdentification,T>
/home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[35,56] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>
/home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[174,22] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>
/home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java:[192,35] invalid inferred types for S; inferred type does not conform to declared bound(s)
inferred: S
bound(s): mpicbg.spim.registration.detection.DetectionIdentification<S,T>

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50 seconds
[INFO] Finished at: Tue Jun 11 11:30:17 CEST 2013
[INFO] Final Memory: 126M/765M
[INFO] ------------------------------------------------------------------------



then tried with Build.sh which stops with

Compiling 155 files in /home/saalfeld/workspace/fiji-clean/src-plugins/SPIM_Registration
error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Error reading configuration file
Exception in thread "main" imagej.build.minimaven.JavaCompiler$CompileError: Compile error: 1
	at imagej.build.minimaven.JavaCompiler.call(JavaCompiler.java:83)
	at imagej.build.minimaven.MavenProject.build(MavenProject.java:444)
	at imagej.build.minimaven.MavenProject.build(MavenProject.java:375)
	at imagej.build.minimaven.MavenProject.build(MavenProject.java:398)
	at imagej.build.minimaven.MavenProject.buildAndInstall(MavenProject.java:332)
	at imagej.build.minimaven.MavenProject.buildAndInstall(MavenProject.java:327)
	at imagej.build.minimaven.MavenProject.buildAndInstall(MavenProject.java:327)
	at imagej.build.minimaven.MavenProject.buildAndInstall(MavenProject.java:289)
	at imagej.build.MiniMaven.main(MiniMaven.java:138)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   395  100   395    0     0   1452      0 --:--:-- --:--:-- --:--:--  2841
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   357  100   357    0     0   1317      0 --:--:-- --:--:-- --:--:--  2586
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16801  100 16801    0     0  41915      0 --:--:-- --:--:-- --:--:-- 62690
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 34881  100 34881    0     0  65708      0 --:--:-- --:--:-- --:--:-- 88083



This is my Java:

java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Thanks in advance for any assistance.
Comment 1 Johannes Schindelin 2013-06-11 09:07:41 CDT
> OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)

Try Oracle JDK.
Comment 2 Stephan Preibisch 2013-06-11 09:29:06 CDT
Hi Stephan,

this source code has not been changes for quite some time ... so it should be a compiler issue as Johannes suggested. Eclipse builds it and on my MAC and Ubuntu it builds as well.

Bye bye,
Steffi
Comment 3 Stephan Saalfeld 2013-06-11 09:33:33 CDT
Thanks for the hints.  Before I install Oracle Java, which compiler are you using Stephan?  On Ubuntu 12.04, the mentioned

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

is the default---at least to my knowledge.

Have you actually built it with mvn from the terminal?
Comment 4 Stephan Preibisch 2013-06-11 09:51:15 CDT
Hi,

for me he does build the SPIM Registration when compiling with 'mvn', but he fails later on:

...
[INFO] plugins/SPIM_Opener.jar ........................... SUCCESS [0.816s]
[INFO] plugins/SPIM_Registration.jar ..................... SUCCESS [1.538s]
...
[ERROR] Failed to execute goal on project Image_Expression_Parser: Could not resolve dependencies for project sc.fiji:Image_Expression_Parser:jar:2.0.0-SNAPSHOT: Could not find artifact jama:Jama:jar:1.0.2 in imagej.releases (http://maven.imagej.net/content/repositories/releases) -> [Help 1]

Java is:

preibisc@myers-pc-8:~/workspace/fiji$ java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Bye bye,
Steffi
Comment 5 Curtis Rueden 2013-06-11 10:05:27 CDT
In response to Steffi's bug about Jama, the problem is that it is stored in the "thirdparty" repository rather than the "releases" one. I am adding that to the Fiji POM now; will comment again when it is working.

In response to Stephan's bug, I too am able to build on Ubuntu 12.04 with OpenJDK 7:

    $ java -version
    java version "1.7.0_21"
    OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.04.1)
    OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I will test with OpenJDK 6 too, in a bit.
Comment 6 Curtis Rueden 2013-06-11 10:35:21 CDT
I tested with OpenJDK 6 (same version as Stephan) and get the same build errors.

Unfortunately, the following changes are not enough to fix everything:

--snip--
diff --git a/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java b/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java
index f099816..c355b5b 100644
--- a/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java
+++ b/src-plugins/SPIM_Registration/src/main/java/mpicbg/spim/registration/detection/DetectionRegistration.java
@@ -32,7 +32,8 @@
                {
                        final T detectionA = correspondences.get( i ).getPoint1();
                        final T detectionB = correspondences.get( i ).getPoint2();
-                       final ArrayList<Integer> inconsistent = getOccurences( detectionA, detectionB, correspondences );
+                       // NB: pass <S, T> to avoid bug in OpenJDK 6 "1.6.0_27" (IcedTea6 1.12.5)
+                       final ArrayList<Integer> inconsistent = DetectionRegistration.<S, T>getOccurences( detectionA, detectionB, correspondences );
                        
                        if ( inconsistent.size() > 0 )
                                for ( int index : inconsistent )
@@ -171,7 +172,8 @@
                        final ArrayList<PointMatchGeneric<T>> inlierList, 
                        final Model<?> model )
        {
-               return computeRANSAC( correspondenceCandidates, inlierList, model, 10, 0.1f, 3, 10000 );
+               // NB: pass <S, T> to avoid bug in OpenJDK 6 "1.6.0_27" (IcedTea6 1.12.5)
+               return DetectionRegistration.<S, T>computeRANSAC( correspondenceCandidates, inlierList, model, 10, 0.1f, 3, 10000 );
        }
 
        public static <S extends DetectionIdentification<S,T>, T extends DetectionView<S,T> > String computeRANSAC( 
@@ -189,7 +191,8 @@
                /*
                 * First remove the inconsistent correspondences
                 */
-               removeInconsistentCorrespondences( correspondenceCandidates );
+               // NB: pass <S, T> to avoid bug in OpenJDK 6 "1.6.0_27" (IcedTea6 1.12.5)
+               DetectionRegistration.<S, T>removeInconsistentCorrespondences( correspondenceCandidates );
 
                // if there are not enough correspondences for the used model
                if ( numCorrespondences < minNumCorrespondences )
--snap--

I think that the bug is relating to the specific combination of S and T here, such that any usage of those methods causes problems. Given that it is fixed in OpenJDK 7, it is not worth working around, IMO.
Comment 7 Stephan Saalfeld 2013-06-11 10:49:52 CDT
Thanks a lot Curtis!

I will switch to OpenJDK7 then.

Surprising that the bug didn't hit me earlier.  Seems to be something recently introduced into OpenJDK6...

All the best and thanks again!
Comment 8 Curtis Rueden 2013-06-11 11:10:23 CDT
Closing this ticket as "WONTFIX" since we didn't resolve the OpenJDK6 build failures.

Regarding the Jama issue: I was wrong about the thirdparty repository not being available from the Fiji POM. (Of course it is, since it inherits that reference from the parent.)

Rather, the issue was a version mismatch for the jep dependency of Image_Expression_Parser. I pushed a fix to fiji master.

If you pull and rebuild, the problem should be gone.

If you want to be completely tidy, you can clean out the invalid jama reference:

    rm -rf ~/.m2/repository/jama/Jama

All of Fiji now builds on my Ubuntu Linux 12.04 64-bit system with OpenJDK7, though you need to crank up the available RAM to do it all in one shot:

    export MAVEN_OPTS="-Xmx1536m -XX:MaxPermSize=256m"

Otherwise the build fails halfway through with OutOfMemoryError. You can still resume with "mvn" again though.

Lastly, I had one test failure in TrackMate_. You can skip the tests using:

    mvn -DskipTests