微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Progard模糊处理后{J44-RS}资源抛出org.glassfish.jersey.server.model.ModelValidationException

如何解决Progard模糊处理后{J44-RS}资源抛出org.glassfish.jersey.server.model.ModelValidationException

我有一个Spring boot的{​​{1}} multi-module maven项目正在运行。下面的此类用于确定我们应该为Jersey设置注册哪些资源-

Java8

REST端点如下所示:

@Slf4j
@Configuration
@Component
@ApplicationPath("/")
public class JerseyConfig extends ResourceConfig {

    @Autowired
    private AutowireCapablebeanfactory beanfactory;

    @postconstruct
    public void initialize() {

        // We will just look for all the classes in our resources
        // package annotated with @Path

        Reflections reflections = new Reflections("org.example.resource");
        Set<Class<? extends Object>> resources =
                reflections.getTypesAnnotatedWith(Path.class);
        resources.forEach(r -> {
            log.debug("Registering resource " + r);
            register(beanfactory.getBean(r));
        });

        register(ConstraintViolationExceptionMapper.class);

    }

}

现在,如果我与@Component @Api(value = "/api/1/summary",description = "Manage Summary") @Path("/api/1/summary") @Produces(MediaType.APPLICATION_JSON) public class SummaryResource extends AbstractUpdatableDomainResource<Summary> { @ApiOperation(value = "Create new summary",notes = "Create a new summary and return with its unique id",response = Summary.class) @POST @Override public User create(Summary newInstance) { } } 一起运行,则一切正常,但是当-dontobfuscate结束时,出现以下错误

obfuscate

所以我的问题是,如果代码混淆,是什么使它不运行?为什么混淆会破坏应用程序?如何忽略ModelValidationException?什么需要告诉proguard排除它才能运行?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。