JDK-6860079 : CORBA : rmic should be updated to jdk 7 class version
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:idl
  • Affected Version: 7
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2009-07-14
  • Updated: 2010-09-30
  • Resolved: 2009-07-22
Related Reports
Duplicate :  
Relates :  
Description
In JDK b62 , there are two fix : 

1) bug  6827026 ( http://monaco.sfbay/detail.jsf?cr=6827026 ) : Change default source and target level to 7 . 

2) Changes in http://hg.openjdk.java.net/jdk7/jdk7/corba/rev/23f2c435056b
------------------

BOOTSTRAP_TARGET_LEVEL = 5
-TARGET_LEVEL = 6
+
+ifdef TARGET_CLASS_VERSION
+ TARGET_LEVEL = $(TARGET_CLASS_VERSION)
+else
+ TARGET_LEVEL = 6
+endif 
------------- 

These two changes make most of corba testcase failed because of the following error : 
C:/Users/dtftest/AppData/Local/Temp/Work/JDK/corba/windows-i586/bin/rmic -classpath "Q:/comp/jsn/all_workspace/7_int/corba/rtm/lib/utils.jar;C:/Users/dtftest/AppData/Local/Temp/Work/exec/results-opteron002-09-06-30-10-07/workdir/dolphin;C:/Users/dtftest/AppData/Local/Temp/Work/JDK/corba/windows-i586/lib/tools.jar;Q:/comp/jsn/all_workspace/7_int/corba/rtm/lib/junit.jar" -iiop -keepgenerated -d C:/Users/dtftest/AppData/Local/Temp/Work/exec/results-opteron002-09-06-30-10-07/workdir/dolphin api.javax.rmi.PortableRemoteObject.ConnectImpl
error: Invalid class file format in C:\Users\dtftest\AppData\Local\Temp\Work\exec\results-opteron002-09-06-30-10-07\workdir\dolphin\api\javax\rmi\PortableRemoteObject\ConnectImpl.class.  The major.minor version '51.0' is too recent for this tool to understand.
error: Class api.javax.rmi.PortableRemoteObject.ConnectImpl not found.

Please see detailed log file from : http://sqeweb.sfbay.sun.com/jsn/test_exec/corba_rerun/b62_winvista-i586_c1/results/corba_result/logs/api/javax/rmi/PortableRemoteObject.log

" The major.minor version '51.0' is too recent for this tool to understand." ,
51 is JDK 7 class version .So , rmic tool itself may come from an old JRE version . 
I checked rmic class version , it shows jdk5 ( major version is 49 ) 
----------------
bash-3.00$ pwd
/java/re/jdk/7.0/promoted/all/b62/binaries/solaris-sparc/bin
bash-3.00$ javap -v -classpath .:../lib/tools.jar sun.rmi.rmic.iiop.Generator | grep major
  major version: 49
-----------------

Please update rmic to a jdk 7 class version, testcase may need updates as well.

Comments
SUGGESTED FIX The obvious thing to try is to increase JAVA_MAX_SUPPORTED_VERSION to 51 and see if that fixes the problem. Whether other problems appear depends on whether other class file format changes cause problems in the obsolete sun.tools code. Note that I do not work on sun.tools, or directly on the JDK, so I cannot make this change and test it.
22-07-2009

EVALUATION This is not surprising, as the rmic -iiop unfortunately depends on the obsolete and mostly undocumented code in (j2se) src/share/classes/sun/tools. I think this error is coming from sun.tools.java.BinaryClass, which checks to see if the version of the loaded class file is no more than sun.tools.java.RuntimeConstants.JAVA_MAX_SUPPORTED_VERSION, which is (at least in my recent JDK 1.6.0_12 source code) set to 50. Since JDK 7 recently moved to class file format version 51, rmic -iiop always fails.
22-07-2009