Invalid byte tag in constant pool: 18

4 篇文章 0 订阅
3 篇文章 0 订阅

网上有这个问题得解答,但是解决起来还是很麻烦

aspectj: Invalid byte tag in constant pool: 18 - 知乎

我来说是我得实践

首先这个问题在本地运行一直没问题

分析了半天发现本地用的是32 位为jdk,运行用了161 版jre

 改用linux 的 8.5.73 tomcat进行开发。问题重现了

然后还是无法解决啊

然后只能灰溜溜用回tomcat7.0.99

===============================直接用junit 测试=====================

package org.junit.test;  

import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath:spring/ApplicationContext.xml"})
public class SpringTest {  
      
    @Test  
    public void test() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring/ApplicationContext.xml");

    }

}

1.jre161 64位

 jdk8 161 64位 +spring 4.3.3 +junit

org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18

组织。aspectj。阿帕奇。bcel。类文件。类格式异常:

常量池中的字节标记无效:18

2.jdk1.8.0_111 32位 +spring 4.3.3 +junit

jre1.8.0_111 32位

还是一样

包冲突了,删掉这个jar

运行成功!!!!!

改回原来环境看看,ok.  改成tomcat8.201 运行试试

 运行成功!!!!!! !!!!!!

tomcat 8.5 死活不能运行

直接上 tomcat9.0.56 了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]和\[2\]中提到的错误信息"Invalid byte tag in constant pool"通常是由于jar包中的字节码文件损坏或不兼容导致的。解决这个问题的方法有几种: 1. 检查报错提示中提到的jar包路径,删除该jar包对应的文件夹,然后重新执行打包操作。这样可以确保使用的jar包是完整且没有损坏的。 2. 尝试更换依赖的版本。有时候不同版本的jar包之间存在兼容性问题,通过更换版本可以解决这个问题。 3. 尝试更换Tomcat的版本。不同版本的Tomcat可能对同一个war包的处理方式不同,因此可能会导致不兼容的问题。可以尝试使用不同的Tomcat版本来解决这个问题。 需要注意的是,Tomcat 7和Tomcat 8是不兼容的,因此如果遇到问题,可以考虑尝试多个Tomcat版本来找到适合的版本。 综上所述,如果你遇到了"Invalid byte tag in constant pool"的错误,可以尝试以上几种方法来解决问题。希望对你有帮助。\[1\]\[2\] #### 引用[.reference_title] - *1* [Invalid byte tag in constant pool: 19](https://blog.csdn.net/u011628753/article/details/128676559)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [Invalid byte tag in constant pool: 32 Tomcat启动报错](https://blog.csdn.net/nings666/article/details/129247039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值