Archived

This topic is now archived and is closed to further replies.

misterX

[java] GF4J widgets: <<no stack trace available>>

Recommended Posts

Well, i'm beginnig to use GF4J and have some problems. i'm using WidgetScreens containig GFButtons. At the beginning, all worked fine, i clicked on buttons, get notifications... but then, after i wanted to change the a part of the program structure, i'm getting errors and i have no idea where they come from. description: i see the screen, the widget button is shown, you see when you the rollover and the down effect but it doesn't send the notification as it should! When i clic several times, i get these error messages: Exception occured during event dispatching: Java.lang.OutOfMemory <<>no stack trace available>> (the '>' in '<<>' is not existing, it's to avoid the text taken as a tag!) And the source of 'OutOfMemory' can't be of graphic nor sound origin. What's happening ? [edited by - misterX on July 28, 2002 5:49:49 AM]

Share this post


Link to post
Share on other sites
Since the stack trace is generated dynamicly I think it''s telling you that it''s out of memeory and cannot generate a stack trace.

I think you need to look through all of your changes and determine where you leak is. You are obviouslt allocating object somewhere and not releasing them. It coul dbe something as simple as not checking to see of anything particualr needs to be done to a class before unloading it. I know it''s touch but look again until you find it.

Share this post


Link to post
Share on other sites
how wow wow, a bit more slowly please! ;-)
i''m only a hobbyist so i don''t understand everything. first, what is the meaning of "stack trace"? where does the error exactly come from ?
quote:

I think you need to look through all of your changes and determine where you leak is.


Of course it''s what i did, and i know approximately which are the changes that occured these errors. Approximately. But i can''t fix it since i know nothing about the "where" and most of all, the "why". i''ve no idea where it why these errors happen!
(and i would be disapointed to go back to my previous structure)

quote:

You are obviouslt allocating object somewhere and not releasing them. It coul dbe something as simple as not checking to see of anything particualr needs to be done to a class before unloading it.


As far as i know, it''s not the case...



Arrggghhh, it''s so annoying! Now, I get even errors from Kernel32 !

Share this post


Link to post
Share on other sites
i've now identified the reason of all this. It's because the screen which is drawn is not the same as the one which listen to mouse and keyboard. The right screen is drawn but the (re)actions where dependent from another. Leading to many confusions and troubles.

This may seem an obious problem and easy to solve, but it seems to be a little deeper.
When i "choose" the screen to be drawn, i also call 'requestFocusControl()' for the corresponding screen, inherited from GFWidgetScreen. I checked that the shown screen is really the last wich calls 'requestFocusControl()'. Nevertheless, this screen has not the focus but still another, the one wich was the last to be created (instancieted).
How to solve this ?...

...after i looked a bit in the source code of GFWidgetScreen and the related classes, i had the feeling this classes were not 100% finished. I first noticed some very minor mistakes, details, but then as i looked deeper in the focus manager, i had the feeling it was... not functional. For screen focusing at least.

has someone had the same experience/problems ? some informations about it?
Can you confirm or infirm it javanerd ? you're in the best position to know it!

[edited by - misterX on July 29, 2002 6:35:22 PM]

Share this post


Link to post
Share on other sites
Hrm..

If you are not doing so already you should have a copy of sun 1.3.1 around to make sure it''s not a problem that is isolated to 1.4.0. There are many little, but signifigant, changes between the two versions.

Share this post


Link to post
Share on other sites
it is much more bothering than i thought first, all widgets of all screens are always active!
It''s not the wrong screen which has the focus but all widget that are active, independant from the screen they belong to!
(thank you for the tip snowmoon, but now, i don''t think anymore it is related to the JDK, but i''ll try it anyway, to be 100% sure)

Share this post


Link to post
Share on other sites
well, i''ve manually resolved that by adding code in a GFWidgetScreen inherited class. It consists of auto-enabling/disabling all widgets of the screen when gaining/loosing focus control. It''s maybe not the nicest way to do it but it works.

Share this post


Link to post
Share on other sites