java. Lang. illegalaccessexception: is it related to the public / private attribute of the class?

The following error occurred in my java code:

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

Maybe it's because the course response is not a public course? If so, how can I make it accessible and save the class response in the same file as the main class?

thank you

Update, code: http://www.smipple.net/snippet/aneuryzma/on:%20is%20related%20to%20public%20/%20private%20attribute%20for%20classes%20%3F

Solution

As far as I remember, your class response should follow the bean Convention: it should be public, there should be a public default constructor, and there should be setters and getters for all fields you reference from XML

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>