Re: Parse refactoring

From: Malcolm Edgar (malcolm.edga..mail.com)
Date: Sun Dec 11 2005 - 02:02:21 EST

  • Next message: Andrus Adamchik: "M9 heads up"

    Hi Will & company,

    Regarding the cause of the problem.

    This is the code from Cayenne class ResultDirective (Cayenne 1.2 M6):

    import org.apache.velocity.runtime.parser.node.Node;

        protected Object getChild(InternalContextAdapter context, Node node, int
    i)
            throws MethodInvocationException {
            return (i >= 0 && i < node.jjtGetNumChildren())
                ? node.jjtGetChild(i).value(context)
                : null;
        }

    When running with Velocity 1.5-dev this throwing the exception:

    Caused by: java.lang.NoSuchMethodError:
    org.apache.velocity.runtime.parser.node.Node.jjtGetChild
    (I)Lorg/apache/velocity/runtime/parser/node/Node;
        at org.objectstyle.cayenne.access.jdbc.ResultDirective.getChild(
    ResultDirective.java:190)

    As the Node.jttGetChild(i) returns:

    org.apache.velocity.runtime.parser.Node

    rather than:

    org.apache.velocity.runtime.parser.node.Node

    This issue, plus another Velocity/Cayenne issue of a disappearing object
    reference in the velocity Context, is causing a lot of grief. We have been
    burning a lot of time over the last couple of weeks trying identify the
    latter issue, plus having to rollback Velocity changes maintain Cayenne
    compatability.

    The Velocity stability issue is really hurting us, and we are at the point
    of deciding whether to swap Velocity out for FreeMarker. This is not a fun
    option, as I have invested a bunch of time into Velocity, and we have
    applications out there which will need to be reworked if we do this.

    I hope we can work out some solution

    regards Malcolm Edgar

    On 12/4/05, Will Glass-Husain <wglas..orio.com> wrote:
    >
    > Hmm..
    >
    > This is awkward. Hard to improve a product when other apps rely on the
    > internal method calls.
    >
    > Do you know the specific change in Velocity which broke Cayenne?
    >
    > WILL
    >
    > ----- Original Message -----
    > From: "Malcolm Edgar" <malcolm.edga..mail.com>
    > To: "Velocity Developers List" <velocity-de..akarta.apache.org>
    > Sent: Saturday, December 03, 2005 2:53 AM
    > Subject: Parse refactoring
    >
    >
    > Hi Guys,
    >
    > Velocity parser was refactored a few weeks ago, the directory was changed
    > from memory. This is breaking compatablity with Cayenne which uses
    > Velocity
    > 1.4.
    >
    > Click has been using 1.5-dev up until now, but this change is leaving me
    > in
    > no mans land.
    >
    > Is is possible that this change could be rolled back.
    >
    > regards Malcolm Edgar
    >
    > Stack trace:
    >
    > java.lang.NoSuchMethodError:
    > org.apache.velocity.runtime.parser.node.Node.jjtGetChild
    > (I)Lorg/apache/velocity/runtime/parser/node/Node;
    >
    > at org.objectstyle.cayenne.access.jdbc.ResultDirective.getChild(
    > ResultDirective.java:190)
    > at
    > org.objectstyle.cayenne.access.jdbc.ResultDirective.getChildAsString(
    > ResultDirective.java:202)
    > at org.objectstyle.cayenne.access.jdbc.ResultDirective.render(
    > ResultDirective.java:151)
    > at org.apache.velocity.runtime.parser.node.ASTDirective.render(
    > ASTDirective.java:117)
    > at org.apache.velocity.runtime.parser.node.SimpleNode.render(
    > SimpleNode.java:240)
    > at
    > org.objectstyle.cayenne.access.jdbc.SQLTemplateProcessor.buildStatement(
    > SQLTemplateProcessor.java:219)
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: velocity-dev-unsubscrib..akarta.apache.org
    > For additional commands, e-mail: velocity-dev-hel..akarta.apache.org
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Dec 11 2005 - 02:02:23 EST