cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31297] New: - Javaflow can't call inherited methods
Date Sun, 19 Sep 2004 13:57:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31297>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31297

Javaflow can't call inherited methods

           Summary: Javaflow can't call inherited methods
           Product: Cocoon 2
           Version: Current CVS 2.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Flowscript
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: Nikolaus@rath.org


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.

Mime
View raw message