小编Po *_*hoi的帖子

如何在springboot中使用自定义类加载器

如何在 Spring Boot 中使用自定义类加载器加载 bean

\n\n

我需要加密 Spring Boot 项目。

\n\n

起初我尝试使用proguard,但失败了,因为 spring 使用大量 Annotations 并且它有DI

\n\n

然后我尝试使用自定义类加载器。我想先加密我的类文件,然后使用我的自定义类加载器加载加密的类文件,然后解密它\xe3\x80\x82

\n\n

这是我的演示: https: //github.com/CaiBaohong/boot-by-custom-loader

\n\n

启动时失败:

\n\n
ConfigServletWebServerApplicationContext : \n  Exception encountered during context initialization - cancelling refresh attempt: \n    org.springframework.beans.factory.UnsatisfiedDependencyException: \n      Error creating bean with name \'methodValidationPostProcessor\' defined in class path resource \n        [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: \n          Unsatisfied dependency expressed through method \'methodValidationPostProcessor\' parameter 0; \n          nested exception is \n            org.springframework.beans.factory.CannotLoadBeanClassException: \n              Error loading class [com.abc.bootbycustomloader.controller.UserController] \n …
Run Code Online (Sandbox Code Playgroud)

encryption obfuscation spring classloader spring-boot

5
推荐指数
0
解决办法
3266
查看次数