• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ant exception

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<?xml version="1.0"?>


<!-- ============================================== -->
<!-- -->
<!-- LRI Project build file -->
<!-- -->
<!-- ============================================== -->

<!DOCTYPE project [
<!ENTITY dependency SYSTEM "file ependency.xml">
]>

<project name="lri" default="main" basedir=".">


<property environment="env" />
<property file="build.properties" />
<property file="${user.home}/build.properties" />

<property name="src.dir" value="${basedir}/src/${project.name}${project.version}"/>
<property name="resources.dir" value="${basedir}/resources"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="jsp.dir" value="${basedir}/jsp"/>
<property name="html.dir" value="${basedir}/html"/>
<property name="web.dir" value="${basedir}/web"/>

<property name="assemble.dir" value="${basedir}/assemble"/>
<property name="jar.dir" value="${assemble.dir}/jar"/>

<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.dist.dir" value="${build.dir}/dist"/>

<path id="output.path">
<pathelement location="${build.classes.dir}" />
</path>
<path id="jar.path">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classes.path">
<!--
<fileset dir="${lib.dir}/WEB-INF/classes">
<include name="**/*.class"/>
<exclude name="**/lri/**/*" />
</fileset>
-->
<pathelement location="${lib.dir}/WEB-INF/classes" />
</path>

&dependency;

<!-- ============================================== -->
<!-- -->
<!-- Initialization -->
<!-- -->
<!-- ============================================== -->

<target name="init" >
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.dist.dir}"/>

</target>


<!-- ============================================== -->
<!-- -->
<!-- Main -->
<!-- -->
<!-- ============================================== -->

<target name="main">
<antcall target="clean" />
<antcall target="compile" />
<antcall target="jar" />
<antcall target="ejbc" />
<antcall target="war" />
<antcall target="ear" />
</target>

<!-- ============================================== -->
<!-- -->
<!-- Commpile -->
<!-- -->
<!-- ============================================== -->

<target name="compile" depends="init">

<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Compiling +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<javac
destdir="${build.classes.dir}"
debug="${compiler.debug}"
deprecation="${compiler.deprecation}"
compiler="${compiler.type}">

<classpath refid="output.path"/>
<classpath refid="classes.path"/>

<classpath refid="j2ee.path"/>
<classpath refid="thirdparty.path"/>
<classpath refid="jecf.path"/>
<classpath refid="parser.path"/>
<classpath refid="jrengine.path"/>
<classpath refid="jrviewer.path"/>

<classpath refid="alrrs.path"/>
<classpath refid="jar.path"/>

<src path="${src.dir}" />
</javac>

</target>

<!-- ============================================== -->
<!-- -->
<!-- Jar -->
<!-- -->
<!-- ============================================== -->

<target name="jar" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building jar files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${jar.name}" />
</delete>

<jar
basedir="${build.classes.dir}"
excludes="**"
jarfile="${build.dist.dir}/${pre-ejb.jar.name}"
>
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />

<exclude name="**/servlet/**/*" />
</fileset>

<metainf dir="${src.dir}/dd/ejb/META-INF" includes="*.xml" />

<manifest>
<attribute name="Class-Path" value="sfcUtilrel2_0.jar commsUtilrel1_2.jar sscUtilrel2_0.jar"/>
</manifest>

</jar>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Ejbc -->
<!-- -->
<!-- ============================================== -->

<target name="ejbc" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ EJBC +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<java classname="weblogic.ejbc"
fork="true">
<arg value="-keepgenerated"/>
<arg value="${build.dist.dir}/${pre-ejb.jar.name}"/>
<arg value="${build.dist.dir}/${ejb.jar.name}"/>
<classpath refid="j2ee.path"/>
</java>

</target>

<!-- ============================================== -->
<!-- -->
<!-- War -->
<!-- -->
<!-- ============================================== -->

<target name="war" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building war files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${war.name}" />
</delete>

<war
destFile="${build.dist.dir}/${war.name}"
webxml="${src.dir}/dd/web/WEB-INF/web.xml"
>
<fileset dir="${jsp.dir}" includes="**/*" />
<fileset dir="${src.dir}/dd/web">
<include name="WEB-INF/weblogic.xml" />
<include name="WEB-INF/crimsonTag.tld" />
</fileset>
<fileset dir="${resources.dir}">
<include name="pfk.properties" />
</fileset>

<lib dir="${lib.dir}/WEB-INF/lib" includes="*.jar" />

<classes dir="${lib.dir}/WEB-INF/classes">
<include name="**/*.class" />
<include name="**/*.dat" />
<exclude name="**/legal/**/*" />
</classes>
<classes dir="${build.classes.dir}">
<include name="**/*.class" />
</classes>
<classes
dir="${src.dir}/dd/web/WEB-INF/classes"
includes="PFK_en_US.properties"
/>
</war>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Ear -->
<!-- -->
<!-- ============================================== -->
<target name="ear" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building ear files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${ear.name}" />
</delete>

<ear
destfile="${build.dist.dir}/${ear.name}"
appxml="${src.dir}/dd/app/META-INF/application.xml"
>

<fileset dir="${build.dist.dir}"includes="${ejb.jar.name}" />
<fileset dir="${build.dist.dir}"includes="${war.name}" />

<fileset dir="${jar.dir}">
<include name="*.jar" />
<include name="alrrs-test.war" />
<exclude name="${ejb.jar.name}" />
<exclude name="${war.name}" />
</fileset>
</ear>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Clean -->
<!-- -->
<!-- ============================================== -->

<target name="clean" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Clean +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete dir="${build.dir}"/>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Deploy -->
<!-- -->
<!-- ============================================== -->

<target name="deploy">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Deploying into the application server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<copy todir="${weblogic.deploy.dir}">
<fileset dir="${build.dist.dir}" includes="${ear.name}" />
</copy>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Undeploy -->
<!-- -->
<!-- ============================================== -->

<target name="undeploy">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Undeploying from the application server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${weblogic.deploy.dir}" includes="${ear.name}" />
</delete>
</target>


<!-- ============================================== -->
<!-- -->
<!-- Setup webserver -->
<!-- -->
<!-- ============================================== -->

<target name="web.setup" >
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Setup the web server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<copy todir="${weblogic.webapp.dir}">

<fileset dir="${web.dir}">
<include name="**/**" />
<exclude name="**/CVS/**"/>
</fileset>
</copy>
</target>

</project>


I am getting two exceptions

1)Default target main does not exist in this project
2)java.io.FileNotFoundException: D:\eclipse\workspace\LRIProj\file ependency.xml (The system cannot find the file specified)

solutions urgently needed
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Default target main does not exist in this project


This means you have defined a target called "main" as the default for your project, but you have not implemented such a target.



java.io.FileNotFoundException: D:\eclipse\workspace\LRIProj\file \dependency.xml (The system cannot find the file specified)


This means that the file dependency.xml is not in your project. Make sure it exists and is in the same directory as your build file.
 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have implemented 'main' target.But Still I am getting exception.

I have dependency.xml file in the build.xml directory.Still I am getting above specified exceptions
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have implemented 'main' target.But Still I am getting exception.


Post the build file again so we can see what it looks like now. Be sure to disable smilies during the post, so that the contents do not get messed up, and also to use CODE tags, so that the formatting stays intact.
 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<?xml version="1.0"?>


<!-- ============================================== -->
<!-- -->
<!-- LRI Project build file -->
<!-- -->
<!-- ============================================== -->

<!DOCTYPE project [
<!ENTITY dependency SYSTEM "file:dependency.xml">
]>

<project name="lri" default="main" basedir=".">


<property environment="env" />
<property file="build.properties" />
<property file="${user.home}/build.properties" />

<property name="src.dir" value="${basedir}/src/${project.name}${project.version}"/>
<property name="resources.dir" value="${basedir}/resources"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="jsp.dir" value="${basedir}/jsp"/>
<property name="html.dir" value="${basedir}/html"/>
<property name="web.dir" value="${basedir}/web"/>

<property name="assemble.dir" value="${basedir}/assemble"/>
<property name="jar.dir" value="${assemble.dir}/jar"/>

<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.dist.dir" value="${build.dir}/dist"/>

<path id="output.path">
<pathelement location="${build.classes.dir}" />
</path>
<path id="jar.path">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classes.path">
<!--
<fileset dir="${lib.dir}/WEB-INF/classes">
<include name="**/*.class"/>
<exclude name="**/lri/**/*" />
</fileset>
-->
<pathelement location="${lib.dir}/WEB-INF/classes" />
</path>

&dependency;

<!-- ============================================== -->
<!-- -->
<!-- Initialization -->
<!-- -->
<!-- ============================================== -->

<target name="init" >
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.dist.dir}"/>

</target>


<!-- ============================================== -->
<!-- -->
<!-- Main -->
<!-- -->
<!-- ============================================== -->

<target name="main">
<antcall target="clean" />
<antcall target="compile" />
<antcall target="jar" />
<antcall target="ejbc" />
<antcall target="war" />
<antcall target="ear" />
</target>

<!-- ============================================== -->
<!-- -->
<!-- Commpile -->
<!-- -->
<!-- ============================================== -->

<target name="compile" depends="init">

<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Compiling +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<javac
destdir="${build.classes.dir}"
debug="${compiler.debug}"
deprecation="${compiler.deprecation}"
compiler="${compiler.type}">

<classpath refid="output.path"/>
<classpath refid="classes.path"/>

<classpath refid="j2ee.path"/>
<classpath refid="thirdparty.path"/>
<classpath refid="jecf.path"/>
<classpath refid="parser.path"/>
<classpath refid="jrengine.path"/>
<classpath refid="jrviewer.path"/>

<classpath refid="alrrs.path"/>
<classpath refid="jar.path"/>

<src path="${src.dir}" />
</javac>

</target>

<!-- ============================================== -->
<!-- -->
<!-- Jar -->
<!-- -->
<!-- ============================================== -->

<target name="jar" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building jar files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${jar.name}" />
</delete>

<jar
basedir="${build.classes.dir}"
excludes="**"
jarfile="${build.dist.dir}/${pre-ejb.jar.name}"
>
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />

<exclude name="**/servlet/**/*" />
</fileset>

<metainf dir="${src.dir}/dd/ejb/META-INF" includes="*.xml" />

<manifest>
<attribute name="Class-Path" value="sfcUtilrel2_0.jar commsUtilrel1_2.jar sscUtilrel2_0.jar"/>
</manifest>

</jar>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Ejbc -->
<!-- -->
<!-- ============================================== -->

<target name="ejbc" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ EJBC +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<java classname="weblogic.ejbc"
fork="true">
<arg value="-keepgenerated"/>
<arg value="${build.dist.dir}/${pre-ejb.jar.name}"/>
<arg value="${build.dist.dir}/${ejb.jar.name}"/>
<classpath refid="j2ee.path"/>
</java>

</target>

<!-- ============================================== -->
<!-- -->
<!-- War -->
<!-- -->
<!-- ============================================== -->

<target name="war" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building war files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${war.name}" />
</delete>

<war
destFile="${build.dist.dir}/${war.name}"
webxml="${src.dir}/dd/web/WEB-INF/web.xml"
>
<fileset dir="${jsp.dir}" includes="**/*" />
<fileset dir="${src.dir}/dd/web">
<include name="WEB-INF/weblogic.xml" />
<include name="WEB-INF/crimsonTag.tld" />
</fileset>
<fileset dir="${resources.dir}">
<include name="pfk.properties" />
</fileset>

<lib dir="${lib.dir}/WEB-INF/lib" includes="*.jar" />

<classes dir="${lib.dir}/WEB-INF/classes">
<include name="**/*.class" />
<include name="**/*.dat" />
<exclude name="**/legal/**/*" />
</classes>
<classes dir="${build.classes.dir}">
<include name="**/*.class" />
</classes>
<classes
dir="${src.dir}/dd/web/WEB-INF/classes"
includes="PFK_en_US.properties"
/>
</war>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Ear -->
<!-- -->
<!-- ============================================== -->
<target name="ear" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Building ear files +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${build.dist.dir}" includes="${ear.name}" />
</delete>

<ear
destfile="${build.dist.dir}/${ear.name}"
appxml="${src.dir}/dd/app/META-INF/application.xml"
>

<fileset dir="${build.dist.dir}"includes="${ejb.jar.name}" />
<fileset dir="${build.dist.dir}"includes="${war.name}" />

<fileset dir="${jar.dir}">
<include name="*.jar" />
<include name="alrrs-test.war" />
<exclude name="${ejb.jar.name}" />
<exclude name="${war.name}" />
</fileset>
</ear>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Clean -->
<!-- -->
<!-- ============================================== -->

<target name="clean" depends="init">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Clean +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete dir="${build.dir}"/>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Deploy -->
<!-- -->
<!-- ============================================== -->

<target name="deploy">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Deploying into the application server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<copy todir="${weblogic.deploy.dir}">
<fileset dir="${build.dist.dir}" includes="${ear.name}" />
</copy>
</target>

<!-- ============================================== -->
<!-- -->
<!-- Undeploy -->
<!-- -->
<!-- ============================================== -->

<target name="undeploy">
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Undeploying from the application server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<delete>
<fileset dir="${weblogic.deploy.dir}" includes="${ear.name}" />
</delete>
</target>


<!-- ============================================== -->
<!-- -->
<!-- Setup webserver -->
<!-- -->
<!-- ============================================== -->

<target name="web.setup" >
<echo>+ ===================================================== +</echo>
<echo>+ +</echo>
<echo>+ Setup the web server +</echo>
<echo>+ +</echo>
<echo>+ ===================================================== +</echo>

<copy todir="${weblogic.webapp.dir}">

<fileset dir="${web.dir}">
<include name="**/**" />
<exclude name="**/CVS/**"/>
</fileset>
</copy>
</target>

</project>

Now I am not getting exception.Here In this code
<!DOCTYPE project [
<!ENTITY dependency SYSTEM "file:dependency.xml">
]> I removed "file:" now its working.

anyway thanks for giving reply
 
reply
    Bookmark Topic Watch Topic
  • New Topic