You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by shwitzu <sh...@gmail.com> on 2009/09/25 23:47:35 UTC

Need Help urgent

Hi I am having trouble with the Ant build file which I am using in my
program. I am not able to copy the JAR files which are being generated in
the workspace to the deploy folder of jboss. Please let me know what changes
should I do. Here is the build file.

<project name="Sensor EJB" default="jar" basedir=".">

	<target name="init">
		<property name="src.dir" value="${basedir}/src" />
		<property name="classes.dir" value="${basedir}/classes" />
		<property name="jboss.home" value="C:\jboss-4.2.3.GA" />
		<property name="out.dir" value="${basedir}/build" />
		<property name="jboss.deploy" value="${jboss.home}/server/default/deploy"
/>
	</target>

	<target name="build" depends="init">
		<mkdir dir="${classes.dir}" />
		<mkdir dir="${out.dir}" />
		<javac srcdir="${src.dir}" destdir="${classes.dir}">
			<classpath>
				<fileset dir="${jboss.home}/client">
					<include name="**/*.jar" />
				</fileset>
				<pathelement location="${classes.dir}" />
			</classpath>
		</javac>
	</target>

	<target name="clean" depends="init">
		<delete dir="${classes.dir}" quiet="true" />
		<delete dir="${out.dir}" quiet="true" />
	</target>

	<target name="deploy" depends="clean,jar">
		<copy file="${out.dir}/sensorDemo.jar" toDir="${jboss.deploy}" />
	</target>

	<target name="jar" depends="build">
		<mkdir dir="${out.dir}/ejb-jar/META-INF" />
		<mkdir dir="${out.dir}/ejb-jar/lib" />

		<copy file="${basedir}/conf/persistence.xml"
toDir="${out.dir}/ejb-jar/META-INF" />

		<copy toDir="${out.dir}/ejb-jar">
			<fileset dir="${classes.dir}">
				<include name="**/Sensor/data/**" />
				<include name="**/Sensor/ejb/**" />
			</fileset>
		</copy>

		<jar destfile="${out.dir}/sensorDemo.jar">
			<fileset dir="${out.dir}/ejb-jar">
				<include name="**/*" />
			</fileset>
		</jar>

		<jar destfile="${out.dir}/sensor-clt.jar">
			<fileset dir="${classes.dir}">
				<include name="**/Sensor/ejb/**" />
				<exclude name="**/Sensor/ejb/*EJB*" />
				<include name="**/Sensor/client/*.class" />
				<include name="**/Sensor/data/**" />
			</fileset>
		</jar>
	</target>

	<target name="run-once" depends="jar">
		<java classname="src.HEMS.Sensor.client.FakeTest">
			<classpath>
				<pathelement location="${jboss.home}/client/commons-logging.jar" />
				<pathelement location="${jboss.home}/client/jbossall-client.jar" />
				<pathelement location="${jboss.home}/client/ejb3-persistence.jar" />
				<pathelement location="${out.dir}/sensor-clt.jar" />
			</classpath>
		</java>
	</target>

</project>

http://www.nabble.com/file/p25619778/stateful-build.xml stateful-build.xml 
-- 
View this message in context: http://www.nabble.com/Need-Help-urgent-tp25619778p25619778.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need Help urgent

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Fri, Sep 25, 2009 at 23:47, shwitzu <sh...@gmail.com> wrote:
>
> Hi I am having trouble with the Ant build file which I am using in my
> program. I am not able to copy the JAR files which are being generated in
> the workspace to the deploy folder of jboss. Please let me know what changes
> should I do. Here is the build file.
>
> <project name="Sensor EJB" default="jar" basedir=".">
>
>        <target name="init">
>                <property name="src.dir" value="${basedir}/src" />
>                <property name="classes.dir" value="${basedir}/classes" />
>                <property name="jboss.home" value="C:\jboss-4.2.3.GA" />
>                <property name="out.dir" value="${basedir}/build" />
>                <property name="jboss.deploy" value="${jboss.home}/server/default/deploy"
> />
>        </target>
>

Before going further, why does this target exist at all?

You don't need to have a target just to define properties. Just define
them right below <project>, it will make the file simpler (your clean
target won't depend on init anymore).


-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need Help urgent

Posted by shwitzu <sh...@gmail.com>.


Hello,

I tried to see the log file but there is no hint in that. Still not able to
figure out what the issue is..

The log file is as follows
init:

build:
    [javac] Compiling 63 source files to C:\Documents and
Settings\sag\Sagarika\A\classes
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

jar:
     [copy] Copying 8 files to C:\Documents and
Settings\sag\Sagarika\A\build\ejb-jar
      [jar] Building jar: C:\Documents and
Settings\sag\Sagarika\A\build\sensorDemo.jar
      [jar] Building jar: C:\Documents and
Settings\sag\Sagarika\A\build\sensor-clt.jar
BUILD SUCCESSFUL

BUILD SUCCESSFUL


thanks,

glenn opdycke-hansen wrote:
> 
> Perhaps you can find the answer by running ant in verbose mode (-v) and
> write the messages to a file with
> 
> <record name="log.txt" action="start"/>
> 
> --glenn
> 
> On Fri, Sep 25, 2009 at 16:47, shwitzu <sh...@gmail.com> wrote:
> 
>>
>> Hi I am having trouble with the Ant build file which I am using in my
>> program. I am not able to copy the JAR files which are being generated in
>> the workspace to the deploy folder of jboss. Please let me know what
>> changes
>> should I do. Here is the build file.
>>
>> <project name="Sensor EJB" default="jar" basedir=".">
>>
>>        <target name="init">
>>                <property name="src.dir" value="${basedir}/src" />
>>                <property name="classes.dir" value="${basedir}/classes" />
>>                <property name="jboss.home" value="C:\jboss-4.2.3.GA" />
>>                <property name="out.dir" value="${basedir}/build" />
>>                <property name="jboss.deploy"
>> value="${jboss.home}/server/default/deploy"
>> />
>>        </target>
>>
>>   ...
>>
>>        <target name="clean" depends="init">
>>                <delete dir="${classes.dir}" quiet="true" />
>>                <delete dir="${out.dir}" quiet="true" />
>>        </target>
>>
>>        <target name="deploy" depends="clean,jar">
>>                <copy file="${out.dir}/sensorDemo.jar"
>> toDir="${jboss.deploy}" />
>>        </target>
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-Help-urgent-tp25619778p25622480.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need Help urgent

Posted by glenn opdycke-hansen <gl...@gmail.com>.
Perhaps you can find the answer by running ant in verbose mode (-v) and
write the messages to a file with

<record name="log.txt" action="start"/>

--glenn

On Fri, Sep 25, 2009 at 16:47, shwitzu <sh...@gmail.com> wrote:

>
> Hi I am having trouble with the Ant build file which I am using in my
> program. I am not able to copy the JAR files which are being generated in
> the workspace to the deploy folder of jboss. Please let me know what
> changes
> should I do. Here is the build file.
>
> <project name="Sensor EJB" default="jar" basedir=".">
>
>        <target name="init">
>                <property name="src.dir" value="${basedir}/src" />
>                <property name="classes.dir" value="${basedir}/classes" />
>                <property name="jboss.home" value="C:\jboss-4.2.3.GA" />
>                <property name="out.dir" value="${basedir}/build" />
>                <property name="jboss.deploy"
> value="${jboss.home}/server/default/deploy"
> />
>        </target>
>
>   ...
>
>        <target name="clean" depends="init">
>                <delete dir="${classes.dir}" quiet="true" />
>                <delete dir="${out.dir}" quiet="true" />
>        </target>
>
>        <target name="deploy" depends="clean,jar">
>                <copy file="${out.dir}/sensorDemo.jar"
> toDir="${jboss.deploy}" />
>        </target>
>
>

Re: Need Help urgent

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Sat, Sep 26, 2009 at 00:45, shwitzu <sh...@gmail.com> wrote:
>
> @ Frank
> Thanks for responding
>
> Even though i remove the properties from the target I am still getting the
> same error.
>
> My problem is with the following part of the code
>
> <target name="deploy" depends="clean,jar">
>                <copy file="${out.dir}/sensorDemo.jar"
> toDir="${jboss.deploy}" />
>        </target>
>
>
> from the out.dir - i.e. the work place I am asking the ant to copy the
> sensorDemo.jar to JBoss deploy directory. But that isnt happening. I really
> dont understand the reason. Any help would be appreciated.Let me know if you
> need more information.
>

If you try to copy it to some other directory, say /tmp if you use a
Unix-like OS or C:\tmp if you use Windows, do you see the copied file
in the target directory?

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Need Help urgent

Posted by shwitzu <sh...@gmail.com>.
@ Frank
Thanks for responding

Even though i remove the properties from the target I am still getting the
same error.

My problem is with the following part of the code

<target name="deploy" depends="clean,jar">
                <copy file="${out.dir}/sensorDemo.jar"
toDir="${jboss.deploy}" />
        </target>


from the out.dir - i.e. the work place I am asking the ant to copy the
sensorDemo.jar to JBoss deploy directory. But that isnt happening. I really
dont understand the reason. Any help would be appreciated.Let me know if you
need more information.

THanks




shwitzu wrote:
> 
> Hi I am having trouble with the Ant build file which I am using in my
> program. I am not able to copy the JAR files which are being generated in
> the workspace to the deploy folder of jboss. Please let me know what
> changes should I do. Here is the build file.
> 
> <project name="Sensor EJB" default="jar" basedir=".">
> 
> 	<target name="init">
> 		<property name="src.dir" value="${basedir}/src" />
> 		<property name="classes.dir" value="${basedir}/classes" />
> 		<property name="jboss.home" value="C:\jboss-4.2.3.GA" />
> 		<property name="out.dir" value="${basedir}/build" />
> 		<property name="jboss.deploy"
> value="${jboss.home}/server/default/deploy" />
> 	</target>
> 
> 	<target name="build" depends="init">
> 		<mkdir dir="${classes.dir}" />
> 		<mkdir dir="${out.dir}" />
> 		<javac srcdir="${src.dir}" destdir="${classes.dir}">
> 			<classpath>
> 				<fileset dir="${jboss.home}/client">
> 					<include name="**/*.jar" />
> 				</fileset>
> 				<pathelement location="${classes.dir}" />
> 			</classpath>
> 		</javac>
> 	</target>
> 
> 	<target name="clean" depends="init">
> 		<delete dir="${classes.dir}" quiet="true" />
> 		<delete dir="${out.dir}" quiet="true" />
> 	</target>
> 
> 	<target name="deploy" depends="clean,jar">
> 		<copy file="${out.dir}/sensorDemo.jar" toDir="${jboss.deploy}" />
> 	</target>
> 
> 	<target name="jar" depends="build">
> 		<mkdir dir="${out.dir}/ejb-jar/META-INF" />
> 		<mkdir dir="${out.dir}/ejb-jar/lib" />
> 
> 		<copy file="${basedir}/conf/persistence.xml"
> toDir="${out.dir}/ejb-jar/META-INF" />
> 
> 		<copy toDir="${out.dir}/ejb-jar">
> 			<fileset dir="${classes.dir}">
> 				<include name="**/Sensor/data/**" />
> 				<include name="**/Sensor/ejb/**" />
> 			</fileset>
> 		</copy>
> 
> 		<jar destfile="${out.dir}/sensorDemo.jar">
> 			<fileset dir="${out.dir}/ejb-jar">
> 				<include name="**/*" />
> 			</fileset>
> 		</jar>
> 
> 		<jar destfile="${out.dir}/sensor-clt.jar">
> 			<fileset dir="${classes.dir}">
> 				<include name="**/Sensor/ejb/**" />
> 				<exclude name="**/Sensor/ejb/*EJB*" />
> 				<include name="**/Sensor/client/*.class" />
> 				<include name="**/Sensor/data/**" />
> 			</fileset>
> 		</jar>
> 	</target>
> 
> 	<target name="run-once" depends="jar">
> 		<java classname="src.HEMS.Sensor.client.FakeTest">
> 			<classpath>
> 				<pathelement location="${jboss.home}/client/commons-logging.jar" />
> 				<pathelement location="${jboss.home}/client/jbossall-client.jar" />
> 				<pathelement location="${jboss.home}/client/ejb3-persistence.jar" />
> 				<pathelement location="${out.dir}/sensor-clt.jar" />
> 			</classpath>
> 		</java>
> 	</target>
> 
> </project>
> 
>  http://www.nabble.com/file/p25619778/stateful-build.xml
> stateful-build.xml 
> 

-- 
View this message in context: http://www.nabble.com/Need-Help-urgent-tp25619778p25620349.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org