I was running this task from within Eclipse. However, it does not give me a
stack trace. This is what I do get:
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: C:\src\JavaPTSObjectModel\build.xml
parsing buildfile C:\src\JavaPTSObjectModel\build.xml with URI =
file:///C:/src/JavaPTSObjectModel/build.xml
Project base dir set to: C:\src\JavaPTSObjectModel
Arguments: -verbose -Dorg.eclipse.ant.ui.ATTR_ANT_PROCESS_ID=1084813642728
Build sequence for target `generate.java' is [generate.java]
Complete build sequence is [generate.java, setProps, init.install,
build.woframework, install, copy.strings, clean, init.build, build, ]
generate.java:
[taskdef] dropping \c from path as it doesn't exist
[wogen] Error generating classes.
BUILD FAILED: C:\src\JavaPTSObjectModel\build.xml:82: Error generating
classes.
Total time: 156 milliseconds
So I tried to get it running from the command line. I had not yet set this
up on my new box.
I was unsure if one of the existing jars from my 1.1.0.25 WOLips build
would work, so I downloaded WOProject 1.0.7.37 and put the cayenne*.jar and
woproject.jar in my ant\lib directory and added a wogen taskdef to my
build.xml like this:
<target name="generate.java">
<taskdef name="wogen" classname=
"org.objectstyle.woproject.ant.WOGenerator">
<!-- <classpath refid="classpath"/> -->
</taskdef>
<wogen model="GeneratedEO.subproj/PTS.eomodeld" destDir=
"GeneratedEO.subproj"/>
<wogen model="GeneratedEO.subproj/PTS.eomodeld" destDir=
"CustomEO.subproj"/>
<delete verbose="true">
<fileset dir="GeneratedEO.subproj">
<include name="**/*.java"/>
<exclude name="**/_*.java"/>
</fileset>
<fileset dir="CustomEO.subproj">
<include name="**/_*.java"/>
</fileset>
</delete>
</target>
Running this from the command line produces:
C:\src\JavaPTSObjectModel>ant -v generate.java
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: build.xml
Detected Java version: 1.4 in: C:\J2SDK1~1.2_0\jre
Detected OS: Windows XP
parsing buildfile C:\src\JavaPTSObjectModel\build.xml with URI =
file:///C:/src/JavaPTSObjectModel/build.xml
Project base dir set to: C:\src\JavaPTSObjectModel
Build sequence for target `generate.java' is [generate.java]
Complete build sequence is [generate.java, setProps, init.install,
build.woframework, install, copy.strings, clean, init
.build, build, ]
generate.java:
[wogen] Error generating classes.
BUILD FAILED
C:\src\JavaPTSObjectModel\build.xml:82: Error generating classes.
at
org.objectstyle.cayenne.tools.CayenneGenerator.execute(CayenneGenerator.java:120)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: java.lang.NullPointerException
at
org.objectstyle.cayenne.wocompat.EOModelProcessor.makeRelationships(EOModelProcessor.java:285)
at
org.objectstyle.cayenne.wocompat.EOModelProcessor.loadEOModel(EOModelProcessor.java:109)
at
org.objectstyle.woproject.ant.WOGenerator.loadDataMap(WOGenerator.java:89)
at
org.objectstyle.cayenne.tools.CayenneGenerator.processMap(CayenneGenerator.java:125)
at
org.objectstyle.cayenne.tools.CayenneGenerator.execute(CayenneGenerator.java:117)
... 10 more
--- Nested Exception ---
java.lang.NullPointerException
at
org.objectstyle.cayenne.wocompat.EOModelProcessor.makeRelationships(EOModelProcessor.java:285)
at
org.objectstyle.cayenne.wocompat.EOModelProcessor.loadEOModel(EOModelProcessor.java:109)
at
org.objectstyle.woproject.ant.WOGenerator.loadDataMap(WOGenerator.java:89)
at
org.objectstyle.cayenne.tools.CayenneGenerator.processMap(CayenneGenerator.java:125)
at
org.objectstyle.cayenne.tools.CayenneGenerator.execute(CayenneGenerator.java:117)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Total time: 1 second
C:\src\JavaPTSObjectModel>
Hope this helps. Let me know if I can give any further information. I
probably cannot give access to the EOModels themselves as this information
is sensitive, but I will try to answer any questions about them that I can.
These models are from an older version of WO (I think 3.5) that I am
updating to WO 5.2.x
thanks,
Logan
Andrus Adamchik
<andru..bjectsty To: woproject-dev@objectstyle.org
le.org> cc:
Subject: Re: wogen task
05/15/2004 12:59
PM
Hi!
When you are doing "ant -v", Ant must print an exception stack. Could
you post it here - it should tell exactly what failed in the process.
Thanks
Andrus
On May 12, 2004, at 9:07 PM, logan.allre..onvergys.com wrote:
> I just started working on a project (framework) where I would like to
> use
> the wogen task. However, I cannot get it to work.
>
> Eclipse 3M8, WOLips 1.1.0.25, Win XP Pro
>
> I added a target to my build.xml file (I realize my directory setup is
> a
> bit different, but I have to maintain compatibility with legacy project
> here):
>
> <target name="generate.java">
> <wogen model="GeneratedEO.subproj/PTS.eomodeld" destDir=
> "GeneratedEO.subproj"/>
> <wogen model="GeneratedEO.subproj/PTS.eomodeld" destDir=
> "CustomEO.subproj"/>
> <delete verbose="true">
> <fileset dir="GeneratedEO.subproj">
> <include name="**/*.java"/>
> <exclude name="**/_*.java"/>
> </fileset>
> <fileset dir="CustomEO.subproj">
> <include name="**/_*.java"/>
> </fileset>
> </delete>
> </target>
>
> but when I run this target, all I get is:
>
> Apache Ant version 1.6.1 compiled on February 12 2004
> Buildfile: c:\src\PTSObjectModel\build.xml
> parsing buildfile c:\src\PTSObjectModel\build.xml with URI =
> file:///C:/src/PTSObjectModel/build.xml
> Project base dir set to: C:\src\PTSObjectModel
> Arguments: -verbose
> -Dorg.eclipse.ant.ui.ATTR_ANT_PROCESS_ID=1084405600968
> Build sequence for target `generate.java' is [generate.java]
> Complete build sequence is [generate.java, setProps, init.install,
> build.woframework, install, copy.strings, clean, init.build, build, ]
>
> generate.java:
> [wogen] Error generating classes.
> BUILD FAILED: C:\src\PTSObjectModel\build.xml:79: Error generating
> classes.
> Total time: 156 milliseconds
>
> line 79 is the first <wogen> invocation. The webpage example says it's
> <wogen map=..., but the docs say it's <wogen model=.... I tried them
> both
> and they both give the same error.
>
> Any ideas what I'm doing wrong? I downloaded EOGenerator from Rubicode
> and
> it works great, but it would be nice to keep it all in Eclipse.
>
> Also, in my External Tools setup, I'm only choosing the target
> "generate.java", and it has no dependencies, but the complete build
> sequence includes all of the other targets as well. Is that a bug in
> how
> WOLips calls the build file, or am I doing something wrong in my build
> file
> or when I run the ant task?
>
> thanks,
> Logan Allred
This archive was generated by hypermail 2.0.0 : Mon May 17 2004 - 13:20:21 EDT