liaochong / myexcel

MyExcel, a new way to operate excel!
https://github.com/liaochong/myexcel/wiki
Apache License 2.0
1.66k stars 325 forks source link

Beetil3.2.2 NoSuchMethodError #286

Closed chenhahahahaha closed 4 years ago

chenhahahahaha commented 4 years ago

Bug描述 程序使用的是beetl 3.x版本(无法降级) 在使用myexcel3.9.9 想做excel导出时报错

java.lang.NoSuchMethodError: org.beetl.core.GroupTemplate.getTemplate(Ljava/lang/String;)Lorg/beetl/core/Template;
    at com.github.liaochong.myexcel.core.templatehandler.BeetlTemplateHandler.setTemplateEngine(BeetlTemplateHandler.java:45) ~[myexcel-3.9.9.jar:na]
    at com.github.liaochong.myexcel.core.templatehandler.AbstractTemplateHandler.classpathTemplate(AbstractTemplateHandler.java:40) ~[myexcel-3.9.9.jar:na]

Bug复现 按如下步骤复现(Steps to reproduce the behavior):

  1. 项目的jar 版本 com.ibeetl sql-springboot-starter 3.0.9-RELEASE
    <dependency>
        <groupId>com.github.liaochong</groupId>
        <artifactId>myexcel</artifactId>
        <version>3.9.9</version>
    </dependency>
  2. 使用master分支的example项目, 将 com.ibeetl beetl 2.9.9

    替换成

    com.ibeetl sql-springboot-starter 3.0.9-RELEASE

    调用 BeetlExcelBuilderExampleController.buildWithSXLSX 可以复现

尝试办法 重写了BeetlTemplateHandler和BeetlExcelBuilder 在 BeetlExcelBuilder中 public MyBeetlExcelBuilder() { super(MyBeetlTemplateHandler.class); } 出现Cannot be accessed from outside package

liaochong commented 4 years ago

3.9.9版本,采用beetl 3.2.4.RELEASE最新版,未出现描述问题 ![Uploading image.png…]()

liaochong commented 4 years ago

3.2.2.RELEASE版本beetl作者移除了某些方法,后续版本又兼容上了,建议单独升级下beetl版本为3.2.4.RELEASE,3.9.10版本将修复自定义ExcelBuilder outside package问题

liaochong commented 4 years ago

3.9.10版本已发布,预计2020-11-22可用,感谢使用!!!