Components can no longer be added

2013-12-08 Thread Colin Rogers
Wicketeers,

I have another hard-to-track down issue.

To make matters worse, I've actually taken this code/pattern, put it into a 
quickstart - and what do you know - it works fine...! This means I have no way 
to recreate this error in a demonstrable way. Hopefully if I throw this out 
there, someone might be able to describe the error and I can then determine 
what I'm doing to cause it. Unfortunately google has zero results for;

+Components can no  longer be added +wicket

Anyway... the exception I'm getting is;

java.lang.IllegalStateException: Components can no  longer be added
 at 
org.apache.wicket.ajax.AbstractAjaxResponse.assertNotFrozen(AbstractAjaxResponse.java:740)
 at 
org.apache.wicket.ajax.AbstractAjaxResponse.assertComponentsNotFrozen(AbstractAjaxResponse.java:733)
 at 
org.apache.wicket.ajax.AbstractAjaxResponse.add(AbstractAjaxResponse.java:358)
 at 
org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:239)
 at 
org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:232)
 at 
org.apache.wicket.extensions.markup.html.repeater.tree.TableTree.updateBranch(TableTree.java:178)
 at 
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:204)
 at myapp.TreeUtils.expandNode(TreeUtils.java:25)
 at myapp.TreeUtils.expandAll(TreeUtils.java:19)


It is caused when refreshing a table-tree component, that had previous rendered 
correctly and had successfully expanded the nodes. This problem happens when 
the table-trees parent component is refreshed, in which the table is rebuilt 
from new, and replaced the old table. Having debugged the code, it's something 
to do with the AjaxRequestHandler that has been retrieved - in that it's 
components are 'frozen'. It's odd as I'm in  the onConfigure() part of the 
lifecycle, and therefore components should be okay to be added - especially as 
they are brand new components. Could the AjaxRequestHandler being retrieved be 
the wrong one, stale one?

List I said - I can't recreate it in a Quickstart, so there is obviously 
something else in the 100k+s of the projects code that is doing something else 
to mess it up.

The 'Tree Utils' class looks like this;

public class TreeUtils {

@SuppressWarnings(unchecked)
public static void expandAll( AbstractTree? tree ) {

// stupid cast!! Has to happen for use to retrieve the roots, 
generically.
AbstractTreeObject castTree = (AbstractTreeObject) tree;

Iterator? roots = tree.getProvider().getRoots();
while( roots.hasNext() ) {

Object root = roots.next();
expandNode( castTree, root );
}
}

private static void expandNode( AbstractTreeObject tree, Object node) {

tree.expand(node);

Iterator? children = tree.getProvider().getChildren(node);
while( children.hasNext() ) {

Object child = children.next();
expandNode( tree, child );
}
}
}


Any pointers and tips would be greatly appreciated.

Cheers,
Col.
EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.


Re: Components can no longer be added

2013-12-08 Thread Bernard
Hi,

I am an expert in shooting myself in the foot with Wicket / Java
problems.

In a situation like this, I would do the same as you do - isolate the
pattern and make a quickstart. Unfortunately, this approach is full of
assumptions, and my statistics say that this succeeds only in 20% of
all cases.

So I usually have to do it the hard way: Take a copy of the
application and strip it down generation by generation until the
culprit is isolated in its most simplistic form.

I think in 50% of all cases, I could see my own fault. In the other
50% I submitted a Wicket jira issue, where again in 50% of these it
was my fault not Wicket.

Regards,

Bernard



On Mon, 9 Dec 2013 05:28:52 +, you wrote:

Wicketeers,

I have another hard-to-track down issue.

To make matters worse, I've actually taken this code/pattern, put it into a 
quickstart - and what do you know - it works fine...! This means I have no way 
to recreate this error in a demonstrable way. Hopefully if I throw this out 
there, someone might be able to describe the error and I can then determine 
what I'm doing to cause it. Unfortunately google has zero results for;

+Components can no  longer be added +wicket

Anyway... the exception I'm getting is;

java.lang.IllegalStateException: Components can no  longer be added
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.assertNotFrozen(AbstractAjaxResponse.java:740)
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.assertComponentsNotFrozen(AbstractAjaxResponse.java:733)
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.add(AbstractAjaxResponse.java:358)
 at 
 org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:239)
 at 
 org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:232)
 at 
 org.apache.wicket.extensions.markup.html.repeater.tree.TableTree.updateBranch(TableTree.java:178)
 at 
 org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:204)
 at myapp.TreeUtils.expandNode(TreeUtils.java:25)
 at myapp.TreeUtils.expandAll(TreeUtils.java:19)


It is caused when refreshing a table-tree component, that had previous 
rendered correctly and had successfully expanded the nodes. This problem 
happens when the table-trees parent component is refreshed, in which the table 
is rebuilt from new, and replaced the old table. Having debugged the code, 
it's something to do with the AjaxRequestHandler that has been retrieved - in 
that it's components are 'frozen'. It's odd as I'm in  the onConfigure() part 
of the lifecycle, and therefore components should be okay to be added - 
especially as they are brand new components. Could the AjaxRequestHandler 
being retrieved be the wrong one, stale one?

List I said - I can't recreate it in a Quickstart, so there is obviously 
something else in the 100k+s of the projects code that is doing something else 
to mess it up.

The 'Tree Utils' class looks like this;

public class TreeUtils {

@SuppressWarnings(unchecked)
public static void expandAll( AbstractTree? tree ) {

// stupid cast!! Has to happen for use to retrieve the roots, 
 generically.
AbstractTreeObject castTree = (AbstractTreeObject) tree;

Iterator? roots = tree.getProvider().getRoots();
while( roots.hasNext() ) {

Object root = roots.next();
expandNode( castTree, root );
}
}

private static void expandNode( AbstractTreeObject tree, Object node) {

tree.expand(node);

Iterator? children = tree.getProvider().getChildren(node);
while( children.hasNext() ) {

Object child = children.next();
expandNode( tree, child );
}
}
}


Any pointers and tips would be greatly appreciated.

Cheers,
Col.
EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and 
with authority, states them to be the considered view, opinion, conclusions, 
advice or statement of this company. Every care is taken but we recommend that 
you scan any attachments for viruses.


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: 

RE: Components can no longer be added

2013-12-08 Thread Colin Rogers
Yeah, I know exactly what you mean - I'm sure it's something I'm doing! :)

I might have to do as you suggest... I was just hoping for a 'you'd only get 
this error if you'd done something stupid like' and give me something to go 
on! ;)

Cheers,
Col.

-Original Message-
From: Bernard [mailto:bht...@gmail.com]
Sent: Monday, December 9, 2013 5:23 PM
To: users@wicket.apache.org
Subject: Re: Components can no longer be added

Hi,

I am an expert in shooting myself in the foot with Wicket / Java problems.

In a situation like this, I would do the same as you do - isolate the pattern 
and make a quickstart. Unfortunately, this approach is full of assumptions, and 
my statistics say that this succeeds only in 20% of all cases.

So I usually have to do it the hard way: Take a copy of the application and 
strip it down generation by generation until the culprit is isolated in its 
most simplistic form.

I think in 50% of all cases, I could see my own fault. In the other 50% I 
submitted a Wicket jira issue, where again in 50% of these it was my fault not 
Wicket.

Regards,

Bernard



On Mon, 9 Dec 2013 05:28:52 +, you wrote:

Wicketeers,

I have another hard-to-track down issue.

To make matters worse, I've actually taken this code/pattern, put it
into a quickstart - and what do you know - it works fine...! This means
I have no way to recreate this error in a demonstrable way. Hopefully
if I throw this out there, someone might be able to describe the error
and I can then determine what I'm doing to cause it. Unfortunately
google has zero results for;

+Components can no  longer be added +wicket

Anyway... the exception I'm getting is;

java.lang.IllegalStateException: Components can no  longer be added
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.assertNotFrozen(AbstractAjaxResponse.java:740)
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.assertComponentsNotFrozen(AbstractAjaxResponse.java:733)
 at 
 org.apache.wicket.ajax.AbstractAjaxResponse.add(AbstractAjaxResponse.java:358)
 at 
 org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:239)
 at 
 org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:232)
 at 
 org.apache.wicket.extensions.markup.html.repeater.tree.TableTree.updateBranch(TableTree.java:178)
 at 
 org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:204)
 at myapp.TreeUtils.expandNode(TreeUtils.java:25)
 at myapp.TreeUtils.expandAll(TreeUtils.java:19)


It is caused when refreshing a table-tree component, that had previous 
rendered correctly and had successfully expanded the nodes. This problem 
happens when the table-trees parent component is refreshed, in which the table 
is rebuilt from new, and replaced the old table. Having debugged the code, 
it's something to do with the AjaxRequestHandler that has been retrieved - in 
that it's components are 'frozen'. It's odd as I'm in  the onConfigure() part 
of the lifecycle, and therefore components should be okay to be added - 
especially as they are brand new components. Could the AjaxRequestHandler 
being retrieved be the wrong one, stale one?

List I said - I can't recreate it in a Quickstart, so there is obviously 
something else in the 100k+s of the projects code that is doing something else 
to mess it up.

The 'Tree Utils' class looks like this;

public class TreeUtils {

@SuppressWarnings(unchecked)
public static void expandAll( AbstractTree? tree ) {

// stupid cast!! Has to happen for use to retrieve the roots, 
 generically.
AbstractTreeObject castTree = (AbstractTreeObject) tree;

Iterator? roots = tree.getProvider().getRoots();
while( roots.hasNext() ) {

Object root = roots.next();
expandNode( castTree, root );
}
}

private static void expandNode( AbstractTreeObject tree, Object
 node) {

tree.expand(node);

Iterator? children = tree.getProvider().getChildren(node);
while( children.hasNext() ) {

Object child = children.next();
expandNode( tree, child );
}
}
}


Any pointers and tips would be greatly appreciated.

Cheers,
Col.
EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and 
with authority, states them to be the considered view, 

Show Stacktrace in ErrorPage

2013-12-08 Thread Christoph.Manig
Hello,

my application runs in deployment-mode and if an exception is thrown, wicket 
shows his internal error page without the stacktrace. Is there any possibility 
to show this stacktrace in this wicket error page? How can I get the stacktrace 
of an exception to show it in a custom error page?


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport  Logistics
Hoyerswerdaer Str. 18
01099 Dresden
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 - 209
email:  christoph.ma...@t-systems.com