We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › runtime access error - caused by scope resolution
Page Index Toggle Pages: 1
runtime access error - caused by scope resolution? (Read 559 times)
runtime access error - caused by scope resolution?
Apr 25th, 2009, 11:06pm
 
hi guys,
i'm new to processing and java(but a fairly experienced programmer) and am having a bit of an issue with not being able to access class members.

The error I'm getting is -
Code:
	at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:724)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:717)
at processing.core.PApplet.handleDraw(PApplet.java:1437)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Unknown Source)
java.lang.IllegalAccessException: Class processing.core.PApplet$RegisteredMethods can not access a member of class balls$Trigger with modifiers "public"


Now this only started occuring when I went from explicitly keeping a list of all the objects with a call method and calling it myself to using PApplet::registerDraw(), so I'm wondering if this is a problem with scope resolution perhaps, since I'm not explicitly keeping track of the objects (I assumed setting the callback would mean there was a reference and thus it would not be garbage collected).

I've uploaded a zip of my sketch so you can see the code - hiddenworlds.org/temp/balls.zip

Anyone have any insights?

Also is there a doxygen listing for the processing api? something that shows me all the members of PApplet as well?.

thanks
Re: runtime access error - caused by scope resolution?
Reply #1 - Apr 26th, 2009, 1:55am
 
timmeh wrote on Apr 25th, 2009, 11:06pm:
Also is there a doxygen listing for the processing api something that shows me all the members of PApplet as well.

Not Doxygen (alas) but the venerable JavaDoc: Developer's Reference, see Core one.

I didn't know registerDraw(), and the above mentioned doc is silent about it, but a quick search shown registerDraw() article. Looks useful...

I haven't looked at the source (showing it in plain text is more handy...), but you must ensure the methods Processing must access are public.
Page Index Toggle Pages: 1