Juergen
On 2/18/06, Riyad Kalla <
[EMAIL PROTECTED]> wrote:
Juergen & Others,
I can't seem to progress with my project now and did some digging after I was unsuccessful figuring out why this was happening. The stack trace is as follows:
---------------
Thread [http-8080-Processor24] (Suspended (breakpoint at line 4093 in Pattern$Dot))
Pattern$Dot.match(Matcher, int, CharSequence) line: 4093
Pattern$Branch.match(Matcher, int, CharSequence) line: 4530
Pattern$Branch.match(Matcher, int, CharSequence) line: 4530
Pattern$GroupHead.match(Matcher, int, CharSequence) line: 4570
Pattern$LazyLoop.matchInit(Matcher, int, CharSequence) line: 4780
Pattern$Prolog.match(Matcher, int, CharSequence) line: 4653
Pattern$BnM.match(Matcher, int, CharSequence) line: 5447
Matcher.search(int) line: 1092
Matcher.find() line: 528
Matcher.replaceAll(String) line: 802
String.replaceAll(String, String) line: 2000
MarkupParser.parseMarkup() line: 311
MarkupParser.readAndParse(IResourceStream) line: 236
MarkupCache.loadMarkup(String, IResourceStream, Class, MarkupContainer) line: 219
MarkupCache.loadMarkupAndWatchForChanges(String, IResourceStream, Class, MarkupContainer) line: 300
MarkupCache.getMarkup(MarkupContainer, Class) line: 183
MarkupCache.getMarkupStream(MarkupContainer, boolean) line: 100
MarkupCache.getMarkupStream(MarkupContainer) line: 83
ManageContentPage(MarkupContainer).getAssociatedMarkupStream() line: 710
ManageContentPage(Page).onRender() line: 778
ManageContentPage(Component).render() line: 1163
ManageContentPage(Page).doRender() line: 251
WebRequestCycle(RequestCycle).respond() line: 948
WebRequestCycle(RequestCycle).request() line: 411
WicketServlet.doGet(HttpServletRequest, HttpServletResponse) line: 208
WicketServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 689
WicketServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 252
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
StandardWrapperValve.invoke(Request, Response) line: 213
StandardContextValve.invoke(Request, Response) line: 178
StandardHostValve.invoke(Request, Response) line: 126
ErrorReportValve.invoke(Request, Response) line: 105
StandardEngineValve.invoke(Request, Response) line: 107
CoyoteAdapter.service(Request, Response) line: 148
Http11Processor.process(InputStream, OutputStream) line: 869
Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection, Object[]) line: 667
PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527
LeaderFollowerWorkerThread.runIt(Object[]) line: 80
ThreadPool$ControlRunnable.run() line: 684
ThreadWithAttributes(Thread).run() line: 595
---------------
So it looks like there is a problem with the markup in my page. The problem is the page validates fine AND the even more frustrating part is if I try and navigate back to the page enough times, the StackOverflow disappears and the page just starts working.
The only way I have found to reproduce it, is to restart tomcat and visit the page immediately for the first time. It fails with the StackOverflow then.
I started to get suspicious of my variables names (id, name, summary) they look like names that wicket might already be using. So I changed them all to include "XX" at the end of the name, that didn't help.
But the problem did seem to popup after I started mucking with ListView's removeLink to create the remove button, so I had a thought that might have caused the problem and went and commented out my vars:
------------
<tr wicket:id="pageList">
<td wicket:id="id">ID</td>
<!-- <td wicket:id="name">NAME</td>
<td wicket:id="summary">SUMMARY</td>
<td><button wicket:id="removeButton">Remove</button></td> -->
</tr>
------------
That didn't help, so I just commented ALL the vars out and put in plain text:
--------------
<tr wicket:id="pageList">
FUDGE
<!-- <td wicket:id="id">ID</td>
<td wicket:id="name">NAME</td>
<td wicket:id="summary">SUMMARY</td>
<td><button wicket:id="removeButton">Remove</button></td> -->
</tr>
--------------
My Page code now looks like this:
-----------
protected void populateItem(ListItem listItem)
{
PageDTO page = (PageDTO)listItem.getModelObject();
System.out.println("Page: " + page);
// listItem.add(new Label("id", page.getId().toString()));
// listItem.add(new Label("name", page.getName()));
// listItem.add(new Label("summary", page.getContent()));
// listItem.add(removeLink("removeButton", listItem));
}
-----------
Note that I print out the page? This actually prints every time no problem, it's just when the markup parser runs it goes bonkers. So now I tried my new empty page. STILL not working. So now I know something is definately wrong with my HTML according to wicket, so I'm going to start by commenting the whole page and working backward from there.
** NOTE: At this point I have to mention that simply hitting refresh after seeing that StackOverflow causes the page to load up just fine, with the page listed and everything exactly how it should work.
** ManageContentPage.html attached is the page before I started chopping it up.
Now just incase Wicket actually cares about comments, I'm not just going to comment out blocks, I'm going to actually remove them until this page works.
BAM. First try, I removed the first two commented divs out of the page and viola, the page works now (please see attachment). Now I go and put back all my page listing code and try and load the page (keep in mind each time I'm loading the page I'm restarting Tomcat). BAM, works fine... what's going on here? It seems to be the parsing of comments.
So now I'm going to go simulate the comment problem by adding:
<!-- BLAH
--><!--
BLAH2
-->
right where the two divs were and see if this does it. Nope, didn't break the page. So now I'm wondering if there was invalid HTML inside of my comments previously causing the parser to die BUT hiding the errors from me in my HTML editor. So now I put the divs back and uncommented them... no error markers, looks OK and now I load the page and BAMMO, "unable to find component home". So now I'm thinking "ohhh, wicket was trying to parse out the wicket:id's of the elements in the commented out block.", just to verify this, I put the comments back in, BUT went into the commented out DIVS and removed all the wicket:ids, but guess what? Page didn't load, we are back to the StackOverflowException.
So now I officially have no idea what is going on. I'm happy to send the project to whoever has any ideas, maybe the HTML is enough to run it through the parser to see what it doesn't like about it?
Please let me know if you need more.
Best,
Riyad
Juergen Donnerstag wrote:You could send me a junit test (see src/test) and I'll check it.
Juergen
On 2/17/06, Riyad Kalla <[EMAIL PROTECTED]> wrote:
In the last few days I've been developing an app trying to learn Wicket
and I've noticed for some reason or another I'll occasionally get a
StackOverflowException (from java.util.regex.Pattern) and I am having a
heck of a time tracking down what is causing it.
I did a search in both users and dev lists and found this post:
http://sourceforge.net/mailarchive/message.php?msg_id=11223256Which sounds similar to what I'm seeing, although the page it's dying on isn't using any custom models just a ListView. Java code below: --------------------- public ManageContentPage(PageParameters pageParameters)
{
PageDAO pageDAO =
(PageDAO)WebApplicationContextUtils.getWebApplicationContext(getWebRequestCycle().getWebSession().getHttpSession().getServletContext()).getBean("pageDAO");
add(new Label("title", "Manage Pages"));
add(new Label("header", "Manage Pages"));
add(new ListView("pageList", pageDAO.getPages())
{
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem listItem)
{
PageDTO page = (PageDTO)listItem.getModelObject();
System.out.println("Page: " + page);
listItem.add(new Label("id", page.getId().toString()));
listItem.add(new Label("name", page.getName ()));
listItem.add(new Label("summary",
page.getContent().substring(0, 64)));
listItem.add(removeLink("removeButton", listItem));
}
});
}
---------------------
HTML page below:
---------------------
<tbody>
<tr wicket:id="pageList">
<td wicket:id="id">ID</td>
<td wicket:id="name">NAME</td>
<td wicket:id="summary">SUMMARY</td>
<td><button wicket:id="removeButton">Remove</button></td>
</tr>
</tbody>
---------------------
The strange part is that when the DB is empty, no page records, I get
the endless stack trace and overflow above. But if I just add one
record, viola, it works fine. Can someone point out what checks I am
suppose to implement that I missed and why this code is totally blowing
instead of just displaying an empty table with no rows?
Best,
Riyad
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop-------------------------------------------------------http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 _______________________________________________
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop
HEADER
Existing Pages
ID Name Summary Action ID NAME SUMMARY Valid XHTML | Valid CSS | Copyright © kallasoft.com | Design by SmallPark