Google App Engine - 运行 GWTTestCase 时的"java.lang.VerifyError: Cannot inherit from final class"



我刚刚写了我的第一个GWTTestCase,但运行它总是会给我一个VerifyError。这是我的一个伟大测试套件的胚胎:

public void test() {
    Invoice invoice = new Invoice();
    invoice.setInvoiceDate(DateTimeFormat.getFormat(DomainResource.DATE_PATTERN).format(new Date()));
    InvoiceEditorDriver driver = GWT.create(InvoiceEditorDriver.class);
    InvoiceNumberEditor editor = new InvoiceNumberEditor();
    driver.initialize(editor);
    driver.edit(invoice);
    assertFalse(driver.isDirty());
    }

为了完整起见,我将GoogleAppEngine和GWT一起使用,我认为这可能与AppEngine的安全沙盒有关。

正在加载的类是"com.gargoylesoftware.htmlmunit.SocksSocketFactory"。

这里的完整堆栈:

Exception in thread "htmlUnit client thread" java.lang.VerifyError: Cannot inherit from final class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:542)
    at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:506)
    at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:150)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1281)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1198)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361)
    at com.google.gwt.junit.RunStyleHtmlUnit$HtmlUnitThread.run(RunStyleHtmlUnit.java:136)

我尝试排除给定类的GAE验证,但没有成功。我不确定排除验证是否足够,是否可以为jar中的文件设置验证排除规则。

可能是类路径问题。

邮件列表中也有类似的问题,通过从类路径中删除PlainSocketFactory的第二个实例来解决。

相关内容

最新更新