I get this error (see below) when I try to build anything using ant with the
release 1.0.2 downloaded from Sourceforce today. We took the example
build.xml from the web site (and had to modify the versions and number of
included JARs somewhat), see below.
I have tried to remove Velocity or Jelly from the classpath, but that
generates a bunch of ClassNotFoundExceptions so it doesn't seem a viable way
forward. Does anyone know what is the cause of this ambiguity and how to
resolve it?
Best regards,
Jonas
This is the build.xml we're using:
<project name="xdoclet-sample" default="ejbdoclet">
<target name="ejbdoclet">
<mkdir dir="${output.dir}/META-INF"/>
<property name="xdoclet.lib.dir"
value="e:/nobill4beta/build/tools/xdoclet-plugins/1.0.2"/>
<path id="xdoclet.task.classpath">
<!-- Add the xdoclet2 plugins jar here -->
<pathelement
location="${xdoclet.lib.dir}/plugins/xdoclet-plugin-ejb-1.0.2.jar"/>
<!-- xdoclet2 runtime dependencies -->
<pathelement location="${xdoclet.lib.dir}/lib/xdoclet-2.0.3.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/generama-1.2.1-SNAPSHOT.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/picocontainer-1.0.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/nanocontainer-1.0-beta-3.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/nanocontainer-ant-1.0-beta-3.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/qdox-1.6-SNAPSHOT.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/velocity-1.4.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-collections-3.1.jar"/>
<pathelement location="${log4j.jar.path}"/>
<pathelement location="build/lib/jboss/4.0.2/log4j.jar"/>
<!-- <pathelement location="${xdoclet.lib.dir}/lib/log4j-1.2.8.jar"/>
-->
<pathelement
location="${xdoclet.lib.dir}/lib/commons-logging-1.0.4.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/dom4j-1.6.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-beanutils-1.7.0.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/commons-jexl-1.0.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-jelly-20050813.225330.jar"/>
<!--
<pathelement
location="${xdoclet.lib.dir}/lib/commons-jelly-tags-define-1.0.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-jelly-tags-xml-20050823.222913.jar"
/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-jelly-tags-define-1.0.jar"/>
<pathelement
location="${xdoclet.lib.dir}/lib/commons-jelly-tags-jsl-1.0.jar"/>
-->
<pathelement location="${xdoclet.lib.dir}/lib/jaxen-1.1-beta-4.jar"/>
<pathelement location="${xdoclet.lib.dir}/lib/saxpath-1.0-FCS.jar"/>
</path>
<taskdef
name="xdoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.task.classpath"
/>
<xdoclet>
<!-- defines the file handled by xdoclet2 -->
<fileset dir="modules/Platform/src">
<include name="**/*Bean.java"/>
</fileset>
<!-- defines the processing of a plugin -->
<component
classname="org.xdoclet.plugin.ejb.entity.PrimaryKeyClassPlugin"
destdir="${basedir}/target/xdoclet/"
/>
</xdoclet>
</target>
</project>
More specifically, the error is this:
org.picocontainer.defaults.AmbiguousComponentResolutionException: Ambiguous
inte
rface org.generama.TemplateEngine, resolves to multiple keys [class
org.generama
.JellyTemplateEngine, class org.generama.VelocityTemplateEngine]
at
org.picocontainer.defaults.DefaultPicoContainer.getComponentAdapterOf
Type(DefaultPicoContainer.java:166)
at
org.picocontainer.defaults.ComponentParameter.resolveAdapter(Componen
tParameter.java:59)
at
org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGr
eediestSatisifableConstructor(ConstructorInjectionComponentAdapter.java:88)
at
org.picocontainer.defaults.ConstructorInjectionComponentAdapter.insta
ntiateComponent(ConstructorInjectionComponentAdapter.java:193)
at
org.picocontainer.defaults.InstantiatingComponentAdapter.getComponent
Instance(InstantiatingComponentAdapter.java:48)
at
org.picocontainer.defaults.DecoratingComponentAdapter.getComponentIns
tance(DecoratingComponentAdapter.java:42)
at
org.picocontainer.defaults.CachingComponentAdapter.getComponentInstan
ce(CachingComponentAdapter.java:37)
at
org.picocontainer.defaults.DecoratingComponentAdapter.getComponentIns
tance(DecoratingComponentAdapter.java:42)
at
org.picocontainer.defaults.BeanPropertyComponentAdapter.getComponentI
nstance(BeanPropertyComponentAdapter.java:59)
at
org.picocontainer.defaults.DefaultPicoContainer.getComponentInstances
OfType(DefaultPicoContainer.java:274)
at
org.picocontainer.defaults.DefaultPicoContainer.getComponentInstances
OfTypeWithContainerAdaptersLast(DefaultPicoContainer.java:377)
at
org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoCont
ainer.java:347)
at
org.nanocontainer.integrationkit.LifecycleContainerBuilder.autoStart(
LifecycleContainerBuilder.java:52)
at
org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildConta
iner(LifecycleContainerBuilder.java:45)
at
org.nanocontainer.ant.PicoContainerTask.execute(PicoContainerTask.jav
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(DefaultExe
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.Main.start(Main.java:150)
at org.apache.tools.ant.Main.main(Main.java:240)