Issue Details (XML | Word | Printable)

Key: GLASSFISH-17285
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Romain Grécourt
Reporter: Byron Nevins
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
glassfish

Support building with Java SE 7

Created: 09/Sep/11 06:52 PM   Updated: 02/Apr/12 01:41 PM   Resolved: 02/Apr/12 01:41 PM
Component/s: build_system
Affects Version/s: None
Fix Version/s: 4.0_b30

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments: 1. GZip Archive building_gf_with_jdk7_changes.tar.gz (2 kB) 16/Sep/11 10:02 AM - Romain Grécourt
2. File glassfish_tests_ignores-update1.diff (11 kB) 16/Sep/11 11:17 AM - Romain Grécourt
3. File glassfish_tests_ignores-update2.diff (10 kB) 19/Sep/11 09:17 AM - Romain Grécourt
4. File glassfish_tests_ignores-update3.diff (11 kB) 19/Sep/11 05:05 PM - Romain Grécourt
5. File glassfish_tests_ignores-update4.diff (6 kB) 23/Feb/12 07:41 PM - Romain Grécourt
6. File glassfish_tests_ignores.diff (10 kB) 16/Sep/11 10:02 AM - Romain Grécourt


Tags: 3_1_2-exclude GlassFish JDK7 Java7 JavaSE7
Participants: Byron Nevins, janey and Romain Grécourt

  • Sub-Tasks:
  • All
  • Open

 Description  « Hide

If you try to build GlassFish with JDK7 you will probably scratch your head wondering what the problem is. It's one of those situations where you have to have a mental mapping like this:

<Enormous Weird Bizarre Error Message about HK2> ===> You forgot to set your JDK back to 6!!

=======
Instead why not simply FORBID compiling with 7 – then we will get a nice error message that says exactly what the problem is?

Eventually when the problem is fixed – remove the restriction.

Here is the actual compile error:

[INFO] Building in d:\gf\main\nucleus\common\common-util
[INFO] ------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[delete] Deleting: D:\gf\main\nucleus\common\common-util\src\main\java\com\sun\appserv\server\util\Version.java
[copy] Copying 1 file to D:\gf\main\nucleus\common\common-util\src\main\java\com\sun\appserv\server\util
[INFO] Executed tasks
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 22 resources
-----------------------------------------------------
this realm = app0.child-container[org.glassfish.hk2:hk2-maven-plugin:1.6.17]
urls[0] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/hk2-maven-plugin/1.6.17/hk2-maven-plugin-1.6.17.jar
urls[1] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/hk2-maven/1.6.17/hk2-maven-1.6.17.jar
urls[2] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/hk2-core/1.6.17/hk2-core-1.6.17.jar
urls[3] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/class-model/1.6.17/class-model-1.6.17.jar
urls[4] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/config/1.6.17/config-1.6.17.jar
urls[5] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/auto-depends/1.6.17/auto-depends-1.6.17.jar
urls[6] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/external/javax.inject/1.6.17/javax.inject-1.6.17.jar
urls[7] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/external/asm-all-repackaged/1.6.17/asm-all-repackaged-1.6.17.jar
urls[8] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/hk2-api/1.6.17/hk2-api-1.6.17.jar
urls[9] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar
urls[10] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/jvnet/tiger-types/1.4/tiger-types-1.4.jar
urls[11] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/external/bean-validator/1.6.17/bean-validator-1.6.17.jar
urls[12] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/com/googlecode/jtype/jtype/0.1.0/jtype-0.1.0.jar
urls[13] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
urls[14] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/maven/maven-archiver/2.0.4/maven-archiver-2.0.4.jar
urls[15] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-4/plexus-archiver-1.0-alpha-4.jar
urls[16] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/osgi/osgi_R4_core/1.0/osgi_R4_core-1.0.jar
urls[17] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/hk2-dependency-verifier/1.6.17/hk2-dependency-verifier-1.6.17.jar
urls[18] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/osgi-adapter/1.6.17/osgi-adapter-1.6.17.jar
urls[19] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/bcel/bcel/5.2/bcel-5.2.jar
urls[20] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/config-generator/1.6.17/config-generator-1.6.17.jar
urls[21] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/glassfish/hk2/auto-depends-plugin/1.6.17/auto-depends-plugin-1.6.17.jar
urls[22] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.1.3/jaxb-xjc-2.1.3.jar
urls[23] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar
urls[24] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
urls[25] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/javax/xml/stream/stax-api/1.0/stax-api-1.0.jar
urls[26] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
urls[27] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/com/sun/xml/stream/sjsxp/1.0/sjsxp-1.0.jar
urls[28] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.jar
urls[29] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.5.3/plexus-compiler-api-1.5.3.jar
urls[30] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/1.5.3/plexus-compiler-manager-1.5.3.jar
urls[31] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.5.3/plexus-compiler-javac-1.5.3.jar
urls[32] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
urls[33] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar
urls[34] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/org/apache/maven/shared/maven-osgi/0.2.0/maven-osgi-0.2.0.jar
urls[35] = file:/C:/Users/wnevins.ST-USERS/.m2/repository/biz/aQute/bndlib/0.0.203/bndlib-0.0.203.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8

this realm = plexus.core
urls[0] = file:/C:/bin/apache-maven-2.2.1/bin/../lib/maven-2.2.1-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.glassfish.hk2:hk2-maven-plugin:1.6.17:hk2-compile': Unable to load the mojo 'org.glass
fish.hk2:hk2-maven-plugin:1.6.17:hk2-compile' in the plugin 'org.glassfish.hk2:hk2-maven-plugin'. A required class is missing: com/sun/mirror/apt/Anno
tationProcessorFactory
com.sun.mirror.apt.AnnotationProcessorFactory
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Fri Sep 09 11:48:33 PDT 2011
[INFO] Final Memory: 33M/245M
[INFO] ------------------------------------------------------------------------



janey added a comment - 12/Sep/11 12:52 PM

Assign to Romain. He is working on this and has made good progress.


Romain Grécourt added a comment - 16/Sep/11 10:02 AM - edited

Here are all the changes made in HK2,glassfishbuild and GlassFish (see building_gf_with_jdk7_changes.tar.gz) in order to have the GlassFish workspace buildable with the JDK7. New versions of HK2 (1.6.18) and glassfishbuild (3.2.2) have been released, they are now used in the GlassFish trunk (see r49613).

Furthermore the GlassFish workspace still requires some workaround to build from scratch with the JDK7 because of some unit tests that fail randomly (see http://wiki.apidesign.org/wiki/OrderOfElements#JUnit_and_Switch_to_JDK7). You can use the attached diff file to avoid these unit tests and so build GlassFish from scratch with JDK7.

I'll create separate issues for each of these unit tests.


Romain Grécourt added a comment - 16/Sep/11 11:17 AM - edited

The behavior observed regarding the unit tests that fail is random. Even if I was able to build several times (about 10 times) from scratch with the first set of ignores, I discovered a new one just after having updated the issue...

Here is a diff file to ignores these failing tests (glassfish_tests_ignores-update1.diff), available as attachment.


Romain Grécourt added a comment - 19/Sep/11 09:17 AM - edited

since Cheng resolve one the subtask #17306 (unit tests from nucleus/common/glassfish-naming) the set of ignores changed. Here is a new update of the ignore diff file that can be used with revison 49672 and above (glassfish_tests_ignores-update2.diff available as attachment).


Romain Grécourt added a comment - 19/Sep/11 05:02 PM

Reopened the sub task #17306 as some other unit test from nucleus/common/glassfish-naming are failing.

I've found a way to reproduce the issues each time by running the test methods individually.

$ cd [glassfishWorkspace]/[module]
$ mvn -Dtest=fullClassName#testMethodName org.apache.maven.plugins:maven-surefire-plugin:2.8:test

You must use a version of the surefire plugin greater or equals to 2.7.3. For more information see this link


Romain Grécourt added a comment - 19/Sep/11 05:05 PM

Last diff file for ignoring the unit tests. (glassfish_tests_ignores-update3.diff)


Romain Grécourt added a comment - 23/Feb/12 07:41 PM

attaching last version of the diff file to ignore the unit test.


Romain Grécourt added a comment - 02/Apr/12 01:41 PM

GlassFish trunk is build-able with JDK7 since revision #53208 (03/28/12).