Re: strange cgen behavior

From: Mike Kienenberger (mkienen..mail.com)
Date: Mon Jan 02 2006 - 13:47:42 EST

  • Next message: Andrea Borgogelli Avveduti: "Re: Newbie: AUTO_PK_SUPPORT problem"

    Any chance you could try this with M5 and M7? It should be a matter
    of pointing your cgen taskdef to the alternate jar file.

    I made changes to cgen on M5 and M7, and I'd like to narrow it down a bit.
    M5 had the majority of the changes, and M7 had one minor change to the
    Velocity engine instantiantion.

    If it's broke after M7, then it's probably due to a change outside of
    the cgen code, and Andrus will have to investigate.

    On 1/2/06, Bryan Lewis <brya..aine.rr.com> wrote:
    > I'm trying 1.2-M9 and the cgen task is acting strangely. The generation
    > works as usual for the first seven entities (out of 214), but on the eighth
    > it runs into a problem. I added some print statements to the source and
    > narrowed it down a bit.
    >
    > EntityResolver.constructCache() calls ObjectEntity.getJavaClass() on my
    > entity model.AutoUpdate.
    > (It's a small class, nothing special about it that I can see, only one
    > method.)
    > It calls Util.getJavaClass(name) which gets
    > "java.lang.ClassNotFoundException: model.AutoUpdate".
    >
    > The task continues, however, and 17 entities later it stops in almost the
    > same place, Util.getJavaClass() calling Class.forName(). It gives an error
    > message "Error generating classes: common/ExceptionAdapter" which is strange
    > because that's a small utility class in a different package that happens to
    > be imported by the entity.
    >
    > I read the new docs and saw new options for cgen, but they're optional and
    > I didn't think they'd break the way I was using it. Which is:
    >
    > <target name="cgen">
    > <taskdef name="cgen"
    > classname="org.objectstyle.cayenne.tools.CayenneGenerator"/
    > <cgen map="conf/DataMap.map.xml"
    > destDir="src"
    > template="conf/subclass.vm"
    > supertemplate="conf/superclass.vm"
    > superpkg="model.auto"
    > usepkgpath="true"
    > />
    > </target>
    >
    > I've reduced my model to only two entities, trying to make a simple test
    > case, and the problem is still happening. I tried removing my two template
    > lines, no diff. This worked fine in 1.2M4.
    >



    This archive was generated by hypermail 2.0.0 : Mon Jan 02 2006 - 13:47:44 EST