java.lang.VerifyError: Bad type on operand stack in method
com.sun.net.httpserver.spi.HttpServerProvider
I have been plagued by this problem and managed to narrow it down to a
small file that fails throwing the java.lang.VerifyError when invoked from
Ant with fork set to false in the <java> task but succeeds when fork is
set to true.
The self-contained file is:
package foo;
import javax.xml.ws.Endpoint;
import javax.jws.WebService;
@WebService
class Hello {
public String sayHello() {
return "hello";
}
}
public class FooMain {
public static void main(String args[]) throws Exception {
Object implementor = new Hello();
String address = "http://localhost:9000/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
}
When invoked with Ant and fork set to false it throws:
java.lang.VerifyError: Bad type on operand stack in method
com.sun.net.httpserver.spi.HttpServerProvider$1.run()Ljava/lang/Object; at
offset 27
When invoked with fork set to true it succeeds. The specific exception
VerifyError especially when combined with "Bad type on operand stack"
points to a compiler bug from what I've read but why should it succeed or
fail depending on the fork attribute of the <java> Ant task is beyond me.
Any thoughts? I am running Ubuntu 12.04 with the following java tools:
$ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Server VM (build 24.0-b56, mixed mode)
$ javac -version
javac 1.7.0_40
$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
$ ant -diagnostics | grep java.vm
java.vm.version : 23.21-b01
java.vm.vendor : Oracle Corporation
java.vm.name : Java HotSpot(TM) Server VM
java.vm.specification.name : Java Virtual Machine Specification
java.vm.specification.vendor : Oracle Corporation
java.vm.specification.version : 1.7
java.vm.info : mixed mode
No comments:
Post a Comment