File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reflection Problem

 
V Vijay Veeraraghavan
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
----------------------------------

dear all
i am using reflection to invoke particular methods to fetch the values from them. i have a class structure like this


//the above code works for all the methods... but for getValue and setValue exception is thrown....
java.lang.IllegalAccessException: Class MyClass can not access a member of class MyPackage.C with modifiers "public"

i am able to understand that the problem is with the protected package which i try to access from outside. but how do i solve this problem roundabout way...

thanks

Vijay Veeraraghavan

----------------------------------

[Nitesh: Added code tags: Please UseCodeTags]
[ November 24, 2008: Message edited by: Nitesh Kant ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really an advanced question. Have a read of the JavaDocs for java.lang.reflect.AccessibleObject; you should be able to work out the way round this from there.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic