javassist版本升级无法解决java.lang.verifyerror:

pcww981p  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(377)

我们有一个用1.7编译的老项目,我们想把它的runtime env改为1.8(仍然用1.7编译)。在将runtime env改为1.8之后,我们得到了很多 java.lang.VerifyError 在日志中。对于其中一个:

ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to PostClassLoader: name=vfsfile:/opt/mss/mss-1.5.0.FINAL-jboss-jdk6-5.1.0.GA/XXX/ state=ClassLoader mode=Manual requiredState=PostClassLoader
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/opt/mss/mss-1.5.0.FINAL-jboss-jdk6-5.1.0.GA/XXX/
    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
    at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
    at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:274)
    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:263)
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
    at org.jboss.Main.boot(Main.java:221)
    at org.jboss.Main$1.run(Main.java:556)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 14
Exception Details:
  Location:
    classpath/ClassName.$javassist_read_YYY()Lcom/classpath/ClassName; @10: ifnonnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: 2ab4 0010 2ab9 04df 0100 c700 04b0 4c2a
    0x0000010: b904 df01 002a 1305 462b b904 e604 00c0
    0x0000020: 0548 b0                                

    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at org.jboss.deployment.AnnotatedClassFilter.hasAnnotations(AnnotatedClassFilter.java:194)
    at org.jboss.deployment.AnnotatedClassFilter.accepts(AnnotatedClassFilter.java:122)
    at org.jboss.deployment.AnnotatedClassFilter.visit(AnnotatedClassFilter.java:102)
    at org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(WrappingVirtualFileHandlerVisitor.java:62)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:362)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:374)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:374)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:374)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:374)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:374)
    at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:307)
    at org.jboss.virtual.VFS.visit(VFS.java:468)
    at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:448)
    at org.jboss.deployment.AnnotationMetaDataDeployer.getClasses(AnnotationMetaDataDeployer.java:225)
    at org.jboss.deployment.ConvergedSipAnnotationMetaDataDeployer.processSipMetaData(ConvergedSipAnnotationMetaDataDeployer.java:103)
    at org.jboss.deployment.ConvergedSipAnnotationMetaDataDeployer.deploy(ConvergedSipAnnotationMetaDataDeployer.java:90)
    at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:93)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    ... 30 more

起初我用 -noverify ,解决了问题。但是我意识到 -noverify 对于生产应用来说不是一个好主意。据我调查,建议升级 javassist 版本。因为在stacktrace中提到了javassist( classpath/ClassName.$javassist_read_YYY()Lcom/classpath/ClassName; @10: ifnonnull )我决定试一试。
我几乎尝试了所有javassist版本,包括3.19(使用jdk8构建),但都不起作用。仍然验证错误。
解决这个问题的办法是什么?或者有解决这个问题的方法吗?
系统信息:jboss 5.1.0.ga和maven 2.2.1
非常感谢你的帮助。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题