JDK-6548418 : Fatal Error: Unable to find method initCause
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-04-20
  • Updated: 2011-02-16
  • Resolved: 2007-07-27
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
I've tested with a couple of different versions:

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)

java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
I'm trying to upgrade from j2sdk1.4.2_08 to jdk1.6.0_01.

When running with j2sdk1.4.2_08:

javac -J-Xmx512M -g -deprecation -bootclasspath <cldc11 jar file> -extdirs "" -classpath <class output folder> -d <class output folder> -sourcepath <generated source code> @<java filelist>

it compiles.

When running with jdk1.6.0_01:

javac -J-Xmx512M -g -deprecation -bootclasspath <cldc11 jar file> -extdirs "" -classpath <class output folder> -d <class output folder> -sourcepath <generated source code> @<java filelist>

javac complains about "cannot access java.lang.Void".

I've tried adding "-source 1.4 -target 1.4" as javac arguments but that gives me the following output from javac:

cannot find symbol
symbol  : method initCause(java.lang.ClassNotFoundException)

Fatal Error: Unable to find method initCause

I've discovered that executing j2sdk1.4.2_08 with "-source 1.4 -target 1.4" arguments gives the same error. However, a workaround with j2sdk1.4.2_08 is to remove "-source 1.4 -target 1.4" which is not possible with jdk1.5.0_11, jdk1.6.0 and jdk1.6.0_01.

initCause is a method in Throwable in Java SE since 1.4. The method is not included in the Throwable class in the cldc 1.1 jar that I use.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following javac command:

javac -J-Xmx512M -g -deprecation -source 1.4 -target 1.4 -bootclasspath <cldc11 jar file> -extdirs "" -classpath <class output folder> -d <class output folder> -sourcepath <generated source code> @<java filelist>


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The compilation should work.
ACTUAL -
The compilation fails.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
cannot find symbol
symbol  : method initCause(java.lang.ClassNotFoundException)

Fatal Error: Unable to find method initCause

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
No known workaround.

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION Please provide the cldc11 jar file and the testing java source file you used. Also, please explain <class output folder> and <generated source code>. I cannot reproduce this bug with the cldc11 jar file I have and my own testing source file. Thank you.
28-06-2007

EVALUATION The java.lang.Void issue is bug 6390045. The initCause problem is new (as far as I recall).
15-05-2007