You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Guruprasad R <gu...@gmail.com> on 2006/01/18 13:40:44 UTC

command execution

I am using ant on my Windows 2000 OS. I want to execute a command "java
weblogic.ejbc npacejb.jar" from a particular directory in the command prompt
using ANT. i have written the script as below. I am not sure whether i have
written the script properly.

 <target name="exectask" depends="makejar">
  <exec executable="cmd" os="Windows 2000" command="/c java weblogic.ejbc
npacejb.jar">
   <arg line="${src}/classes"/>
  </exec>

i am getting a message as "Please use the executable attribute and nested
arg elements." how do i do this? Please help.

Re: command execution

Posted by Guruprasad R <gu...@gmail.com>.
hi again, got my problem solved. I gave the actual path in the args field
and its working.

On 1/19/06, Guruprasad R <gu...@gmail.com> wrote:
>
> hi all,
> finally i am using the java task to do it.
>
> <target name="exectask">
>   <java dir="${src}/classes" classpathref="class.path" classname="
> weblogic.ejbc" args="npacejb.jar"/>
> </target>
>
> here, i am getting
> exectask:
>      [java] The args attribute is deprecated. Please use nested arg
> elements.
>      [java] Working directory ignored when same JVM is used.
>      [java] ERROR: source file: npacejb.jar could not be found.
>
> It seems like the ANT is not executing the command as mentioned in *dir*.
> Please help.
>
>
>
> On 1/19/06, Stefan Bodewig <bo...@apache.org> wrote:
> >
> > On Wed, 18 Jan 2006, Guruprasad R. <gu...@gmail.com> wrote:
> >
> > > i am getting a message as "Please use the executable attribute and
> > > nested arg elements." how do i do this? Please help.
> >
> > Take your command attribute's value and add it to <arg line=""/> prior
> > to the other <arg> you have, remove the command attribute completely.
> >
> > Stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>

Re: command execution

Posted by Guruprasad R <gu...@gmail.com>.
hi all,
finally i am using the java task to do it.

<target name="exectask">
  <java dir="${src}/classes" classpathref="class.path" classname="
weblogic.ejbc" args="npacejb.jar"/>
</target>

here, i am getting
exectask:
     [java] The args attribute is deprecated. Please use nested arg
elements.
     [java] Working directory ignored when same JVM is used.
     [java] ERROR: source file: npacejb.jar could not be found.

It seems like the ANT is not executing the command as mentioned in *dir*.
Please help.



On 1/19/06, Stefan Bodewig <bo...@apache.org> wrote:
>
> On Wed, 18 Jan 2006, Guruprasad R. <gu...@gmail.com> wrote:
>
> > i am getting a message as "Please use the executable attribute and
> > nested arg elements." how do i do this? Please help.
>
> Take your command attribute's value and add it to <arg line=""/> prior
> to the other <arg> you have, remove the command attribute completely.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: command execution

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 18 Jan 2006, Guruprasad R. <gu...@gmail.com> wrote:

> i am getting a message as "Please use the executable attribute and
> nested arg elements." how do i do this? Please help.

Take your command attribute's value and add it to <arg line=""/> prior
to the other <arg> you have, remove the command attribute completely.

Stefan

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


Re: command execution

Posted by Clifton Craig <cc...@gbg.com>.
Even better than "even better than that", DAO interfaces implemented ala 
Spring JDBC. Skip EJB all together! ;) Now I'm gonna leave this alone at the 
risk of being waaaaay off topic and starting a religous debate.

--------------------------------------------------- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
ccc@icsaward.com
ccraig@gbg.com

On Wednesday 18 January 2006 9:40 am, Steve Loughran wrote:
> Clifton Craig wrote:
> > Even better than that, you don't need <exec/> or <java/>. Use <ejbc/>
> > instead!
>
> better yet, hibernate3.1+ejb3 annotations :)
> <javac>, <jar>
>
> -steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

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


Re: command execution

Posted by Steve Loughran <st...@apache.org>.
Clifton Craig wrote:
> Even better than that, you don't need <exec/> or <java/>. Use <ejbc/> instead!

better yet, hibernate3.1+ejb3 annotations :)
<javac>, <jar>

-steve

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


Re: command execution

Posted by Clifton Craig <cc...@gbg.com>.
Even better than that, you don't need <exec/> or <java/>. Use <ejbc/> instead!
--------------------------------------------------- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
ccc@icsaward.com
ccraig@gbg.com

On Wednesday 18 January 2006 7:59 am, Jeffrey E Care wrote:
> You don't need <exec> - use <java> instead.

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


Re: command execution

Posted by Jeffrey E Care <ca...@us.ibm.com>.
You don't need <exec> - use <java> instead.

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


Guruprasad R <gu...@gmail.com> wrote on 01/18/2006 07:40:44 AM:

> I am using ant on my Windows 2000 OS. I want to execute a command "java
> weblogic.ejbc npacejb.jar" from a particular directory in the command 
prompt
> using ANT. i have written the script as below. I am not sure whether i 
have
> written the script properly.
> 
>  <target name="exectask" depends="makejar">
>   <exec executable="cmd" os="Windows 2000" command="/c java 
weblogic.ejbc
> npacejb.jar">
>    <arg line="${src}/classes"/>
>   </exec>
> 
> i am getting a message as "Please use the executable attribute and 
nested
> arg elements." how do i do this? Please help.