Yep. Looks like cayenne-project-3.1.jar is missing in Frank's taskdef 
classpath. It can be downloaded from here:

http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|3.1|jar
http://search.maven.org/remotecontent?filepath=org/apache/cayenne/cayenne-project/3.1/cayenne-project-3.1.jar

And we probably need to add it to the downloadable distro (as many of us are 
Maven users and are getting dependencies "for free", I guess this went 
unnoticed).

Andrus

> On Jan 26, 2016, at 9:15 PM, Mike Kienenberger <[email protected]> wrote:
> 
> It's probably a classpath issue with your taskdef.
> 
> For instance, this is what mine looks like:
> 
>    <!-- classpath for cayenne class generator -->
>    <path id="generate.classpath">
>        <pathelement path ="${lib-build.dir}/cayenne-tools-3.1B2.jar"/>
>        <pathelement path
> ="${lib-build.dir}/cayenne-project-3.1B3-SNAPSHOT.jar"/>
>        <pathelement path ="${lib-build.dir}/foundrylogic-vpp-2.2.1.jar"/>
>        <pathelement path
> ="${lib.dir}/cayenne-server-3.1B3-SNAPSHOT-patched.jar"/>
>        <pathelement path ="${lib.dir}/commons-collections-3.2.2.jar"/>
>        <pathelement path ="${lib.dir}/commons-logging-1.2.jar"/>
>        <pathelement path ="${lib.dir}/log4j-1.2.17.jar"/>
>        <pathelement path ="${lib.dir}/velocity-1.3.1.jar"/>
>        <pathelement path ="${lib.dir}/jakarta-oro.jar"/>
>    </path>
> 
> 
>    <taskdef name="cgen"
> classname="org.apache.cayenne.tools.CayenneGeneratorTask">
>        <classpath refid="generate.classpath"/>
>    </taskdef>
> 
> 
> 
> On Tue, Jan 26, 2016 at 1:03 PM, Frank Herrmann
> <[email protected]> wrote:
>> I'm experimenting with using the cgen ant task to generate our objects.
>> However, it is producing this error. Is this a known bug, or am I doing
>> something wrong?
>> 
>> Thanks for the help.
>> 
>> -Frank
>> 
>> Cayenne Version: 3.1
>> 
>> Ant target:
>> 
>> <target name="generate-cayenne-objects">
>>> <cgen map="src/EMADomainMap.map.xml"
>>>    destDir=""
>>>    makepairs="true"
>>>    template="scripts/cayenne-template-subclass.vm"
>>>    supertemplate="scripts/cayenne-template-superclass.vm"
>>>    superpkg="src/com/m2/data/auto">
>>> </cgen>
>>> </target>
>> 
>> 
>> Error produced:
>> 
>> frank-herrmann-mbp:ema frank.herrmann$ ant generate-cayenne-objects
>>> Buildfile: /Users/frank.herrmann/git/ema/build.xml
>>> generate-cayenne-objects:
>>>     [cgen] Generating class file:
>>> /Users/frank.herrmann/git/ema/com/m2/data/AsyncJob.java
>>>     [cgen] Generating superclass file:
>>> /Users/frank.herrmann/git/ema/src/com/m2/data/auto/_AuditEventLog.java
>>> BUILD FAILED
>>> /Users/frank.herrmann/git/ema/build.xml:2648:
>>> org.apache.velocity.exception.MethodInvocationException: Invocation of
>>> method 'formatVariableName' in  class org.apache.cayenne.gen.StringUtils
>>> threw exception class java.lang.NoClassDefFoundError :
>>> org/apache/cayenne/project/validation/NameValidationHelper
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:309)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:207)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:250)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
>>> at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:344)
>>> at
>>> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:153)
>>> at
>>> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:271)
>>> at org.apache.velocity.Template.merge(Template.java:296)
>>> at
>>> org.apache.cayenne.gen.ClassGenerationAction.execute(ClassGenerationAction.java:239)
>>> at
>>> org.apache.cayenne.gen.ClassGenerationAction.execute(ClassGenerationAction.java:211)
>>> at
>>> org.apache.cayenne.tools.CayenneGeneratorTask.execute(CayenneGeneratorTask.java:130)
>>> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
>>> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>> at org.apache.tools.ant.Task.perform(Task.java:348)
>>> at org.apache.tools.ant.Target.execute(Target.java:435)
>>> at org.apache.tools.ant.Target.performTasks(Target.java:456)
>>> at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
>>> at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
>>> at
>>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>>> at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
>>> at org.apache.tools.ant.Main.runBuild(Main.java:853)
>>> at org.apache.tools.ant.Main.startAnt(Main.java:235)
>>> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
>>> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
>> 
>> 
>> --
>> FRANK HERRMANN
>> SOFTWARE ENGINEER
>> 
>> T: 561-880-2998 x1563
>> 
>> E: [email protected]
>> 
>> 
>> 
>> [image: [ Modernizing Medicine ]] <http://www.modmed.com/>
>> [image: [ Facebook ]] <http://www.facebook.com/modernizingmedicine> [image:
>> [ LinkedIn ]] <http://www.linkedin.com/company/modernizing-medicine/> [image:
>> [ YouTube ]] <http://www.youtube.com/user/modernizingmedicine> [image: [
>> Twitter ]] <https://twitter.com/modmed_EMA> [image: [ Blog ]]
>> <http://www.modmed.com/BlogBeyondEMR> [image: [ Instagram ]]
>> <http://instagram.com/modernizing_medicine>

Reply via email to