When I try to use the spring plugin with the following Ant script, I get an Access denied exception which does not really make sense because the hibernate plugin works fine.. Any ideas ?
 
 
 
 
Exception details:
 

C:\Development\Project\XPer\managexp\build.xml:52: java.lang.RuntimeException:
ouldn't generate content
        at org.nanocontainer.ant.PicoContainerTask.execute(PicoContainerTask.ja
a:104)
        at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java :369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultEx
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java :187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.RuntimeException: Couldn't generate content
        at org.generama.Plugin.start(Plugin.java:217)
        at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoCon
ainer.java:349)
        at org.nanocontainer.integrationkit.LifecycleContainerBuilder.autoStart
LifecycleContainerBuilder.java:52)
        at org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildCont
iner(LifecycleContainerBuilder.java:45)
        at org.nanocontainer.ant.PicoContainerTask.execute (PicoContainerTask.ja
a:95)
        ... 12 more
Caused by: java.io.FileNotFoundException: C:\Development\Project\XPer\managexp\
onfig\appcontext (Access denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.generama.defaults.FileWriterMapper.getOutcome (FileWriterMapper.j
va:25)
        at org.generama.Plugin.start(Plugin.java:197)
        ... 16 more
--- Nested Exception ---
java.lang.RuntimeException: Couldn't generate content
        at org.generama.Plugin.start (Plugin.java:217)
        at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoCon
ainer.java:349)
        at org.nanocontainer.integrationkit.LifecycleContainerBuilder.autoStart
LifecycleContainerBuilder.java :52)
        at org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildCont
iner(LifecycleContainerBuilder.java:45)
        at org.nanocontainer.ant.PicoContainerTask.execute(PicoContainerTask.ja
a:95)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultEx
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java :668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.io.FileNotFoundException: C:\Development\Project\XPer\managexp\
onfig\appcontext (Eri■im engellendi)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>( FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.generama.defaults.FileWriterMapper.getOutcome(FileWriterMapper.j
va:25)
        at org.generama.Plugin.start (Plugin.java:197)
        ... 16 more

Total time: 1 second
C:\Development\Project\XPer\managexp>

 

 

Ant Script

 

<project name="managexp" default="generate.springcontext.files">
 <property name="src.dir" location="JavaSource" />
 <property name="tools.dir" location="tools" />
 <property name="web.dir" location="WebContent" />
 <property name="webinf.dir" location="${web.dir}/web-inf" />
 <property name="lib.dir" location="${ webinf.dir}/lib" />
 <property name="classes.dir" location="${webinf.dir}/classes" />
 <property name="config.dir" location="config" />
 <property name=" mappings.dir" location="${config.dir}/mappings" />
 <property name="appcontext.dir" location="${config.dir}/appcontext" />
 <property name="verbose" value="true" />

 

 <path id="tool.path">
  <fileset dir="${tools.dir}">
   <include name="**/*.jar" />
  </fileset>
 </path>

 <path id="class.path">

  <path refid="tool.path" />

  <fileset dir="${lib.dir}">
   <include name="**/*.jar" />
  </fileset>
 </path>

 <taskdef name="xdoclet2" classname="org.xdoclet.ant.XDocletTask" classpathref="tool.path" />

 <target name="init">
  <mkdir dir="${classes.dir}" />
  <mkdir dir="${config.dir}" />
  <mkdir dir="${mappings.dir}" />
  <mkdir dir="${ appcontext.dir}" />
 </target>

 <target name="compile" depends="init">
  <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="class.path" />
 </target>

 <target name="generate.hbmxml.files" depends="init">
  <xdoclet2>
   <fileset dir="${src.dir}">
    <include name="**/*.java" />
   </fileset>
   <component classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin" destdir="${mappings.dir}" version="3.0" force="true" validate="false" encoding="UTF-8" />
  </xdoclet2>
 </target>

 <target name="generate.springcontext.files">
  <xdoclet2>
   <fileset dir="${src.dir}">
    <include name="**/*.java" />
   </fileset>
   <component classname=" org.xdoclet.plugin.spring.SpringConfigXMLPlugin" destdir="${appcontext.dir}"  />
  </xdoclet2>
 </target>
 </project>

 
Thanks
Cenk Civici
 
 

Reply via email to