Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.8
-
None
-
None
-
Operating System: Linux
Platform: PC
-
31297
Description
A class named FlowHandler contains this method:
public void doInvokeMain()
{
try {
setParent(null);
doInvoke();
} catch (CommandException e) {
// Because we are the top level handler, something bad
// must have happened
throw new RuntimeException("Unhandled command: " +
e.getCommand());
}
}
MenuBarHandler is a class inherited from FlowHandler. The following does *not*
work (from sitemap.xmap):
<map:flow language="java">
<map:script src="org.rath.votra.MenuBarHandler"/>
</map:flow>
[...]
<map:match pattern="start">
<map:call function="invokeMain" />
</map:match>
When accessing the start URI, cocoon produces an InstantiationException.
When I add the doInvokeMain method directly to the MenuBarHandler class,
everything works fine:
/* If we do not define this method here, we get an
java.lang.InstantiationException
from cocoon. Seems to be a bug. */
public void doInvokeMain() {
super.doInvokeMain();
}
It seems that cocoon can't call inherited methods as flow handlers.
public void doInvokeMain()
{
try {
setParent(null);
doInvoke();
} catch (CommandException e) {
// Because we are the top level handler, something bad
// must have happened
throw new RuntimeException("Unhandled command: " +
e.getCommand());
}
}
MenuBarHandler is a class inherited from FlowHandler. The following does *not*
work (from sitemap.xmap):
<map:flow language="java">
<map:script src="org.rath.votra.MenuBarHandler"/>
</map:flow>
[...]
<map:match pattern="start">
<map:call function="invokeMain" />
</map:match>
When accessing the start URI, cocoon produces an InstantiationException.
When I add the doInvokeMain method directly to the MenuBarHandler class,
everything works fine:
/* If we do not define this method here, we get an
java.lang.InstantiationException
from cocoon. Seems to be a bug. */
public void doInvokeMain() {
super.doInvokeMain();
}
It seems that cocoon can't call inherited methods as flow handlers.