Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157018 - dev-java/eclipse-ecj-3.2 fails to compile www-servers/tomcat-5.5.20-r2
Summary: dev-java/eclipse-ecj-3.2 fails to compile www-servers/tomcat-5.5.20-r2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Low normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-03 12:35 UTC by Petteri Räty (RETIRED)
Modified: 2007-04-07 20:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2006-12-03 12:35:41 UTC
tomcat-util.jar:
     [echo] ----- Java-utils -----
     [echo] -- puretls.present = ${puretls.present}
     [echo] -- jsse.present = true /var/tmp/portage/tomcat-5.5.20-r2/temp/jsse-1.0.3/lib/jsse.jar
     [echo] -- commons-logging = true
     [echo] -- jmx = true /usr/share/mx4j-3.0/lib/mx4j.jar
     [echo] -- modeler = true /usr/share/commons-modeler/lib/commons-modeler.jar
     [echo] -- skip.digester = ${skip.digester}
     [echo] -- JDK14 = true
     [echo] -- JDK15 = true
    [javac] Compiling 94 source files to /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/build/build/classes
    [javac] ----------

****** SNIP *****

    [javac] ----------
    [javac] 25. ERROR in /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
    [javac]  (at line 107)
    [javac]     Collection crls = getCRLs(crlf);
    [javac]                       ^^^^^^^
    [javac] The method getCRLs(String) is undefined for the type JSSE15SocketFactory
    [javac] ----------
    [javac] 26. ERROR in /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
    [javac]  (at line 133)
    [javac]     protected Collection<? extends CRL> getCRLs(String crlf)
    [javac]               ^^^^^^^^^^
    [javac] The type Collection is not generic; it cannot be parameterized with arguments <? extends CRL>
    [javac] ----------
    [javac] 27. ERROR in /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
    [javac]  (at line 133)
    [javac]     protected Collection<? extends CRL> getCRLs(String crlf)
    [javac]                          ^^^^^^^^^^^^^
    [javac] Syntax error, parameterized types are only available if source level is 5.0
    [javac] ----------
    [javac] 28. ERROR in /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
    [javac]  (at line 140)
    [javac]     Collection<? extends CRL> crls = null;
    [javac]     ^^^^^^^^^^
    [javac] The type Collection is not generic; it cannot be parameterized with arguments <? extends CRL>
    [javac] ----------
    [javac] 29. ERROR in /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
    [javac]  (at line 140)
    [javac]     Collection<? extends CRL> crls = null;
    [javac]                ^^^^^^^^^^^^^
    [javac] Syntax error, parameterized types are only available if source level is 5.0
    [javac] ----------
    [javac] 29 problems (5 errors, 24 warnings)

BUILD FAILED
/var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/build.xml:49: The following error occurred while executing this line:
/var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/build/build.xml:595: The following error occurred while executing this line:
/var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/build/build.xml:188: The following error occurred while executing this line:
/var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/build.xml:75: Compile failed; see the compiler error output for details.

Total time: 14 seconds

!!! ERROR: www-servers/tomcat-5.5.20-r2 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  tomcat-5.5.20-r2.ebuild, line 167:   Called eant '-Dbase.path=/var/tmp/portage/tomcat-5.5.20-r2/temp' '-Dcommons-collections.jar=/usr/share/commons-collections/lib/commons-collections.jar' '-Dcommons-daemon.jar=/usr/share/commons-daemon/lib/commons-daemon.jar' '-Dcommons-digester.jar=/usr/share/commons-digester/lib/commons-digester.jar' '-Dcommons-dbcp.jar=/usr/share/commons-dbcp/lib/commons-dbcp.jar' '-Dcommons-el.jar=/usr/share/commons-el/lib/commons-el.jar' '-Dcommons-pool.jar=/usr/share/commons-pool/lib/commons-pool.jar' '-Dcommons-fileupload.jar=/usr/share/commons-fileupload/lib/commons-fileupload.jar' '-Dcommons-launcher.jar=/usr/share/commons-launcher/lib/commons-launcher.jar' '-Dcommons-modeler.jar=/usr/share/commons-modeler/lib/commons-modeler.jar' '-Djunit.jar=/usr/share/junit/lib/junit.jar' '-Djdt.jar=/usr/share/eclipse-ecj-3.1/lib/ecj.jar' '-Dlog4j.jar=/usr/share/log4j/lib/log4j.jar' '-Dcommons-beanutils.jar=/usr/share/commons-beanutils-1.7/lib/commons-beanutils.jar' '-Dcommons-logging.jar=/usr/share/commons-logging/lib/commons-logging.jar' '-Dcommons-logging-api.jar=/usr/share/commons-logging/lib/commons-logging-api.jar' '-Dmail.jar=/usr/share/sun-javamail/lib/mail.jar' '-Dadmin.build.notrequired=true' '-Dadmin.precompile.notrequired=true' '-Dexamples.precompile.notrequired=true' '-Djasper.home=/var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/jasper' '-Dcommons-httpclient.jar=/usr/share/commons-httpclient/lib/commons-httpclient.jar' '-Dactivation.jar=/usr/share/sun-jaf/lib/activation.jar' '-Djaxen.jar=/usr/share/jaxen/lib/jaxen-full.jar' '-Djmx.jar=/usr/share/mx4j-3.0/lib/mx4j.jar' '-Djmx-remote.jar=/usr/share/mx4j-3.0/lib/mx4j-rjmx.jar' '-Dsaxpath.jar=/usr/share/saxpath/lib/saxpath.jar' '-DxercesImpl.jar=/usr/share/xerces-2/lib/xercesImpl.jar' '-Dxml-apis.jar=/usr/share/xml-commons-external-1.3/lib/xml-apis.jar'
  java-utils-2.eclass, line 1346:   Called die

!!! eant failed
!!! If you need support, post the topmost build error, and the call stack if relevant.


The same thing happened on my development box. To reproduce:
                             
JAVA_PKG_FORCE_VM="sun-jdk-1.5" JAVA_PKG_BSFIX="off" JAVA_PKG_FORCE_COMPILER="ecj-3.2" emerge -1 tomcat

wltjr: Please keep this bug open even if you do not plan on supporting ecj as I might get interested enough to look into this myself.
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2006-12-04 15:21:59 UTC
From upstream, it sounds as if its an ecj problem rather than tomcat.

http://marc.theaimsgroup.com/?l=tomcat-dev&m=116519484403423&w=2

We will likely want to add:
 java-pkg_filter ecj-3.1  ecj-3.2

for now to supress ecj with tomcat.

Additionally, we should get a bug filed upstream to Eclipse, and if possible isolate a smaller test case than tomcat's code base ;)
Comment 2 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-01-14 23:19:17 UTC
This is probably not a bug. Let's see why.

(In reply to comment #0)
>     [javac] 27. ERROR in
> /var/tmp/portage/tomcat-5.5.20-r2/work/apache-tomcat-5.5.20-src/connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE15SocketFactory.java
>     [javac]  (at line 133)
>     [javac]     protected Collection<? extends CRL> getCRLs(String crlf)
>     [javac]                          ^^^^^^^^^^^^^
>     [javac] Syntax error, parameterized types are only available if source
> level is 5.0
>     [javac] ----------

Observe what it tries to tell you. You are trying to compile generics without -source=1.5+

> JAVA_PKG_FORCE_VM="sun-jdk-1.5" JAVA_PKG_BSFIX="off"
> JAVA_PKG_FORCE_COMPILER="ecj-3.2" emerge -1 tomcat

This is why. No build.xml rewriting, upstream's build xml probably doesn't specify source and target. Unlike javac, which defaults to jdk version, ecj defaults to 1.4 if not specified:

# ecj-3.2
Eclipse Java Compiler 0.670, 3.2.0 release, Copyright IBM Corp 2000, 2006. All rights reserved.

 Usage: <options> <source files | directories>
 If directories are specified, then their source contents are compiled.
 Possible options are listed below. Options enabled by default are prefixed with '+'
...
 Compliance options:
    -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)
    -1.4             + use 1.4 compliance level (implicit -source 1.3 -target 1.2)
    -1.5               use 1.5 compliance level (implicit -source 1.5 -target 1.5)
    -1.6               use 1.6 compliance level (implicit -source 1.6 -target 1.6)


So, it defaulted to 1.4 and tried to compile 1.5 (generics) source. If you try this with javac, it fails too (if you force -source 1.4), the error given is just more obvious than here.
Too bad this not-a-bug already caused so much grief. I suggest testing recent revision with ecj-3.2 with and without java5 useflag, without these artifical JAVA_PKG_BSFIX="off" conditions. If it works (and I think it will), no reason to filter ecj (except maintainer's personal hate :)
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-01-26 02:00:37 UTC
So the result:
ecj-3.2 works with all flags except examples, because then compiling of examples breaks - ant has ecj-3.2 on classpath and the jasper tasks (which doesn't care about build.sysclasspath=ignore) tries to use ecj-3.1 (tomcat is using it as jdt.jar property)
ecj-3.1 fails with java5 useflag (in a weird way):

compile:
    [javac] Compiling 40 source files to /var/tmp/portage/www-servers/tomcat-5.5.20-r8/work/apache-tomcat-5.5.20-src/servletapi/jsr154/build/classes
    [javac] 1.6 : Unknown VM version, default compliance used
    [javac] incorrect classpath: /opt/sun-jdk-1.6.0.1_alpha03/jre/lib/ext/meta-index
    [javac] Compliance level '1.4' is incompatible with source level '1.5'. A compliance level '1.5' or better is required

The offending line:
    <javac deprecation="${compile.deprecation}" destdir="${servlet-api.build}/classes" source="1.5" debug="${co
mpile.debug}" srcdir="src/share" optimize="${compile.optimize}" target="1.5" ></javac>

This fails with sun-jdk-1.6, sun-jdk-1.5 works. Tried to reproduce this via "ecj-3.1 -source 1.5 -target 1.5 Bah.java" on sun-jdk-1.6 but that didn't fail. So this might be general problem with ecj-3.1, sun-jdk-1.6 and ant(-1.7?)

So, the filtering might be smart based on combinations of use flags and VM used, but that's probably not worth the hassle. I think the best would be to make tomcat use ecj-3.2 instead of 3.1 as internal jdt, then it could be used for building too... and we should punt ecj-3.1 from the tree, seems it has some compatibility issues.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2007-04-07 20:55:23 UTC
Fixed in later Tomcat versions.