Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1270

Javaflow can't call inherited methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8
    • None
    • - Flowscript
    • 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.

      Attachments

        Activity

          People

            tcurdt Torsten Curdt
            nikolaus@rath.org Nikolaus Rath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: