5

尝试部署 war 文件时出现以下错误。

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.VerifyError: Inconsistent stackmap frames at branch target 421


Exception Details:
  Location:
    it/codegen/tbx/search/service/TravelBoxSearch.convertQuoteItemsEx(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Lit/codegen/CGError; @421: getstatic
  Reason:
    Type 'it/codegen/CGResponse' (current frame, locals[5]) is not assignable to 'it/codegen/CGError' (stack map, locals[5])
  Current Frame:
    bci: @58
    flags: { }
    locals: { 'it/codegen/tbx/search/service/TravelBoxSearch', 'java/lang/String', 'java/lang/String', 'java/util/List', 'it/codegen/logging/TimeLogger', 'it/codegen/CGResponse', 'it/codegen/tbx/search/service/ShoppingBasket' }
    stack: { 'it/codegen/tbx/search/service/ShoppingBasket' }
  Stackmap Frame:
    bci: @421
    flags: { }
    locals: { 'it/codegen/tbx/search/service/TravelBoxSearch', 'java/lang/String', 'java/lang/String', 'java/util/List', 'it/codegen/logging/TimeLogger', 'it/codegen/CGError', 'it/codegen/tbx/search/service/ShoppingBasket' }
    stack: { }

  Bytecode:
    0x0000000: 013a 04b2 0127 9900 15bb 01a4 59b8 01a5
    0x0000010: b601 a6b8 01a7 b701 a83a 04b8 0222 2cb6
    0x0000020: 0223 bb07 d759 1402 1213 07d8 b707 d93a
    0x0000030: 052a 2cb7 02b0 3a06 1906 c601 6b19 06b6
    0x0000040: 02b1 3a07 1907 c601 452d c601 272d b902
    0x0000050: 4e01 009a 011e bb01 cc59 b701 cd3a 082d
    0x0000060: b902 3201 003a 0919 09b9 0233 0100 9900
    0x0000070: 4a19 09b9 0234 0100 c002 353a 0a19 0ac6
    0x0000080: 0036 190a b602 3ac6 002e 1908 bb00 3f59
    0x0000090: b700 4019 0ab6 023a b602 a4b6 0042 190a
    0x00000a0: b602 3ab6 023b b602 4cb6 0043 190a b602
    0x00000b0: 3ab6 011d 57a7 ffb2 1907 b603 cfc6 0079
    0x00000c0: 1907 b603 cfb9 0232 0100 3a09 1909 b902
    0x00000d0: 3301 0099 0063 1909 b902 3401 00c0 02cf
    0x00000e0: 3a0a 190a c600 4f19 08bb 003f 59b7 0040
    0x00000f0: 190a b604 1db6 0042 190a b605 81b6 024c
    0x0000100: b600 43b6 01e0 9900 2d19 08bb 003f 59b7
    0x0000110: 0040 190a b604 1db6 0042 190a b605 81b6
    0x0000120: 024c b600 43b6 01e1 c007 c819 0ab6 07da
    0x0000130: b607 dba7 ff99 2a2b 2db6 07c7 3a09 1909
    0x0000140: b602 8599 002b b200 29b8 0038 b200 3913
    0x0000150: 07dc b600 3b2a 1909 1907 1906 b707 dd3a
    0x0000160: 0519 0619 05b6 02ac c002 adb6 02c4 a700
    0x0000170: 34b2 0029 b800 38b2 0039 1307 deb6 003b
    0x0000180: 1905 1307 dfb6 027a a700 1ab2 0029 b800
    0x0000190: 38b2 0039 1307 e0b6 003b 1905 1307 e1b6
    0x00001a0: 027a a700 1ab2 0029 b800 38b2 0039 1303
    0x00001b0: feb6 003b 1905 1307 e2b6 027a 1905 3a07
    0x00001c0: b201 2799 0008 1904 b601 b619 07b0 3a0b
    0x00001d0: b201 2799 0008 1904 b601 b619 0bbf     
  Exception Handler Table:
    bci [27, 448] => handler: 462
    bci [462, 464] => handler: 462
  Stackmap Table:
    append_frame(@27,Object[#3374])
    full_frame(@103,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374],Object[#3451],Object[#3623],Object[#3624],Object[#3478],Object[#3480]},{})
    same_frame_extended(@181)
    chop_frame(@184,1)
    append_frame(@204,Object[#3480])
    same_frame_extended(@307)
    chop_frame(@310,1)
    chop_frame(@366,1)
    same_frame(@369)
    same_frame(@395)
    chop_frame(@418,1)
    same_frame(@421)
    same_frame(@444)
    append_frame(@459,Object[#3451])
    full_frame(@462,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374]},{Object[#3344]})
    full_frame(@475,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374],Top,Top,Top,Top,Top,Top,Object[#3344]},{})

java.lang.VerifyError: Inconsistent stackmap frames at branch target 421
Exception Details:
  Location:
    it/codegen/tbx/search/service/TravelBoxSearch.convertQuoteItemsEx(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Lit/codegen/CGError; @421: getstatic
  Reason:
    Type 'it/codegen/CGResponse' (current frame, locals[5]) is not assignable to 'it/codegen/CGError' (stack map, locals[5])
  Current Frame:
    bci: @58
    flags: { }
    locals: { 'it/codegen/tbx/search/service/TravelBoxSearch', 'java/lang/String', 'java/lang/String', 'java/util/List', 'it/codegen/logging/TimeLogger', 'it/codegen/CGResponse', 'it/codegen/tbx/search/service/ShoppingBasket' }
    stack: { 'it/codegen/tbx/search/service/ShoppingBasket' }
  Stackmap Frame:
    bci: @421
    flags: { }
    locals: { 'it/codegen/tbx/search/service/TravelBoxSearch', 'java/lang/String', 'java/lang/String', 'java/util/List', 'it/codegen/logging/TimeLogger', 'it/codegen/CGError', 'it/codegen/tbx/search/service/ShoppingBasket' }
    stack: { }
  Bytecode:
    0x0000000: 013a 04b2 0127 9900 15bb 01a4 59b8 01a5
    0x0000010: b601 a6b8 01a7 b701 a83a 04b8 0222 2cb6
    0x0000020: 0223 bb07 d759 1402 1213 07d8 b707 d93a
    0x0000030: 052a 2cb7 02b0 3a06 1906 c601 6b19 06b6
    0x0000040: 02b1 3a07 1907 c601 452d c601 272d b902
    0x0000050: 4e01 009a 011e bb01 cc59 b701 cd3a 082d
    0x0000060: b902 3201 003a 0919 09b9 0233 0100 9900
    0x0000070: 4a19 09b9 0234 0100 c002 353a 0a19 0ac6
    0x0000080: 0036 190a b602 3ac6 002e 1908 bb00 3f59
    0x0000090: b700 4019 0ab6 023a b602 a4b6 0042 190a
    0x00000a0: b602 3ab6 023b b602 4cb6 0043 190a b602
    0x00000b0: 3ab6 011d 57a7 ffb2 1907 b603 cfc6 0079
    0x00000c0: 1907 b603 cfb9 0232 0100 3a09 1909 b902
    0x00000d0: 3301 0099 0063 1909 b902 3401 00c0 02cf
    0x00000e0: 3a0a 190a c600 4f19 08bb 003f 59b7 0040
    0x00000f0: 190a b604 1db6 0042 190a b605 81b6 024c
    0x0000100: b600 43b6 01e0 9900 2d19 08bb 003f 59b7
    0x0000110: 0040 190a b604 1db6 0042 190a b605 81b6
    0x0000120: 024c b600 43b6 01e1 c007 c819 0ab6 07da
    0x0000130: b607 dba7 ff99 2a2b 2db6 07c7 3a09 1909
    0x0000140: b602 8599 002b b200 29b8 0038 b200 3913
    0x0000150: 07dc b600 3b2a 1909 1907 1906 b707 dd3a
    0x0000160: 0519 0619 05b6 02ac c002 adb6 02c4 a700
    0x0000170: 34b2 0029 b800 38b2 0039 1307 deb6 003b
    0x0000180: 1905 1307 dfb6 027a a700 1ab2 0029 b800
    0x0000190: 38b2 0039 1307 e0b6 003b 1905 1307 e1b6
    0x00001a0: 027a a700 1ab2 0029 b800 38b2 0039 1303
    0x00001b0: feb6 003b 1905 1307 e2b6 027a 1905 3a07
    0x00001c0: b201 2799 0008 1904 b601 b619 07b0 3a0b
    0x00001d0: b201 2799 0008 1904 b601 b619 0bbf     
  Exception Handler Table:
    bci [27, 448] => handler: 462
    bci [462, 464] => handler: 462
  Stackmap Table:
    append_frame(@27,Object[#3374])
    full_frame(@103,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374],Object[#3451],Object[#3623],Object[#3624],Object[#3478],Object[#3480]},{})
    same_frame_extended(@181)
    chop_frame(@184,1)
    append_frame(@204,Object[#3480])
    same_frame_extended(@307)
    chop_frame(@310,1)
    chop_frame(@366,1)
    same_frame(@369)
    same_frame(@395)
    chop_frame(@418,1)
    same_frame(@421)
    same_frame(@444)
    append_frame(@459,Object[#3451])
    full_frame(@462,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374]},{Object[#3344]})
    full_frame(@475,{Object[#3339],Object[#3359],Object[#3359],Object[#3375],Object[#3374],Top,Top,Top,Top,Top,Top,Object[#3344]},{})

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.getImplementorClass(DeploymentDescriptorParser.java:615)
    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:256)
    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:179)
    at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
    at com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:65)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5280)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

以下是我用来编译代码的k编译器

<plugin>            

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <executions>
        <execution>
            <id>default-testCompile</id>
            <phase>${testCompile.enable}</phase>
            <goals>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <encoding>ISO-8859-1</encoding>
        <source>1.8</source>
        <target>1.8</target>
        <useIncrementalCompilation>false</useIncrementalCompilation>
        <testSource>1.8</testSource>
        <testTarget>1.8</testTarget>
        <!--<testExcludes>-->
            <!--<exclude>**/test/*.java</exclude>-->
        <!--</testExcludes>-->
    </configuration>
</plugin>

请查看并回复,对不起,我不是格式化专家。

4

4 回答 4

7

经过一番努力,我发现了问题所在。在两个不同的库中有 CGError 和 CGResponse 的重复类。所以我猜在编译时使用的可能与在运行时加载的不同。无论如何,解决重复的类就成功了,并解决了这个问题。

PS:如果您使用的是 Java 1.8,请不要在 -XX:-UseSplitVerifier 配置上浪费时间来解决此问题,即使您使用的是 Java 1.7,也要尽量避免使用该配置。请浏览以下 URL,以便更好地了解该问题:

什么是堆栈图框

于 2016-02-16T09:48:29.090 回答
1

在我的情况下,这个问题与 javassist verison 相关,我在线程错误模拟类中报告了对 SQLiteOpenHelper 的引用

问候,

于 2018-12-13T10:04:51.617 回答
0

使用 Eclipse jee 2019-12-R 时出现此错误。更改 Eclipse 版本修复了它。

于 2021-03-02T09:49:31.783 回答
0

对于使用 OpenJDK Java 版本的任何人,就我而言,这个问题的原因是我在三元语句中进行了 instanceof 检查。一旦我用正确的 if-else 语句替换它,这个错误就消失了。当我将其设置回三进制时,错误返回。我的 JRE 是 8.0.212.03-hotspot 供参考。

我也在用Nashorn,不知道跟这个有关系吗?

于 2020-01-20T09:02:25.917 回答