Wicket ever expects some markup in the associated HTML template to the code. The line that is the originator of your Exception is in Component.class see
private final void internalRender()
{
...
MarkupElement elem = markup.get(0);
...
}
That code gets a 'root' element of the associated markup. A code without any markup is a non-sence in Wicket.
TIP: If you just want to handle a request, mount a shareable resource or some of other resources other then a page.