superlee007

Results 5 comments of superlee007

> ![image](https://user-images.githubusercontent.com/45226442/58326321-102eb480-7e5f-11e9-8ec7-fc0a5bdc1964.png) > > ![image](https://user-images.githubusercontent.com/45226442/58326643-00fc3680-7e60-11e9-969e-9ad3e3504ea9.png) > > 加解密的字符位置和之前windows一样。在if判断内的。这是什么原因呢? 这个是spring-boot项目加密后启动报数组越界的错误。经排查是由于spring aop注解扫描的时候需要用asm框架去读取字节码数据,去获取注解信息,用于实例化对象,但是由于class文件已经被加密过,`SimpleMetadataReader`这个类去读取加密字节文件`InputStream`,然后在将输入流转换为字节数组去构建`ClassReader`,但是这个字节数组其实已经被c代码修改过了,因此会报数组越界异常。因此需要修改`SimpleMetadataReader`代码。 [详细的原因参考这篇文章](http://www.newsmth.net/nForum/#!article/Java/426008) ![image](https://user-images.githubusercontent.com/13740210/71893170-cbedeb80-3185-11ea-8221-c2042d1b6654.png) 由于牵扯到修改源码,有几种方式: 1.直接在项目里,建一个`org.springframework.core.type.classreading`包,将源码`SimpleMetadataReader`copy出来做修改即可。这是最简单直接的方式。 2.第一种方式可能需要每个加密项目都要建相同的包路径和文件,不是很优雅,因此还有一个思路就是修改`SimpleMetadataReader`类后自己在重新构建spring源码,发布。 3.修改源码,重新构建,打包发布考虑到也比较麻烦,因此就考虑使用jvmti 的class onload回调函数里,拦截`SimpleMetadataReader`的加载数据,进行替换。 首先也是将`SimpleMetadataReader`源码copy出来进行相应的字节码解密修改,然后读取`SimpleMetadataReader.class`文件,转为byte[]数组,然后转为16进制字符串,将16进制字符串进行两位一组分组,分组后每个字符串前加0x前缀(16进制标识),组成四位一组的的字节码数组输出(因为jvmti的ClassFileLoadHook回调函数的unsigned char* class_data就是这种格式)。将输出的字节码数组复制到c代码里,作为一个常量字符数组,然后在`ClassFileLoadHook`函数里拦截`org/springframework/core/type/classreading/SimpleMetadataReader`这个类,使用常量替换即可。 注意new_class_data在替换的时候需要申请新的数组空间,否则会出现服务随机无法启动的问题。

I delete all the volume and re-deploy wso2-apim, and I found that `wso2apim-with-analytics-apim` always exit abnormally at the first start up, and when it restart the error like above saying...

用的啥版本,默认脚本拉jar包是在私服,你可以用公服拉。 https://mvnrepository.com/artifact/io.choerodon/choerodon-tool-liquibase

Is there any solution? I have the same problem. My chart has some url_params for jinja filter, but when I drilldown, the filter is not passed through. Tks