Skip to main content

ClassFormatError: Inconsistent or missing stackmap at target

2 replies [Last post]
aimself
Offline
Joined: 2009-05-31
Points: 0

we run the javaclass by the cldc_vm,but we got the error message like this:

/cldc_vm_r -cp /mfoneroot/app/target/java/ TestMathCeil
Uncaught exception: java.lang.Error: ClassFormatError: Inconsistent or missing stackmap at target
- java.lang.Class.invoke_verify(), bci=0
- java.lang.Class.initialize(), bci=103

why ? the TestMathCeil.class compiled by the eclipseme,I have try the JavaME sdk3.0 complied this class,but the error message still exist.
but some class the cldc_vm can run rightly,why?

the source of the TestMathCeil.java like this:

public class TestMathCeil {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Math0003();
}

public static int Math0003()
{

System.out.println("=============Math0003=====\n");
//double[] arrayOfDouble = { (-1.0D / 0.0D), -1.797693134862316E+308D, -1025.0D, -1024.0D, -1023.0D, -256.0D, -255.0D, -254.0D, -1.0D, -Double.MIN_VALUE, -0.0D, 0.0D, Double.MIN_VALUE, 1.0D, 254.0D, 255.0D, 256.0D, 1023.0D, 1024.0D, 1025.0D, 1.7976931348623157E+308D, (1.0D / 0.0D) };
double[] arrayOfDouble = { (-1.0D / 0.0D), -1.797693134862316E+30D, -1025.0D, -1024.0D, -1023.0D, -256.0D, -255.0D, -254.0D, -1.0D, -Double.MIN_VALUE, -0.0D, 0.0D, Double.MIN_VALUE, 1.0D, 254.0D, 255.0D, 256.0D, 1023.0D, 1024.0D, 1025.0D, 1.7976931348623157E+308D, (1.0D / 0.0D) };
int i = 0;

for (int j = 0; j < arrayOfDouble.length; ++j) {
double d2;
double d1 = arrayOfDouble[j];

if ((d1 > -1.0D) && (d1 < 1.0D)) {
d2 = 0.0D;
}
else
d2 = -0.5D;

if ((d1 > 0.0D) && (d1 < 1.0D))
d1 = 1.0D;

if ((d1 > -1.0D) && (d1 < -0.0D))
d1 = -0.0D;

if ((Math.ceil(arrayOfDouble[j]) != d1) || (Math.ceil(arrayOfDouble[j] + d2) != d1)) {
i = 1;
System.out.println("Failed with " + arrayOfDouble[j] + " != check.");
}

Double localDouble1 = new Double(Math.ceil(arrayOfDouble[j]));
Double localDouble2 = new Double(Math.ceil(arrayOfDouble[j] + d2));
Double localDouble3 = new Double(d1);
if (localDouble1.equals(localDouble3)) { if (d2 != 0.0D) if (localDouble2.equals(localDouble3));
} else {
i = 1;
System.out.println("Failed with " + arrayOfDouble[j] + " equals() check.");
}
}

if (i != 0){
System.out.println("public static strictfp double ceil(double a)");
return -1;
}

System.out.println("OKAY");

return 1;
}

}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aimself
Offline
Joined: 2009-05-31
Points: 0

注意用jdk1.4.2_09编译,preverify.exe用wtk2.5.2的preverify1.1.exe,然后用cldc_vm_r可以运行了。

aimself
Offline
Joined: 2009-05-31
Points: 0

I use preverify.exe,then can got the new class,then run again and got the error message like this:

[root@Linux java]#./cldc_vm_r -cp /mfoneroot/app/target/java/ TestMathCeil
Uncaught exception: java.lang.Error: ClassFormatError: Invalid version in .class file
(stack trace incomplete)

the command like this:

1)javac -bootclasspath D:\Tools\JavaME\WTK2.5.2_01\lib\midpapi20.jar;D:\Tools\JavaME\WTK2.5.2_01\lib\cldcapi11.jar v:\TestMathCeil.java

2).\preverify.exe -classpath D:\Tools\JavaME\WTK2.5.2_01\lib\midpapi20.jar;D:\Tools\JavaME\WTK2.5.2_01\lib\cldcapi11.jar;v:\ -d v:\ TestMathCeil