gpt4 book ai didi

java.lang.IllegalAccessException : is related to public/private attribute for classes? 异常

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:31:23 25 4
gpt4 key购买 nike

我的 Java 代码中出现以下错误:

java.lang.IllegalAccessException: Class org.apache.commons.digester.ObjectCreateRule can not access a member of class Response with modifiers ""

可能是因为类 Response 不是公共(public)类?如果是这样,我怎样才能使其可访问并将类 Response 与主类放在同一个文件中?

谢谢

更新,代码:http://www.smipple.net/snippet/aneuryzma/on:%20is%20related%20to%20public%20/%20private%20attribute%20for%20classes%20%3F

最佳答案

据我所知,您的类 Response 应该遵循 bean 约定:应该是公共(public)的,应该有公共(public)默认构造函数,并且应该为您从 xml 引用的所有字段设置 setter 和 getter。

关于java.lang.IllegalAccessException : is related to public/private attribute for classes? 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5105289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com