ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suman N <>
Subject Reference <pathid> not found.
Date Fri, 05 Feb 2010 10:59:09 GMT

I am using Ant 1.8RC1.
I have a test.xml file, which is used to execute the same set of tests for 3 different application
server environments. (ie in SUN, IBM and SAP). We call 3 different commands to run the tests
in its corresponding environment.
 ant suntest
 ant ibmtest
 ant saptest

We set the application server specific path (sun.ejb.classpath, ibm.ejb.classpath, sap. ejb.classpath)
in suntest, ibmtest and saptest targets.
These targets will call its corresponding targets (suntest.without.clean, ibmtest.without.clean,
All these three targets will further call incontainertest, where we set the classpath by referencing
the path defined in suntest, ibmtest and saptest targets.

The truncated test.xml file is given below.

  <target name="suntest"
          description="Runs in-container tests against SUN.">
    <path id=" sun.ejb.classpath">
      <pathelement location="${WLS_HOME}/lib/weblogic.jar"/>
    <antcall target="suntest.without.clean" inheritRefs="true" inheritAll="true"/>

  <target name="ibmtest"
          description="Runs in-container tests against IBM.">

     <path id="ibm.ejb.classpath">
       <pathelement location="${}/properties"/>
       <pathelement path="${sysenv.WAS_HOME}/runtimes/"/>
       <pathelement path="${sysenv.WAS_HOME}/plugins/"/>
       <pathelement path="${sysenv.WAS_HOME}/plugins/"/>
    <path id="zos.ejb.classpath">
      <pathelement path="${sysenv.WAS_HOME}/lib/bootstrap.jar"/>
      <pathelement path="${sysenv.WAS_HOME}/lib/bootstrapws390.jar"/>
      <pathelement path="${sysenv.WAS_HOME}/lib/wasupgradews390.jar"/>
      <pathelement path="${sysenv.WAS_HOME}/plugins/"/>
    <antcall target="ibmtest.without.clean" inheritRefs="true" inheritAll="true"/>


  <target name="saptest"
          description="Runs in-container tests against NetWeaver SAP.">
    <path id="sap.ejb.classpath">
      <pathelement location="${sysenv.NAS_HOME}/j2ee/j2eeclient/"/>
      <pathelement location="${sysenv.NAS_HOME}/j2ee/j2eeclient/"/>
      <pathelement location="${sysenv.NAS_HOME}/j2ee/j2eeclient/"/>
      <pathelement location="${sysenv.NAS_HOME}/j2ee/cluster/bin/interfaces/container_api/"/>

    <antcall target="saptest.without.clean" inheritRefs="true" inheritAll="true"/>


  <target name=" suntest.without.clean">
    <property name="as.vendor" value="BEA"/>
    <antcall target=" incontainertest" inheritRefs="true" inheritAll="true">
      <param name="as.vendor" value="BEA"/>
      <param name="" value="true"/>
      <param name="curam.server.port" value="${curam.server.port}" />

  <target name=" ibmtest.without.clean ">
    <!-- 36877: Must set inheritall to true here, or the test failure override
         does not get propagated and clover fails before producing a report. -->
    <antcall target=" incontainertest" inheritRefs="true" inheritAll="true">
      <param name="as.vendor" value="IBM"/>
      <param name="" value="true"/>

  <target name="saptest.without.clean">
    <antcall target=" incontainertest" inheritRefs="true" inheritAll="true">
      <param name="as.vendor" value="SAP"/>
      <param name="" value="true"/>

  <target name="incontainertest" unless="disable.incontainertest">
    <antcall target="was.replace.encoding" inheritRefs="true" inheritAll="true"/>
    <junit fork="${java.fork}"
      <jvmarg value="-Xmx${java.maxmemory}"/>
      <jvmarg value=""/>
      <jvmarg value=""/>
      <jvmarg value=""/>
      <jvmarg value="${sas.client.props}.temp"/>
      <jvmarg value="${ssl.client.props}"/>
      <sysproperty key="curam.environment.tnameserv.port" value="${curam.environment.tnameserv.port}"/>
      <sysproperty key="curam.sdejtest.datasets.location" value="${dir.mod.testdatasets}"/>
      <sysproperty key="curam.sdejtest.vendor"            value="${as.vendor}"/>
      <sysproperty key="" value="true"/>
      <sysproperty key="curam.server.port"                value="${curam.server.port}"
      <sysproperty key="java.library.path"                value="${}"

        <path refid="junit.common.classpath"/>
        <path refid="sun.ejb.classpath"/>
       <path refid="ibm.ejb.classpath"/>
        <path refid="zos.ejb.classpath"/>
        <path refid="nas.ejb.classpath"/>
        <pathelement path="${jar.wsdl4j}"/>
        <!-- stubs of the beans -->
        <pathelement path="${dir.test.lib}/stubs.jar"/>
      <formatter type="plain" usefile="false"/>
      <formatter type="xml"/>
      <batchtest todir="${dir.junit.results}">
        <fileset dir="${dir.cls.unittests}"

We do set inheritRefs to true so that the called ant target will have references of all the
path defined in the calling target, but still we get the following error when we run any test.

Reference ibm.ejb.classpath not found.

I do know that the followin warning is thrown in ANT 1.7

Warning: Reference ibm.ejb.classpath has not been set at runtime, but was found during build
file parsing, attempting to resolve. Future versions of Ant may support  referencing ids defined
in non-executed targets.

If I define these path ids just under the project level, this works, but my requirement is
to define these path id's differently for different Application servers and hence, I cannot
define them in a non-executed target.
Is there any way in ANT 1.8RC1, where we can set these path id's differently for different
environments and then not get this error when setting the references to classpath.

Can use any conditional while setting the classpath?


The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you are not the intended
addressee please contact the sender and dispose of this e-mail. Thank you.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message